Please please help!
Hello
I urgently need help with a texture shader problem.
I have a 2D texture mapped on a cube and I need the texture to swirl in a circular motion by modifying the texture coordinates.
Do I need to do the coding in main or in the shaders and how do I do it?
Please help!
Hannah
Thanks
I'm not sure what to put in the rotate function though (do I put the texture coordinates in) or where to put it.
Do I put the rotate function before the drawing of the cube and is it the texture coordinates that I put in the totate function
I'm not sure what to put in the rotate function though (do I put the texture coordinates in) or where to put it.
Do I put the rotate function before the drawing of the cube and is it the texture coordinates that I put in the totate function
As a hint, heres'a how I map texture with my 2D engine to access them by pixels :
Gl.glMatrixMode(Gl.GL_TEXTURE);
Gl.glLoadIdentity();
Gl.glScalef(1.0f/texture.Size.Width, 1.0f/texture.Size.Height, 1.0f);
You can rotate, zoom it at will...
Edit : http://www.loria.fr/~roegel/cours/iut/opengl/addison.pdf, page 79
Gl.glMatrixMode(Gl.GL_TEXTURE);
Gl.glLoadIdentity();
Gl.glScalef(1.0f/texture.Size.Width, 1.0f/texture.Size.Height, 1.0f);
You can rotate, zoom it at will...
Edit : http://www.loria.fr/~roegel/cours/iut/opengl/addison.pdf, page 79
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement