PDA

View Full Version : opengl scale and translation



giuseppe500
09-14-2010, 06:49 AM
Hello.
I'm Using the VBO and I want to know how to translate a mesh composed of a VertexBuffer and IndexBuffer, rendered with a simple shader.
If can 'serve the mesh is scaled of 1000 (a component of 0,001, this can' influence the translate?) And translate x 10, y 10, z: 1.
the rotation now works correctly, but the translazione not.
can you post two lines of code or a link?
Thank you.

strattonbrazil
09-14-2010, 10:48 AM
glTranslate and glRotate are order dependent. It depends on the situation, but normally if yo're working with a mesh, you'll read it in, scale it to be in proportion to the scene, rotate it to the proper orientation, then move it to proper location.

glScale(...)
glRotate(...)
glTranslate(...)