0
votes
0answers
47 views

Issue with turntable rotation openGL

I am trying to implement turn table like rotation in my openGL app. In turn-table like rotation, z-axis is not supposed to roll. But in my app z-axis rolls like anything when I try to rotate the ...
0
votes
1answer
83 views

Camera rotation around point, but without centering

Let's say i have the following: Point somewhere in space Camera with position and orientation (up, right, forward) I want to rotate camera around the point, but also keep this point in same place ...
0
votes
3answers
133 views

OpenGL: glRotatef cause performance drop while rotating -x and -y

I have made a rotating cube and I got some performance drops while using two glRotatef calls. So basically this code is giving me 80FPS: //code 1 GLrotate_x += 0.4f; GLrotate_y += 0.4f; ...
6
votes
1answer
495 views

OpenGL ES object rotation around z axis

I have an object on my screen which is presented rotated and panned, But i have 2 problems regarding the z axis rotations. It's a bit tricky to explain so i uploaded 2 videos to describe each problem. ...
0
votes
1answer
86 views

Jittery Rotational Movement with Arcball implementation

I have an assignment where I need to implement arcball using Opengl (~2.0). I have it more or less implemented but I have a some problems/issues/bugs and I'm not sure whats either causing them or how ...
2
votes
0answers
701 views

Arcball 3D camera

I have checked multiple threads before posting, but i havent been able to figure this one out. Ok so i have been following this tutorial, but im not using glm, ive been implementing everything up ...
0
votes
1answer
111 views

Rotation and translation like in GTA 1 OpenGL

Okay, so I have a figure in XZ plain. I want to move it forward/backward and rotate at it's own Y axis, then move forward again in the rotation's direction, like the character in GTA 1. Code so far: ...
0
votes
3answers
228 views

What are the semantics of glRotate and glTranslate's parameters?

I have been trying to play with OpenGL after watching some tutorials and I don't understand how the glTranslatef and glRotatef functions work. I believe a simple picture would help me. I understand ...
1
vote
1answer
166 views

Sprite rotation

I'm using OpenGL and people suggest using glRotate for sprite rotation, but I find that strange. My problem with it is that it rotates the whole matrix, which sort of screws up all my collision ...
0
votes
1answer
181 views

How to draw a rotatable and zoomable sphere?

My game is a sort of business simulation game of Earth, and I want the main interface to be just like a google earth view. Is there a way to do this with built in OpenGL features or do I have to ...
0
votes
0answers
226 views

OpenTK (OpenGL) Rotation around fixed axes?

How would I go about rotating things in 3-dimensional space along fixed axes? As OpenTK only seems to have rotation that modifies the other rotation, as in X affects Y & Z Y affects Z Z affects ...
0
votes
2answers
173 views

get the new vertices after rotating in JOGL

I had rotate an object with openGL (JOGL). Is there a simply way how I can get the new vertices?
1
vote
0answers
83 views

Rotate view matrix based on touch coordinates

I'm working on an Android game where I need to rotate the camera around the origin based on the user dragging their finger. My view matrix has initial position of sitting on the negative z and facing ...
2
votes
1answer
727 views

Problem using glm::lookat

