Moving an object

Posts: 43
Joined: 2009.02
Post: #1
So, I hear that transformations are relative to the object. What if I wanted to move the object's X to 0.1 and Y to 0.2? Not relative to the object, but those definate coordinates? How would I go about doing this? I would just like to be able to move about my 'glutSolidCube(0.1)' this way. Any help?
Quote this message in a reply
Posts: 1,563
Joined: 2003.10
Post: #2
You need to keep track of your transforms and move things as appropriate for the current state of the modelview matrix. Everything is relative, so it doesn't really make sense to talk about absolute position in this way. You can try glPushMatrix(), glLoadIdentity(), glTranslatef(0.1f, 0.2f, 0.0f), draw, and glPopMatrix(), which may or may not be what you actually want to do...
Quote this message in a reply
Post Reply