Jump to content
  • Advertisement

Archived

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

ZitherMan

Woorld coordinates system?

This topic is 5988 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
Advertisement
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
I know i can move it that way, but i dont WANT to move it that way. I want to be able to change the x y and z coordinates of an object and it moves

Share this post


Link to post
Share on other sites
As mentat said, you can use the OpenGL function glTranslate to move the object and glRotate to rotate and object... look into that.

Dave "Dak Lozar" Loeser

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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!