Dilshad Roshan

  • Content Count

  • Joined

  • Last visited

  1. Got it done as follows, when switching from UniversalCamera to ArcRotateCamera. var position = camera.position; var target = camera.getTarget(); var distance = BABYLON.Vector3.Distance(position, boundingBoxCenter); target.x = position.x + (target.x - position.x) * distance; target.y = position.y + (target.y - position.y) * distance; target.z = position.z + (target.z - position.z) * distance; camera = new BABYLON.ArcRotateCamera('ArcRotateCamera', 0, 0, 0, BABYLON.Vector3.Zero(), scene); camera.attachControl(canvas); camera.setPosition(position); camera.setTarget(target);
  2. Is there a way to pause and play all the animations in the existing scene?
  3. My app has feature for users to upload 3D models. So it is not always me who create and export meshes. So what I need to know is if there is any programmatic way to avoid this conflict.
  4. While importing meshes designed in software like Autocad and Blender, I noticed that the color of a previously imported mesh is getting applied to many meshes that are later imported. Then I realized that that this is due to conflicting material IDs. Is there a way to modify material ID of an imported mesh or is there any other solution to this problem?
  5. Thanks for the answers. But sorry Wingnut. It took some time for me to realize that the actual problem was not the camera switching. The camera gets switched back to arc rotate camera. The problem is that the axis of rotation of the arc rotate camera changes when I'm trying to switch back, standing at the point I've reached using universal camera, so that the rotation looks like looking around using universal camera.
  6. There are two buttons in my page for switching to ArcRotate camera and to Universal camera. When I click the button for Universal camera, it immediately switches to the same. But it always takes too many clicks on the ArcRotate camera button in order to switch to it. Why is it so? var cameraType = { FREE: 0, ARCROTATE: 1, WALKTHROUGH: 2, UNIVERSAL: 3 }; var cameraMode = { PERSPECTIVE: 0, ORTHOGRAPHIC: 1 }; this.setCameraAsArcRotate = function () { _cameraType = cameraType.ARCROTATE; }; this.setCameraAsUniversal = function () { _cameraType = cameraType.UNIVERSAL; };