Tagged Questions
1
vote
2answers
204 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 ...
0
votes
1answer
121 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
542 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
148 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 = ...
3
votes
2answers
248 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, ...
0
votes
2answers
489 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, ...
3
votes
2answers
433 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
441 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
318 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 ...
2
votes
1answer
416 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
301 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
162 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
578 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
291 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
633 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 ...
3
votes
3answers
6k views
How can I rotate 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
298 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
221 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
3k 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
416 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
3k 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
371 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
359 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
4k 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 ...