[Solved] rotate 5 circle problem [duplicate]

You should call glutSwapBuffers only once in the drawing function. For an animation you have to call glutPostRedisplay, to ensure that the display function will be called again. The glBegin and glEnd calls only have to be called once per circle. In the for loop you just supply vertices with calls to glVertex. To simplify … Read more

[Solved] How to bringback an object to its original position after rotation in unity?

I want the cube to return back to its original position when the user stopped touching the cube I can’t exactly tell which part of this you are struggling with but you can simply get the position of the GameObject in the Start or Awake function then set the transform.position to that value when OnMouseUp … Read more

[Solved] How to rotate a vector in opengl?

Yes OpenGL uses 4×4 uniform transform matrices internally. But the glRotate API uses 4 parameters instead of 3: glMatrixMode(GL_MODELVIEW); glRotatef(angle,x,y,z); it will rotate selected matrix around point (0,0,0) and axis [(0,0,0),(x,y,z)] by angle angle [deg]. If you need to rotate around specific point (x0,y0,z0) then you should also translate: glMatrixMode(GL_MODELVIEW); glTranslatef(+x0,+y0,+z0); glRotatef(angle,x,y,z); glTranslatef(-x0,-y0,-z0); This is … Read more