[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[pygame] converting "object position" to "view position" in (py)opengl
Hi,
Im relatively new to opengl and I'm not familiat with its jargon but
what I have is objects in a 3D world in various positions and a camera
that can "move" around. What I'm trying to do is if the distance between
object and camera is close enough, display some information on the
screen on the object.
I know how to calculate distance and I know how to print/display text in
opengl (I'm using glOrtho and glRasterPos2i to map out the characters
one at a time).
Anyway, what I'm having problems with is how do I calculate where to
display these information on the screen so that it overlaps the object
(assuming I know the distance and the angle of the camera and the object
relative to the camera). Does this make sense? I've attached an image
that I photoshopped to look like what I'm trying to do.
Thanks for any help
Astan
