Jump to content

center pivot


Recommended Posts

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.


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.

Link to comment
Share on other sites

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.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...