Rotating only around y axis

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

Rotating only around y axis

Postby Carli » Fri Nov 20, 2009 9:06 am

Hi.
I'm writing a character controler and don't know how to determine the rotation to only the Y-Axis.
i used the search-function but none of them fitted to my issue.
Carli
 
Posts: 245
Joined: Fri Oct 02, 2009 5:28 am

Re: Rotating only around y axis

Postby Julio Jerez » Fri Nov 20, 2009 9:35 am

you need to use an upvector joint,
Julio Jerez
Moderator
Moderator
 
Posts: 12452
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Rotating only around y axis

Postby JernejL » Fri Nov 20, 2009 9:53 am

It is unclear what exactly you want (limit angles or get angles) so this will explain both:

Like Julio said, using NewtonConstraintCreateUpVector you can limit rotation to just 1 axis.
Using a newton function NewtonGetEulerAngle you can extract euler angles (in radians) from a matrix, using that you can find out the "heading" / Y rotation of the body.
Help improving the Newton Game Dynamics WIKI
User avatar
JernejL
 
Posts: 1587
Joined: Mon Dec 06, 2004 2:00 pm
Location: Slovenia

Re: Rotating only around y axis

Postby Carli » Fri Nov 20, 2009 11:48 am

thank you.
In the end, i will need both.
Carli
 
Posts: 245
Joined: Fri Oct 02, 2009 5:28 am


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 442 guests