I'm having some trouble using the glRotate and glTranslate in the proper way. Are there any devent turorials?
My problem can be stated as follows:
I have a object that will have to be rotated around itself before being put somewhere in the "landscape", which is also translated and rotated.
The object is placed at location Xo,Yo,Zo and must be rotated with Thetao and Phio.
The landscape is also moved and rotated (or the camera is moved...) using X,Y,Z,Phi,and Theta...
I have tried:
- creating the object at 0,0,0, rotating, translating it, and then the landscape. Seemingly, the object is not rotated with the landscape at all.
- placing the object at Xo,Yo,Zo and all the same. Seemingly, the object is not only rotated around itself, but also some other point...
The main problem is probably that I haven't got a clue how to use the matrix functions - seemingly, no "Add" function for matrixes in OpenGL exists? Should I study some more 3D maths?? :-)
The code for rotation the landscape, and then the object:
glTranslatef(0.f,0.f,(float)-nZDist); // Same as above
As said, I'd be more than happy if someone could just point me to a good turorial regarding this.
Thanks in advance.