I am trying to rotate a sprite so it is always facing a 3D camera. Object GLfloat vertexData[] = { // X Y Z U V 0.0f, 0.8f, 0.0f, 0.5f, 1.0f, -0.8f,-0.8f, 0.0f, ...
0
votes
2answers
245 views

Is this Rotation Matrix correct?

I'm having heavly troubles with setting up a View Matrix and a Projection Matrix. It simply doesnt work. So I think my problem is related to my rotationMatrix function. I'm using this tutorial to ...
1
vote
2answers
1k views

Render rotated rectangle inside other rectangle bounds using Libgdx

I have this code to generate a red rectangle inside a grey rectangle: new Rectangle(grey_rectangle_position_x, Game.SCREEN_HEIGHT/2-Rectangle.height/2,0); This code makes the following: Now, I ...
2
votes
2answers
454 views

How do I apply 2 rotations about different points to a single primitive using OpenGL

I'm working on a 2D top-down shooter game that has a rotation feature like Realm Of The Mad God such that if you press e the camera rotates around the character in a clockwise direction and q rotates ...
0
votes
1answer
2k views

Rotating Objects in OpenGL: glRotate or Quaternions?

I'm coding my first engine and I'm trying to have performance in mind since I'll probably use it for mobiles, and I have this question, should you use glRotate or Quaternions for rotating objects in ...
0
votes
1answer
294 views

rotate sphere horizontally around another sphere

I currently have an earth and a moon. What I'm trying to achieve is to have the moon physically rotate around the earth horizontally along the equator along a circular path. moonAngle = ...
4
votes
2answers
1k views

How is the gimbal locked problem solved using accumulative matrix transformations

I am reading the online "Learning Modern 3D Graphics Programming" book by Jason L. McKesson As of now, I am up to the gimbal lock problem and how to solve it using quaternions. However right here, ...
1
vote
2answers
3k views

Rotating a Quad around it center

How can you rotate a quad around its center? This is what im trying to do but it aint working: GL11.glTranslatef(x-getWidth()/2, y-getHeight()/2, 0); GL11.glRotatef(30, 0.0f, 0.0f, ...
5
votes
2answers
2k views

How to rotate camera centered around the camera's position?

Currently I am using gluLook at like so: gluLookAt(position.x, position.y, position.z, viewPoint.x, viewPoint.y, viewPoint.z, upVector.x, upVector.y, upVector.z); with the ...
1
vote
2answers
1k views

Rotating 2D Object

Well I am trying to learn openGL and want to make a triangle move one unit (0.1) everytime I press one of the keyboard arrows. However i want the triangle to turn first pointing the direction where i ...
2
votes
3answers
528 views

OpenGL Get Rotated X and Y of quad

I am developing a game in 2D using LWJGL library. So far I have a rotating box. I have done basic Rectangle collision, but it doesn't work for rotated rectangles. Does OpenGL have a function that ...
3
votes
1answer
801 views

Rotating To Face a Point

I am trying to rotate a line to point to the mouse's world coordinates (rather where the mouse lies on the plane where y=0). I am running into a couple of problems though: Whilst it follows the ...
2
votes
1answer
422 views

Finding a suitable axis-angle to avoid gimbal lock

In OpenGL the camera faces the -z axis with the +y axis pointing up. I am using quaternions to represent the orientation of my objects (which works well) and am trying to do the same for the camera. I ...
0
votes
1answer
241 views

Earth's rotation along it's axis

I've modeled an earth using an sphere. I can rotate it using glRotatef function around z axix by incrementing the angle. How do I simulate earth's movement which looks like 23.5Degree around Z axis? ...
0
votes
1answer
797 views

Camera Rotation (for mouse look) with LookAt does not work as expected (Local/Global)

My code for rotating my 3D fps camera isn't working as expected. I expect that the X-axis does rotate with the Y-axis, but it ain't so. I made some pictures to explain it better, I think its doing ...
1
vote
1answer
394 views

OpenGL: Rotating cannon about non-centre position?

So I have a "cannon" object (basically a long cylinder) and I want to be able to control its angle. The code I have now is: glPushMatrix() glTranslatef(self.position.x,2.5,self.position.z) ...
5
votes
3answers
745 views

Rotate a particle system

Languages / Libraries in use: C++, OpenGL, GLUT Okay, here's the deal. I've got a particle system which shoots out alpha blended textures to produce a flame. The system only keeps track of very ...
8
votes
4answers
12k views

How can I orbit a camera about it's target point?

I'm drawing a scene where the camera freely moves about the universe. The camera class keeps track of the view (or look at) point, the position of the camera, and the up vector. These vectors/points ...
0
votes
1answer
368 views

vector rotations for branches of a 3d tree

I'm attempting to create a 3d tree procedurally. I'm hoping that someone can check my vector rotation maths, as I'm a bit confused. I'm using an l-system (a recursive algorithm for generating ...
0
votes
1answer
248 views

What is causing this problem with my object rotation?

I'm having an issue here with rotation in OpenGL. Before I changed my rendering function the rotation I had for my object worked fine, but now it seems to be messed up. I changed my rendering ...
2
votes
1answer
6k views

Rotating an object in OpenGL about it's centre

Im writing a game for which, one of the models are loaded from an .obj file. It's a model of a plane, and I want to rotate the propeller. The object file is broken into groups, and the propeller is ...
0
votes
2answers
482 views

CubeRealm OpenGL rotation problems, need help. :\

I'm totally new to OpenGL and I'm working on a Sandbox game called CubeRealm. My problem you see is rotation. I've got it in my head that to rotate the 'camera' I just rotate all the scene by the ...
4
votes
4answers
5k views

GLM: Euler Angles to Quaternion

I hope you know GL Mathematics (GLM) because I've got a problem, I can not break: I have a set of Eular Angles and I need to perform smooth interpolation between them. The best way is converting them ...
0
votes
2answers
444 views

Linear Interpolation Causing Gimbal Lock?

I have created an object movement path in a 3D authoring application. Then, I exported the path (100 frames) into my custom text file in the form of Euler Angles. The next point was loading the ...
1
vote
2answers
409 views

opengl rotations for a human

I currently can rotate around a pivot point by first translating to the pivot point then performing the rotation and finally translating back to the origin. I do that easily enough for the shoulder in ...
3
votes
3answers
5k views

Camera Rotation using angles

I currently try to rotate a camera (using gluLookAt()) around a point , i successfully do it for rotating around one global axis. But when i want to use more than one axis , I'm stuck . I've ...