Advertisement

A few OpenGL maths questions for my Speedball game :)

Started by July 29, 2003 07:53 AM
14 comments, last by WoolyUK 21 years, 7 months ago
Got problem 2 working great now, thanks for the help!

Still kinda stuck with problem 1 tho lol



[edited by - WoolyUK on July 29, 2003 11:58:56 AM]

[edited by - WoolyUK on July 29, 2003 11:59:37 AM]
Ok Ive been spent today reading about vectors etc and I cant see the difference between a vector and a 3d point? In the examples ive seen and the opengl game programming book, a vector just holds the 3d co-ords for a point... like (2,2,3). Is this right??? Doesnt seem to make sense
Advertisement
They''re usually stored in the same terms (3 floats) but think of a vector as a directed arrow with a length.


Why you shouldn''t use iostream.h - ever! | A Good free online C++ book
Thanks

So these aren''t stored though? only the x,y,z?
A vector and a point are both stored as x,y,z. One of us may be confused.


Why you shouldn''t use iostream.h - ever! | A Good free online C++ book
Think of a 3D point as being a vector from the origin to that point. What you are interested in is a direction vector, i.e. the direction the player is facing. For example if the player is facing straight up the y-axis his direction vector is (0,1,0). (N.B. This is the NORMAL vector, i.e. it has unit length.) The player could be at any position (pos_x,pos_y,pos_z), but if he is facing up the y-axis his direction vector is always (0,1,0). Each player therefore has a position (pos_x,pos_y,pos_z) and a direction (dir_x,dir_y,dir_z), both stored as 3 floats. You seem to be thinking these are the same thing. Hope this helps.

This topic is closed to new replies.

Advertisement