Skip to main content
gamedev.net
🔒 Locked

Euler Angle Camera

Started by Ademan555 Jan 8, 2005 at 7:02 AM 2 replies 700+ views
Original Post
Ademan555
Ademan555
Hi, I have a camera for my engine (well its not much as of now, considering it doesnt rotate right, lol) and i keep track of the Up, Right, and Forward vectors for it, now, based on a set of euler angles, id like to be able to calculate any two of those (ill just cross for the 3rd) Now this isnt that hard, but what i want to do, is not use matrices to do this, because if i have a matrix for yaw, pitch, and roll thats what, 12 trig functions? plus a bunch of multiplies and adds to concatonate all the matrices, now, there has got to be a way to skip over the matrices and rotate the vectors around the origin like that (now that doesnt sound hard, but only the first rotation would truely be around the origin, the rest would have to be in "object space") i actually have a formula to do this, but alas, its a lamothe book, and the equation is wrong, so, i googled, and found one that DID work, but unfortunately, it seems that the multiplication was in a different order, or the matrices were transposed. so anyways, i was hoping someone would be able to grasp waht the heck my tired brain is trying to say and have the equation for a vector rotated around the origin (i just had a revelation, if i did roll, pitch then yaw, then i COULD have it be around the origin coudlnt i? and then i could just use sin and cos to find the components in each plane still wouldnt mind having the other way, especially if im going crazy with my revelation :-D thanks -Dan [Edited by - Ademan555 on January 9, 2005 4:24:16 PM]
When General Patton died after World War 2 he went to the gates of Heaven to talk to St. Peter. The first thing he asked is if there were any Marines in heaven. St. Peter told him no, Marines are too rowdy for heaven. He then asked why Patton wanted to know. Patton told him he was sick of the Marines overshadowing the Army because they did more with less and were all hard-core sons of bitches. St. Peter reassured him there were no Marines so Patton went into Heaven. As he was checking out hi
Ademan555
Ademan555
UPDATE: no, my revelation didnt work out... heh, somethign is still amiss, so id be very happy if someone knows what im talking about and is willing to share the information

-Dan
When General Patton died after World War 2 he went to the gates of Heaven to talk to St. Peter. The first thing he asked is if there were any Marines in heaven. St. Peter told him no, Marines are too rowdy for heaven. He then asked why Patton wanted to know. Patton told him he was sick of the Marines overshadowing the Army because they did more with less and were all hard-core sons of bitches. St. Peter reassured him there were no Marines so Patton went into Heaven. As he was checking out hi
relsoft
relsoft
2 ways.

1.
Code your own lookat function with (0,1,0) as the initial upvector, you would cross the right and forward vecs later to get the real up vector.
This is in Basic though but would get the job done:

http://rel.betterwebber.com/junk.php?id=24

Tute I wrote for this:

http://www.petesqbsite.com/sections/express/issue2/index.html#3d

2. GlULookat.



Hi.
Ademan555
Ademan555
THanks, yeah ive been using gluLookAt(), and i guess i kinda lied, it does SORTA work, but not to the extent id like (aka its whacked) if i rotate around the y axis far enough, it just rolls over its own z axis... i WAS generating the basis vectors like this:
		//NO ROLL ON Z		//PITCH		Forward.y = static_cast <float> (sin(Pitch));		Forward.z = static_cast <float> (cos(Pitch));		//YAW		Forward.x = static_cast <float> (-sin(Yaw));		Forward.z *= static_cast <float> (cos(Yaw));		//		//RIGHT		//				//ROLL		Right.x = static_cast <float> (cos(Roll));		Right.y = static_cast <float> (-sin(Roll));		//PITCH		Right.y *= static_cast <float> (cos(Pitch));		Right.z = static_cast <float> (sin(Pitch));		//YAW		Right.x *= static_cast <float> (cos(Yaw));		Right.z *= static_cast <float> (sin(Yaw));*/		Cross(Up, Forward, Right);		Up.Normalize();


but it had the described problem

thanks
-Dan
When General Patton died after World War 2 he went to the gates of Heaven to talk to St. Peter. The first thing he asked is if there were any Marines in heaven. St. Peter told him no, Marines are too rowdy for heaven. He then asked why Patton wanted to know. Patton told him he was sick of the Marines overshadowing the Army because they did more with less and were all hard-core sons of bitches. St. Peter reassured him there were no Marines so Patton went into Heaven. As he was checking out hi

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.