This topic is now archived and is closed to further replies.

using gluLookAt

This topic is 5993 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I have two ships in a 3d space environment. sooner or later i will add an AI so one ship moves freely; anyway, i want to be able to set a camera on the back of the player''s ship. the ship should be able to move freely, rotate etc. and still have the camera on it''s back. if it works correctly, it looks like the player is moving through space, planets and this other ship moving towards/away from it. how do i set it up using gluLookAt, and how do i move the ship(s) foward, back, and rotate them? (also, if i moved through space, would the pixels/planets appear to move if they really didn''t?)

Share this post

Link to post
Share on other sites
Ok, the stars wont move with the player if you draw them as you normally would,
that is - glLoadIdentity() and then translate to each star/player and draw it.

to use gluLookAt you need the ships x,y,z and angle for each axis.
the x,y,z coordinates are the first 3 params to the function.
for the other ones to need to use some 3d trigonometry to get the values.
keep in mind that the second trio (look at position) is a POINT in world coords, while the 3rd one (top direction) is a VECTOR who''s origin is 0,0,0.

so, what you''''re saying is, that the mushroom spores were brought in from outer space by - who??

Share this post

Link to post
Share on other sites