Skip to main content
gamedev.net
🔒 Locked

Please please help!

Started by hannahcool2000 Mar 7, 2008 at 7:36 AM 3 replies 600+ views
Original Post
hannahcool2000
hannahcool2000
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
iliak
iliak
glMatrixMode(GL_TEXTURE);
glRotate(...);
glScalef(...);
glTranslate(...);

?
- Iliak -
[ ArcEngine: An open source .Net gaming framework ]
[ Dungeon Eye: An open source remake of Eye of the Beholder II ]
hannahcool2000
hannahcool2000
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
iliak
iliak
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
- Iliak -
[ ArcEngine: An open source .Net gaming framework ]
[ Dungeon Eye: An open source remake of Eye of the Beholder II ]

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.