Advertisement

Someone sort this out for me

Started by January 08, 2002 01:33 AM
3 comments, last by subnet_rx 23 years, 1 month ago
x''=z*sin(yaw)+x*cos(yaw) y''=y z''=z*cos(yaw)-x*sin(yaw) Matrix to rotate around x axis: [ cos(a) -sin(a) 0 0 ] [ sin(a) cos(a) 0 0 ] [ 0 0 1 0 ] [ 0 0 0 1 ] I don''t understand why the 0 0 1 is in the Z vector. Or is that the Z vector? Nevertheless, it doesn''t fit the Y vector anyway I look at it. What''s going on? subnet_rx

"There are two types of langages, those that everyone complains about, and those that no one uses."

Standardized C++ Libraries
C++ Programming help
The only news site on the web

"There are two types of languages, those that everyone complains about, and those that no one uses."Standardized C++ LibrariesGamecron PC GamingA Christian Blog
Your matrix performs a rotation around the Z axis through angle a. Only the x and y coordinates are affected, so the z row and columns of the matrix are the same of the identity matrix.

Your equations for x'', y'' and z'' reflect a point through a plane which contains the y axis, so the y axis is unchanged. For a rotation you want the sin and cos arranged in the same order as in the matrix, e.g.:

x'' = z*cos(a) - x*sin(a)
y'' = y
z'' = z*sin(a) + x*cos(a)

gives a rotation about the y axis.
John BlackburneProgrammer, The Pitbull Syndicate
Advertisement
both the matrix and the equations above are in the book as rotating around the x axis. But I just don''t see a correlation between the ordering the vectors in the matrix and the equations.

subnet_rx


"There are two types of langages, those that everyone complains about, and those that no one uses."

Standardized C++ Libraries

C++ Programming help

The only news site on the web

"There are two types of languages, those that everyone complains about, and those that no one uses."Standardized C++ LibrariesGamecron PC GamingA Christian Blog
What book? It''s wrong. Those are a Y rot and Z rot respectively.
ahh, just needed someone to say that. It didn't look right to me either, but since I'm the one learning, you really can't correct the teacher. It's in the 3D gaming tutorial series in the Resources section. Link here After looking at it, it doesn't actually say those formulas are the x rotation, but he makes it seem like it is x,y,z respectively for both. Confusing for a newb like me.


subnet_rx


"There are two types of langages, those that everyone complains about, and those that no one uses."

Standardized C++ Libraries

C++ Programming help

The only news site on the web


Edited by - subnet_rx on January 8, 2002 2:44:02 PM

"There are two types of languages, those that everyone complains about, and those that no one uses."Standardized C++ LibrariesGamecron PC GamingA Christian Blog

This topic is closed to new replies.

Advertisement