Skip to main content
GameDev.net gamedev.net
🔒 Locked

Rotating a point_sprite texture

Started by DJHoltkamp Apr 7, 2009 at 2:48 AM 3 replies 2k views
Original Post
DJHoltkamp
DJHoltkamp
Is there any way to rotate a point_sprite texture... I tried altering the texture matrix but everything went crazy leading me to believe that it is not possible. I am using OpenGL ES. Thanks. Here is my code: glPointSize(32.0f); glDisableClientState(GL_TEXTURE_COORD_ARRAY); glEnable(GL_POINT_SPRITE_OES); glTexEnvi(GL_POINT_SPRITE_OES, GL_COORD_REPLACE_OES, GL_TRUE); glMatrixMode(GL_TEXTURE); glRotatef(70, 0, 0, 1); float Intensity = 1.0f - TotalSeconds / 6.0f; glColor4f(Intensity, Intensity, Intensity, Intensity); glDrawElements(GL_POINTS, Count , GL_UNSIGNED_SHORT, GLIndicies); return false; glDisable(GL_POINT_SPRITE_OES); glLoadIdentity(); glMatrixMode(GL_MODELVIEW); glEnableClientState(GL_TEXTURE_COORD_ARRAY); glTexEnvi(GL_POINT_SPRITE_OES, GL_COORD_REPLACE_OES, GL_FALSE);
DJHoltkamp
DJHoltkamp
ha ha, ok, this is what I get for programming at 4 in the morning... I totally missed the return false in the middle of my statement. Nonetheless, the texture matrix still doesnt seem to provide a way to rotate the texture. Suggestions?
AndyEsser
AndyEsser
I've never tried directly using the Texture matrix myself. But should you not be setting the matrix mode back to Modelview before doing you glDrawElements? So it should be:

glMatrixMode(GL_TEXTURE);glRotatef(70, 0, 0, 1);glLoadIdentity();glMatrixMode(GL_MODELVIEW);float Intensity = 1.0f - TotalSeconds / 6.0f;glColor4f(Intensity, Intensity, Intensity, Intensity);glDrawElements(GL_POINTS, Count , GL_UNSIGNED_SHORT, GLIndicies);

DJHoltkamp
DJHoltkamp
The currently selected matrix will not have any affect on the DrawElements (but i tried it just to make sure). Thanks for the guess! Anybody else?
zedz
zedz
personally Ive neverused point sprites, lots of issues with them
perhpas u cant rotate texture coords (though u should be able to in a shader)

you might have to just do the points yourself

Topic Locked

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

Sign in to reply to this topic.