Jump to content

Understanding Up vectors in BabylonJS


kkimdev
 Share

Recommended Posts

I have been playing with the camera up vector in BabylonJS, but I feel like I don't understand how they actually work.  I created the following minimal example.

https://www.babylonjs-playground.com/#B8JZ20#1

To my understanding, the up vector should only affect the up direction, but in the example, if I change the up vector to +X or +Z, it no longer targets (0,0,0) which I set every frame.

 

I'm creating a game that Z is up vector, and can't get it stabilized https://www.babylonjs-playground.com/#ZJHCXB

 

Link to comment
Share on other sites

Hello

first i agree with you, Z Up is the natural and intuitive approach to explain out world, also the language of mathematics. Regardless of tutorials i can post, i feel you make it, on your own. Its really nothing BabylonJs do, it's about general attempt to imitate our world in 3D Graphics, you can read about it in DirectX or OpenGL, it doesn't matter. Theirs a need, like centuries before done by painters, to construct a camera and project, re-project 3D on to a 2D canvas, the monitor screen.   

And the short answer to your question: You can lean forth and back with you head , rotate it, but you can also lean/tilt sideways and that is the UP Vector.

 



v2fLWEQb_nYzKws84XSw2jpC45c4AjtV-N5TUZWr

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