Rotating lists as a whole
Hello, It's short and modest; take an enviroment like taught in lesson 12, but then how do I rotate all boxes around one axis without calculating every boxes' new position? Cheers!
You would do it the same way as if you were just using a function to draw the box.
Just:
glTranslate(where ever you want the pivot point to be)
glpushMatrix()
glRotate() //the rotate you asked about
glpushMatrix ()
for( all your boxes)
{
glpushMatrix () //dont do a load idenity here
glTranslate() // the one in the tutorial to posistion the box
glRotate() //the box rotation
glCallList() //draw the box
glPopMatrix()
}
glPopMatrix()
Just:
glTranslate(where ever you want the pivot point to be)
glpushMatrix()
glRotate() //the rotate you asked about
glpushMatrix ()
for( all your boxes)
{
glpushMatrix () //dont do a load idenity here
glTranslate() // the one in the tutorial to posistion the box
glRotate() //the box rotation
glCallList() //draw the box
glPopMatrix()
}
glPopMatrix()
Thanks! Whee, finally!!! You're my hero. ;)
Looks like I'll have to go over the lessons again. *sigh*
Does anybody know a reference doc listing all(or mainly used) GL functions, variables etc?
Looks like I'll have to go over the lessons again. *sigh*
Does anybody know a reference doc listing all(or mainly used) GL functions, variables etc?
The redbook is your best friend when you are learning ;)
http://www.gamedev.net/download/redbook.pdf
I find its best to play around with rotating, translating and scaling (with psuhing matrixs) once you learn what they do to get a real feel how to do any sort of movement.
http://www.gamedev.net/download/redbook.pdf
I find its best to play around with rotating, translating and scaling (with psuhing matrixs) once you learn what they do to get a real feel how to do any sort of movement.
I find the OpenGL specification to be very lucid and clear, and it has a great index at the back. The PDF is free to download:
Version 1.5
Version 2.0
If your card is older, you may want to get something like the 1.3 specification instead, to avoid confusion.
You also need to remember that the Microsoft OpenGL DLL only exposes functions for version 1.1 of the API, so you have to load the rest of the API as you would load extensions. There are many libraries that help with this.
Version 1.5
Version 2.0
If your card is older, you may want to get something like the 1.3 specification instead, to avoid confusion.
You also need to remember that the Microsoft OpenGL DLL only exposes functions for version 1.1 of the API, so you have to load the rest of the API as you would load extensions. There are many libraries that help with this.
enum Bool { True, False, FileNotFound };
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement