Jump to content

Calculate angle between two points not working for y-axis


Hudo1979
 Share

Recommended Posts

I have a demo at http://www.babylonjs-playground.com/#1JMZWJ#11

What I am try to do is create a cylinder between two points, but it seems calculation for y-axis doesn't work. in the demo I move the target in all three directions (x,y,z) and I can clearly see the cylinder doesn't connect two points, but if I comment away the movement of y axis, the angle seems to be correct, I am really puzzled, can anyone help me?

 

I am new at 3d programming and new at BabylonJS

Link to comment
Share on other sites

Thank you! so the error is the angle calculate only took consideration to two axis?

 

which way is more preferred, rotationQuertenion or rotationAroundAxis?

 

Could you please if possible explain what I did wrong?

 

Thank you so 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...