Questions tagged [glrotate]

OpenGL function that produces a rotation of angle degrees around the vector x y z .

References

Man Page for glRotate

44 questions
11
votes
3 answers

glRotate(angle,x,y,z), what is x,y,z in this case?

I've read the documentation here: http://www.opengl.org/sdk/docs/man2/xhtml/glRotate.xml It specifies that angle is in degrees. It says that X,Y,Z are vectors. If I say glRotate(2,1,0,0) that says I will rotate 2 degrees about the X axis. What…
Joseph Astrahan
  • 8,659
  • 12
  • 83
  • 154
7
votes
3 answers

How to change the Center-of-Rotation in OpenGL

I have a 3D Model (OpenGL ES 1.1 iPhone SDK v3.0) that is somewhat complex (i.e. Thousands of Vertexes and Faces) and I'd like to rotate this model around the Y-axis at or near the center of the Model. The problem is that glRotate rotates my model…
RexOnRoids
  • 14,002
  • 33
  • 96
  • 136
6
votes
3 answers

OpenGL glRotatef

What is the difference between glRotatef(angle, 1.0f, 0.0f, 0.0f); glRotatef(angle, 0.0f, 0.0f, 1.0f); and glRotatef(angle, 1.0f, 0.0f, 1.0f); And why nothing change when I change the second paramater 1.0f to 5.0f? Lastly, how can I rotate an…
peaceman
  • 203
  • 2
  • 7
  • 12
2
votes
1 answer

how to Rotate only one object by using glrotate in java

I am trying to rotate only one square but it did not work it rotates all of them in this code when I click N it creates a new square and pushes it in the array I want when I click R to rotates specific square not all of them when I search on google…
2
votes
1 answer

OpenGL 2D rotation problem

In the following program i am trying to draw a simple house. The coordinates are defined in the house array. I need to rotate the house and display both rotated as well as the original house. But why is the rotated house not being displayed? …
footy
  • 5,803
  • 13
  • 48
  • 96
2
votes
2 answers

OpenGL glTranslate and glRotate

I need a function that applies a translation like glTranslate() to a point. Does someone know of a function like glTranslate() and glRotate() to modify and retrieve a matrix to multiply?
ghiboz
  • 7,863
  • 21
  • 85
  • 131
2
votes
2 answers

How to move incrementally in a 3D world using glRotatef() and glTranslatef()

I have some 3D models that I render in OpenGL in a 3D space, and I'm experiencing some headaches in moving the 'character' (that is the camera) with rotations and translation inside this world. I receive the input (ie the coordinates where to…
rano
  • 5,616
  • 4
  • 40
  • 66
2
votes
1 answer

Project an object with rotation around another object in C++/OpenGL

I'm Using OpenGL/C++ to create a game. One aspect of this game that I'm working on is having a character that shoots a projectile the way said character is facing. To do this I have a 'player' and a 'projectile'. I pass to the projectile the…
Max9999
  • 31
  • 2
1
vote
0 answers

PyOpenGL Get Position of Point after glRotatef()

The program rotates a point using the glRotatef function, how can I calculate the coordinates of the point after the rotation, or is there a function in PyOpenGL to do this? def drawPoint(): glBegin(GL_POINTS) glVertex(1,0,0) glEnd() def…
1
vote
1 answer

Rotation using keys in GLUT

I have created a that moves the square around using arrow keys. Now I want my square turn 90 degrees on y axis everytime I press 'r' key. I have already added case statements for arrow keys that allows my square to move around. here is my…
1
vote
1 answer

glRotatef() works weird in Opengl

I'm about to make a rotating sphere in C++ OpenGL, MFC Application. so I declared a variable that has a spinning velocity in demo.h : GLfloat angle; void Init(); Also, I initialized that variable and implemented one normal sphere at xyz(0,0,0) in …
qkekehrtnfl97
  • 49
  • 1
  • 5
1
vote
2 answers

How to rotate only a specific object without affecting the others in opengl?

I'm making a fan in OpenGL, and I have in it the pole and the things that rotate, when I try to rotate them, all the fan rotate with the pole, how im supposed to fix it, I used glutPostRedisplay(), also when I use push and pup matrix in rotation, it…
Louis Smith
  • 73
  • 1
  • 1
  • 9
1
vote
2 answers

2-dimensional glRotatef()

(iPhone) I'm trying to make it so that the user can rotate an object by dragging his finger on the screen. Dragging left or right should rotate around the Y-axis, and dragging up or down should rotate around the X-axis. Here's my original…
user617123
  • 463
  • 2
  • 9
  • 26
1
vote
1 answer

Decompose glRotatef

I have the function glRotatef with these parameters. glRotatef(-119.718,-0.58064,-0.575698,-0.575699); If I do this... glRotatef(-119.718,-0.58064,0.0,0.0); glRotatef(-119.718,0.0,-0.575698,0.0); glRotatef(-119.718,0.0,0.0,-0.575699); I do not get…
Javier Ramírez
  • 1,001
  • 2
  • 12
  • 23
1
vote
2 answers

Rotating with glRotatef causes warping

I'm trying to rotate the image of a player to where they are pointing. Technically, this works fine. It rotates the image along the Z axis after transforming to the center, and then transforms back, no problem. However, when this is rendered, as the…
1
2 3