rotation - rotate a star in opengl (2D) -


I have 2D stars, and I do not know how to walk around its center, and I do not even have the keyboard Besides how to do this with the key, how can I make my object bigger or smaller than a certain percentage (because when I tried to do this by changing the pixels, the star went wrong).

This is my code:

  #include & lt; GL / glut.h & gt; # Include & lt; GL / gl.h & gt; # Include & lt; GL / FreeGlut H & gt; Zero init (zero) {glClearColor (0.0,0.0,0.0,00); GlMatrixMode (GL_PROJECTION); GluOrtho2D (0.0200.0.0.0,200.0); } Zero line segmentation (zero) {glClear (GL_COLOR_BUFFER_BIT); GlColor3f (1.0.1.0.1.0); GlBegin (GL_LINE_LOOP); GlVertex2i (20,120); GlVertex2i (180,120); GlVertex2i (45,20); GlVertex2i (100,190); GlVertex2i (155,20); GlEnd (); GlFlush (); } Int main (int argc, char ** argv) {glutInit (and argc, argv); GlutInitDisplayMode (GLUT_SINGLE | GLUT_RGB); GlutInitWindowPosition (50,100); GlutCreateWindow ("star"); in this(); GlutDisplayFunc (LineSegment); GlutMainLoop (); Return 0; }  "post-text" itemprop = "text"> 

If you rotate the wire then with the glRotatef () function around the GR axis, it should rotate around its center. I measure rotation To create a global variable, and the keys to which you want to use will be reduced, therefore, glottage (angle, 0.0f, 0.0f, 1.0f); You should try NeHe tutorials, they are especially helpful for this. I found:

View the necessary people between 1 1-10, keyboard control and rotation and so on.

Hopefully something is useful, for all this I am beautiful & gt; & Gt;

Comments