Woorld coordinates system?

Started by
4 comments, last by ZitherMan 21 years, 9 months ago
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?
----------------------------
When hell freezes over it will be a pretty cool place to snowboard
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..
-----------my quote is under construction
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
----------------------------
When hell freezes over it will be a pretty cool place to snowboard
You need a camera.
"THE INFORMATION CONTAINED IN THIS REPORT IS CLASSIFIED; DO NOT GO TO FOX NEWS TO READ OR OBTAIN A COPY." , the pentagon
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
Dave Dak Lozar Loeser
"Software Engineering is a race between the programmers, trying to make bigger and better fool-proof software, and the universe trying to make bigger fools. So far the Universe in winning."--anonymous
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 * transform <br>or the multiplication may need to be the other way around.<br><br>sorry i cant explain it better, but i need to go.<br><br>later<br>Marc<br><br><br><br> </i>

This topic is closed to new replies.

Advertisement