oschakravarthi

Members
  • Content Count

    106
  • Joined

  • Last visited

  • Days Won

    1

oschakravarthi last won the day on October 29 2018

oschakravarthi had the most liked content!

About oschakravarthi

  • Rank
    Advanced Member

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Hi, I am facing the same problem here. I have designed an apartment with 6 rooms. Light is going thru walls from 1st room to 6th room 😞 This is not the behavior of light in reality. It should stop at walls onless 1. The wall is set to be transparent. 2. If there are any windows of doors to that walls. How can I make the light stop at walls?. I could not understand the renderList stuff. Do I need to mention all my mesh IDs in the renderList of every light? I have 100s of meshes and I have around 10 lights in every room. 50, 60*100=6000 GUIDs in file. Please help me.
  2. Hi @RaananW, It is a good menu control. Thank you for this. Any more development on this? Any way to specify imageUrl to the menu item?
  3. WOW... unbelievable. Is the compass custom made or the source is available?
  4. Hi @Deltakosh Can you please help with same problem explained in a different thread ? Thanks in advance.
  5. Thank you @Raggar. I did not know that forum is available in babylonjs website. I will use forum going forward. Lets complete this question here. I added a dummy mesh and set it as the parent to my sphere. Now I set the scaling of the parent. It is not working as expected. I have updated the PG https://www.babylonjs-playground.com/#ASDN0P#3 Please have a look and help me. Thanks in advance.
  6. PG: https://www.babylonjs-playground.com/#ASDN0P#1 Hi,I am getting the same BoundingInfo after scaling the mesh. var bb1 = sphere.getBoundingInfo().boundingBox; sphere.scaling=new BABYLON.Vector3(2,2,2); sphere.refreshBoundingInfo(); var bb2 = sphere.getBoundingInfo().boundingBox; //I am getting a bounding box with the same values of bb1. var areEqual=bb1.minimumWorld.equals(bb2.minimumWorld) && bb1.maximumWorld.equals(bb2.maximumWorld); alert(areEqual); //It is showing "true". It should show "false" Thanks in advance
  7. Hi, How to build a tube light? I am trying to create a mesh (may be a box) which emits light exactly like a tube light. I am trying to edit the PG which @trevordev created for me. But the light's reflection is still like a spotlight. https://playground.babylonjs.com/#Z4ZGAY Do I need to do something with GlowLayer? Thanks in advance.
  8. Hi, First of all, hats off to these classes and work. 🙏 I am referring the example here. https://www.babylonjs-playground.com/#1Z71FW#9 I have a few questions. 1. When I move camera to a point inside the house and look at the ceiling, I don't see any roof. Why? 2. How to add a floor? One solution is: Setting a height of a plain roof to zero will become a floor. Will it be OK to do so? I did so but the floor is not visible when I move camera to a point inside the house. 3. How to set texture to individual walls? Can you please answer? I know that these samples intended to demonstrate the capabilities of building meshes at run-time but I would like to know answers for the questions. This will be a complete solution if we can set texture to individual walls and floors. Thanks in advance.
  9. Thank you @bghgary and @Wingnut @bghgary, in my example, we need to rotate the camera for 90 degrees and then 180 degrees. The same you implemented (hard-coded the values). When we generalize the problem, it will become "How to rotate camera (with animation) towards a point". So, now we need to compute the required Rotation Vector3 based on: 1. The current position of camera. 2. The current rotation of the camera. 3. The point to look at So, I am looking for a way to implement the below function. function computeRotationVectorToLookAtAPoint(currentPositionOfObject, currentRotationOfObject, pointToLookAt){ ////Compute the required rotation vector; return computedRotationVector. };
  10. Hi, I have Sphere1, Camera and Sphere2 in a straight line, Camera is now looking Sphere1. Now I need to very slowly turn camera to Sphere2. (May be 60 degrees per second) I tried doing so but it is turning very fast. Here is the PG. https://www.babylonjs-playground.com/#HI70D3 Please help me. Thanks in advance.
  11. Hi @Deltakosh I have gone thru this demo. https://www.babylonjs.com/demos/espilit/ It is amazing. The clarity is excellent. So far, what ever the model I design in 3DS Max or Maya, once I export it to .babylon or .gltf, I am losing the clarity. I would like to know 1. What 3D tool is used to design this model. 2. Is the .babylon file edited (may be in babylonjs editor) after it is exported. Thanks in advance.
  12. CSG stuff is not at all there. Earlier i tried implementing like that but facing issues. So, completely removes it. The bounding box stuff that you are seeing ia just to get the width and depth of the floor to loop thru to generate points
  13. I don't know if I can achieve this functionality with the built-in collision. for my model, when it is loaded, I do 1. for each floor mesh, for each of its facet, get the facet position and keep it in an array 2. In my UI, there is a button "Tour". When the user clicks this button, I need to animate camera to all these points. If the user is in kitchen and clicks on tour, then I need to plan my tour from that point. We need to use shortest path algorithms like Dijkstra/ Bellman-Ford and Travelling Salesman.
  14. Thank you @Sebavan for your support. My scene is an apartment. I need implement a functionality that the camera should go thru all the rooms . For this we need to findout obstacles. My algorithm in a nutshell. Phase 1: 1. for each mesh which is a floor, do a clipping. (As I dont know how to do it, I am calculating boundingBox and taking points) 2. for each point, fire a ray upwards at a distance of camera height. 2.1) If it wont touch any mesh, it means there is no object on the floor or there is no object hanging below camera height from the roof or wall. -- then add it into a points array. (These will be vertices for my graph) Phase 2: 1. for each point from this array check with every other point if it is its neighbour. 1.2 If it is a neighbour, then fire a ray towards this point. If the ray wont touch any mesh, then there is no obstacle (like a wall) between these two points, add an edge in the graph. Navigator.prototype._calculateAndUpdateNavigablePointsAndBuildGraph = function () { var _this = this; var cameraHeight = _this._cameraHeight; var walkableIdentificationStrategy = _this._walkableIdentificationStrategy; var strideLength = _this._strideLength; var scene = _this._scene; var direction = new BABYLON.Vector3(0, 1, 0); var navigablePoints = []; scene.meshes.forEach(m => { m.computeWorldMatrix(true); }); //Phase 1 scene.meshes.forEach(mesh => { if (walkableIdentificationStrategy(mesh)) { var boundingBox = mesh.getBoundingInfo().boundingBox; var min = boundingBox.minimumWorld; var max = boundingBox.maximumWorld; for (var x = min.x + (strideLength / 2); x <= max.x - (strideLength/2); x += strideLength) { for (var z = min.z + (strideLength / 2); z <= max.z - (strideLength / 2); z += strideLength) { var p = new BABYLON.Vector3(x, max.y, z); var ray = new BABYLON.Ray(p, direction, cameraHeight); var hit = scene.pickWithRay(ray, m => { if (!m.isVisible) { return false; } if (m === mesh) { return false; } if (walkableIdentificationStrategy(m)) { return false; } return true; }); if (!hit.pickedMesh) { var pointAtCameraHeight = new BABYLON.Vector3(p.x, p.y + cameraHeight, p.z); navigablePoints.push(pointAtCameraHeight); } } } } }); var indexDictionary = buckets.Dictionary(key => { return key.toString(); }); //Phase 2 var strideLengthDiagonal = Math.sqrt(2) * strideLength; var graph = new jsgraphs.WeightedDiGraph(navigablePoints.length); //var edgesCount = 0; for (var i = 0; i < navigablePoints.length; i++) { var pi = navigablePoints; indexDictionary.set(i, pi); for (var j = i + 1; j < navigablePoints.length; j++) { var pj = navigablePoints[j]; var distance = BABYLON.Vector3.Distance(pi, pj); if (distance <= strideLengthDiagonal) { var forwardRay = new BABYLON.Ray(pi, pj.subtract(pi), distance); var forwardHit = scene.pickWithRay(forwardRay, m => { if (!m.isVisible) { return false; } //if (m.name === "ray") { // return false; //} return true; }); if (!forwardHit.pickedMesh) { graph.addEdge(new jsgraphs.Edge(i, j, distance)); graph.addEdge(new jsgraphs.Edge(j, i, distance)); //edgesCount++; //var rayHelper = new BABYLON.RayHelper(forwardRay); //rayHelper.show(_this._scene); //console.log(i + "," + j); //var lines = BABYLON.MeshBuilder.CreateLines("lines", { points: [pi, pj] }, scene); } } } } //navigablePoints.forEach(p => { // var s = BABYLON.Mesh.CreateSphere("", 16, 0.1, scene); // s.position = p; //}); _this._navigablePoints = navigablePoints; _this._indexDictionary = indexDictionary; _this._graph = graph; };