mandim Posted December 8, 2017 Share Posted December 8, 2017 Hello, I'm a newbee at babylonjs and I'm currently learning the BJS engine as well as the blender for 3d modelling. I have a problem when I import a .babylon file that I have created in blender. What I want to do is after loading the model, to set an ArcRotate camera to the model. I'm using this propery in order to set the target: var assetsManager = new BABYLON.AssetsManager(scene); var boatMeshTask = assetsManager.addMeshTask("BoatTask", "Boat", "assets/Boat/", "tugboat.babylon"); boatMeshTask.onSuccess = function (task) { model = task.loadedMeshes[0]; model.position.z = -80; model.position.y = 3; camera.target = model; camera.lockedTarget = model; }; assetsManager.load(); ... The problem is that when I try to apply a rotation to the model at Z axis, my skybox rotates as well. I'm using BABYLON.Space.LOCAL. For translation I'm using the following code: model.rotate(BABYLON.Axis.Z, rotationAngle, BABYLON.Space.LOCAL); This is the model I try to load: https://cbml.ddns.net/index.php/s/gaRUgfazEjad4b7 Any suggestion; Quote Link to comment Share on other sites More sharing options...
Arte Posted December 8, 2017 Share Posted December 8, 2017 Hi @mandim Welcome to BJS forum. Set camera position: camera.setPosition(new BABYLON.Vector3(0,100,-100)); Set camera target: camera.target = model.position; GameMonetize 1 Quote Link to comment Share on other sites More sharing options...
mandim Posted December 11, 2017 Author Share Posted December 11, 2017 Many thanks my friend! You saved my day... Arte 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.