Archived

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

Woorld coordinates system?

This topic is 5618 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

Lets say i make a class in one of nehe''s first examples (lets take the spinning cubes and pyramids). This class would keep the position of one of these objects in a vector (x,y,z). I would want it to be possible to move it like object.pos = (100, 59, 73) or something like that. So my question is, how would i make one of these world coordinates system?

Share this post


Link to post
Share on other sites
to move your object/camera in GL, see glTranslate function.. to rotate it, glRotate..

I am not very sure if it is what you ask though.. hope that helps..

Share this post


Link to post
Share on other sites
Im guessing that you want to move the cube (or whatever) in the world so that it doesnt need to be further transformed by the world transform.

all this means is that you apply the transformations to the actual verticies to make the transformations permanent, rather than a once off.

for example when we use glTranslate or some such function, we set a matrix so that each vert added to the render pipeline has that transformation applied to it.

what you want to do is transform each of the verts in memory.
really bad explanation, sorry.

for example... (lets say we have an array of verts called Verts
- set up a transform matrix. (glTranslate etc)
- Verts = Verts[i] * transform
or the multiplication may need to be the other way around.

sorry i cant explain it better, but i need to go.

later
Marc



Share this post


Link to post
Share on other sites