Jump to content

ArcRotateCamera around axes other than world X and Y


zhutq
 Share

Recommended Posts

Hi,


ArcRotateCamera is a really greate camera.
I'm wondering if it can be made around some other axes instead of world X and Y. Because I mainly work in a Z-up coordinate system, and sometimes, I need to align the viewport to an arbitrary rectangle in 3D and do some panning.

Using a parent for the camera can make rotation work but seems not panning:
http://www.babylonjs-playground.com/#12WBC#139

What I did was hacking the rebuildAnglesAndRadius and _getViewMatrix methods code, changing the computation of alpha, beta and target. This works for me but is too hacky.

What's your suggestion?
It's appreciated if there's a convenient way.

 

Thanks @Deltakosh for responding here https://github.com/BabylonJS/Babylon.js/issues/3392#issuecomment-351732710 .

Yes I did try to set the upVector to `new BABYLON.Vector3(0, 0, 1);` but it did not work.

http://www.babylonjs-playground.com/#12WBC#140

To what value should I set upVector?

 

Thank you very much!

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.

Guest
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.

Loading...
 Share

  • Recently Browsing   0 members

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