AhmadAli Posted November 23, 2016 Share Posted November 23, 2016 Hello Guys, I loaded a babylon file with 2 meshes and i need to center the meshes on scene using ArcRotateCamera. Please help! Quote Link to comment Share on other sites More sharing options...
Wingnut Posted November 24, 2016 Share Posted November 24, 2016 Hi @AhmadAli! You give very little info. Are your 2 mesh NOT near center of scene... when you import them? Perhaps you need to change their .position ? (either in BJS scene or in modeler, before export) Can you look inside your .babylon file with a JSON viewer or notepad, and see what their .position is set-to? Are their pivot points set well? Off topic? *nod* Often, ArcRotateCamera's start with their .target at scene origin (0, 0, 0), but the .target is easy to adjust, anytime.http://www.babylonjs-playground.com/#104HTQ#3 It is easy to move-around arcCam .target. In line 9, it started at scene origin. But in the animation "render loop" (lines 35-40), I go crazy on it. I move it around with some sine/cosine orbit-stuff (fun!). SO, if you .position your mesh near-centered in the scene... and set your arcRotateCam .target near them, your camera should orbit/pivot around the mesh nicely. If you need to move the camera... to pivot-around mesh #1 ONLY, then set camera.target = mesh1.position. Same if you need camera to orbit only mesh2. Set the camera.target to mesh2.position. Hope this helps. Explain more, as needed. Good luck, stay in touch. 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.