Tagged Questions

Rotation is the circular movement of an object around a specific axis.

learn more… | top users | synonyms

3
votes
1answer
507 views

How rotate a 3D cube at its center XNA?

I try to rotate a 3D cube on itself from its center, not the edge. Here is my code used. public rotatemyCube() { ... Matrix newTransform = Matrix.CreateScale(scale) * ...
1
vote
5answers
1k views

how to rotate enemy to face player? [duplicate]

Okay so i havebeen rotating my enemy to face the player using float targetrotation = Math.Atan2(playerpos-enemypos); enemy.rotation = targetrotation; (<this line of code i want to change) This ...
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
492 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 ...
1
vote
1answer
121 views

XNA Help - Slerping the KoolAid

I'm having some SLERP issues and was hoping one of you guys' could help me with your expertise... (The following code is the Update method of a component whose responsibility is to rotates it's actor ...
2
votes
3answers
2k views

XNA SpriteBatch.Draw with rotation, scaling and origin?

I use a 1x1 pixel 2d texture as source for SpriteBatch.Draw. The texture is scaled and rotated around an origin. The left image is only scaling. The right one scaling + rotation around the origin at ...
0
votes
1answer
213 views

Smooth rotation [duplicate]

I would like to rotate my Player very smooth. At the moment the player stops rotating when I release the button. Also the rotation should get faster, if the player rotates longer. I use XNA and have ...
1
vote
2answers
149 views

Rotating and pitching a turret

I am new to game development and I was trying to build a turret model, and control it through lua script in shiva3d. I can rotate it around the y axis which is no problem, but when it comes to ...
1
vote
2answers
399 views

Pygame's rotation methods have crippling issues, but is it me or Python's pygame?

http://www.youtube.com/watch?v=lNJFxvR6ex8&feature=youtu.be On rotate and rotozoom, can't find fixes on these on the internet, anywhere. Basically, the video is showing 4 things in this order: 1. ...
3
votes
1answer
938 views

Rotating 3d plane to XY plane

I have a triangle in 3d space and would like to create a grid over the triangle, such as in the image below. The purpose of this is to store information about each block of the grid. In order to ...
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 ...
2
votes
0answers
126 views

Pitch (X-axis) rotation problem [closed]

Situation: From a first person perspective (camera position) I want to be able to grab an object and have it fixed to the center center of the screen while looking up-down (pitch) and looking ...
0
votes
1answer
122 views

Making A Sprite Rotate To A Specific Angle XNA 4.0

I have a game that the character spins when you press either of the triggers on the xbox remote. Here's the code. if (gamepadState.IsButtonDown(Buttons.RightTrigger)) RotationAngle += ...
0
votes
1answer
355 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 = ...
2
votes
1answer
151 views

Difference between rotation methods?

My question is in about rotate methods in android.graphics.Camera. In Docs, I saw these comments: public void rotateX (float deg) Since: API Level 1 Applies a rotation transform around the X ...
2
votes
2answers
379 views

Rotating a 2D Skeleton

I am currently implementing a 2D skeleton system in C# with XNA, but got stuck in how I would rotate the bones around a skeleton's axis. A basic algorithm that I have figured out already would ...
4
votes
1answer
581 views

Orbiting multiple objects evenly around a changing radius

I have multiple objects (circles) and I want to place them in a circle, with even distance between each one, and have them orbit the center of the screen. If I remove one object, I want the orbit ...
3
votes
1answer
878 views

360+ degree rotation skips back to 0 degrees when using Math.Atan2(y, x)

I'm new to XNA and this is my first actual project, so forgive my noobness. I'm using jointAngle = System.Math.Atan2(RightStick.Y, RightStick.X); in order to set an angle of a joint (farseer) so ...
0
votes
1answer
171 views

How to calculate the position of an attached model after rotation?

I'm programming a basic game on XNA. I started to place an object (eg weapon) attached to the right arm of my player. When I move my character forward behind left or right all right. But when I ...
1
vote
1answer
2k views

Rotate an object around a point in Ogre3D [duplicate]

Possible Duplicate: How can I rotate about an arbitrary point in 3D (instead of the origin)? I am new to 3D programming and I have been using Ogre3D lately to get a grasp of it. What I am ...
1
vote
2answers
688 views

Matrix Rotation with three Angles

I want to rotate a form with three given angles fo each of the three axis. But the GLM rotation function takes only one angle and a vector as arguments. How can I convert between both formats?
5
votes
1answer
506 views

Calculate gears rotation for a realtime simulation

Hi I'm trying to do a game with real time simulations of gears. There is a big Gear with inside a smaller gear. I managed to draw gears with different diameters but equal size teeth, but if i try to ...
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
1answer
191 views

how to move the camera behind a model with the same angle? in XNA

I'm having difficulty moving my camera behind an object in a 3D world. I'd like to have two view modes: for fps (first person). external view behind the character (third person). I've searched the ...
-1
votes
3answers
546 views

How to rotate to a target position over time

I know how to do rotations to vectors, but how do I rotate over time? For instance say I made a function RotateTo(vec2 iPosition, float iTime); so it rotates to iPosition over iTime - how would ...
3
votes
3answers
3k views

Pygame surface rotation, rect rotation or sprite rotation?

i seem to have a conceptual misunderstanding of the surface and rect object in pygame. I currently observe these objects this way: Surface Just the loaded image rect the 'hard' representation ...
2
votes
2answers
288 views

Grouping surfaces in pygame to get an object with two movement points

I would like to create a simple tank using pygame. One would drive the tank by controlling he velocities of two caterpillar tracks. They should be the two single movement points of the vehicle. I'm ...
0
votes
1answer
242 views

Rotate/Translate object in local space

I am just trying to create a movementcontroller class for game entities. These class should transform the entity affected by the mouse and keyboard input. I am able to calculate the changed rotation ...
1
vote
1answer
55 views

Rotation, further I go from 0:0, the further the object positions around the origin while rotating

For some reason I am having the issue where the following code: global.spriteBatch.Draw(obj.sprite, obj.getPosition(), null, Color.White, obj.rotation, obj.center, 2f, SpriteEffects.None, 1); ...
7
votes
3answers
784 views

Routes on a sphere surface - Find geodesic?

I'm working with some friends on a browser based game where people can move on a 2D map. It's been almost 7 years and still people play this game so we are thinking of a way to give them something ...
2
votes
2answers
253 views

Stop a rotating object at a specified angle?

I'm working in JavaScript with HTML5 and the canvas. I have an object which is rotating at a certain speed, and I need the object's rotation to slow down gradually and the front of the object to stop ...
1
vote
1answer
390 views

How to make a stack stable? Need help for an explicit resting contact scheme (2-dimensional)

Previously, I struggle with the sequential impulse-based method I developed. Thanks to jedediah referring me to this paper, I managed to rebuild the codes and implement the simultaneous impulse based ...
1
vote
1answer
412 views

CW/CCW Rotation of a Vector

Considering that I have a vector A, and after an arbitrary rotation I get vector B. I want to use this rotation operation in others vectors as well, but I'm having problems in doing that. My idea do ...
0
votes
1answer
392 views

Tilting towards turn direction (for a motorbike)

I have a motorbike which moves along based on a direction vector, I set its forward direction to the direction it's moving. What I'd like to also do with it is have the motorcycle tilt in the ...
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, ...
1
vote
1answer
206 views

Camera lookAt target changes when rotating parent node

have the following issue.I have a camera with lookAt method which works fine.I have a parent node to which I parent the camera.If I rotate the parent node while keeping the camera lookAt the target , ...
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
1answer
431 views

Detecting pixels in a rotated Texture2D in XNA?

I know things similar to this have been posted, but I'm still trying to find a good solution... I'm drawing Texture2D objects on the ground in my game, and for Mouse-Over or targeting methods, I'm ...
1
vote
2answers
2k 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
0answers
528 views

Rotation of viewplatform in Java3D

I have just started with Java3D programming. I thought I had built up some basic intuition about how the scene graph works, but something that should work, does not work. I made a simple program for ...
2
votes
1answer
914 views

How to convert pitch and yaw to x, y, z rotations?

I'm a beginner using XNA to try and make a 3D Asteroids game. Update: I'm having a slightly hard time describing this so I made a little animation to show what I'm talking about: ...
1
vote
2answers
562 views

Rotating multiple points at once in 2D

I currently have an editor that creates shapes out of (X, Y) coordinates and then triangulate that to make up a shape of those points. What will I have to do to rotate all of those points ...
1
vote
1answer
402 views

Rotating a cube using jBullet collisions

How would one go about rotating/flipping a cube with the physics of jBullet? Here is my Draw method for my cube object: public void Draw() { // center point posX, posY, posZ float ...
-1
votes
1answer
273 views

How do I get bullets to move in the direction of the mouse's position? [duplicate]

Possible Duplicate: Shoot a bullet towards cursor - top down 2d I'm creating a 2D top down shooter, and I want to get the bullets to go in the direction of the mouse. Not sure of the logic ...
3
votes
2answers
1k views

How can I implement smooth rotation from one direction to another?

I'm having a problem with animating rotations with 1Matrix.CreateRotationY() with my basic 3D game. Based on where you click the mouse, I want the 3D object to rotate to that direction and then move. ...
1
vote
2answers
499 views

Confusion about Rotation matrices from Euler Angles

I am trying to learn more about Euler Angles so as to help myself in understanding how I can control my camera better in the game. I came across the following formula that converts Euler Angles to ...
1
vote
1answer
561 views

How to get a point to the left/right of a vector

I have a position vector of a point in space and a quaternion for it's rotation. What i'm trying to calculate is a point too the left and a point to the right. I have the position and ...
11
votes
2answers
2k views

Arbitrary Rotation about a Sphere

I'm coding a mechanic which allows a user to move around the surface of a sphere. The position on the sphere is currently stored as theta and phi, where theta is the angle between the z-axis and the ...
3
votes
1answer
1k views

Convert rotation from Right handed System to left handed

I have Euler angles from a right handed system that I am trying to convert to a left handed system. All the information that I have read online says that to convert it simply multiply the axis and ...
3
votes
2answers
455 views

3D rotation matrices deform object while rotating

I'm writing a small 3D renderer (using an orthographic projection right now). I've run into some trouble with my 3D rotation matrices. They seem to squeeze my 3D object (a box primitive) at certain ...