🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Is this the right order?

Started by
5 comments, last by Mike00 23 years, 10 months ago
Rotate Translate Bind Texture Color Draw ? Thanks
Advertisement
It depends on what do you wanna do !

You can Bind everywhere but before glBegin()

You can select different color for each vertex

glColor
glNormal
glTexCoord (in the order you want but before glVertex)

glVertex

or you can specify color before glBegin (every vertex will use that color)

For the transformations it's standard to Rotate and Translate so you must call

glTranslate
glRotate






Edited by - Andrea on August 20, 2000 10:14:20 AM
IpSeDiXiT
Hmm thanks, but I heard you''re supposed to rotate before you translate...

Anyone know for sure?

Thanks
opengl is state based. order doesn''t matter.

JoeMont001@aol.com www.polarisoft.n3.net
My HomepageSome shoot to kill, others shoot to mame. I say clear the chamber and let the lord decide. - Reno 911
No, order is very important and you need to rotate and then translate so

glTranslate
glRotate

but you must read from bottom to top !
IpSeDiXiT
It depends on what kind of movement you want. Translating 10 units back and rotating 90 degrees will move the object back and rotate it there. Doing things in the reverse order will rotate the object 90 degrees and move it to the left. Sorry if that wasn''t too clear. N E ways, experiment with it and see which order works for what you need.

-----------------------------

Blue*Omega

(Insert Witty Quote Here)
// Tojiart
Probably, your confusion is about this:

say, you have a cylinder standing straight up with y - axis running vertically through it''s center. Now, you want this cylinder to rotate 90 deg. around the y-axis. then what you do is, bring the cylinder back to the origin , rotate it along the y- axis and translate it back to where it was.
So this order of Translate, Rotate and Translate must be followed if you want to rotate an object around one of it''s own axis and not around one of the world axis.

Hope that clears it.
Neo

This topic is closed to new replies.

Advertisement