The circular movement of an object around a specific axis.
1
vote
1answer
34 views
Getting mousemovement despite mouselock - unity
I have lockcursor so the cursor doesn't leave the screen, but now i have to rotate an object based on mouse movement (think garrys mod item rotation) but the mouse cursor is obviusly locked to the ...
1
vote
1answer
44 views
Jittery Movement, Uncontrollably Rotating + Front of Sprite?
So I've been looking around to try and figure out how I make my sprite face my mouse. So far the sprite moves to where my mouse is by some vector math.
Now I'd like it to rotate and face the mouse as ...
0
votes
0answers
48 views
Follow sinus with absolute value
I would like to make an arm follow the sinus of the ball. When I add an absolute value to the ball (on the y axis) to get a more realistic bounce, the ball is going 2 times faster.
How could I ask ...
0
votes
0answers
20 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 ...
6
votes
2answers
217 views
How do I simulate a swinging pendulum?
I want to simulate a rope with a weight attached, swinging back and forth like a pendulum. Any actual physics is overkill; it's just endlessly repeating the same motion.
JQuery has a the "swing" ease ...
1
vote
1answer
55 views
Rotations and Origins
I was hoping someone could explain to me, or help me understand, the math behind rotations and origins.
I'm working on a little top down space sim and I can rotate my ship just how I want it.
Now, ...
1
vote
0answers
48 views
Rotating around a bitmap
I can't figure this out, how do I make my bullets spawn where I want them to? :P
I want them to be shot out infront of my character-sprite(happy). But the rotation is all off and the bullet spawn ...
1
vote
0answers
36 views
Finetuning movement based on gradual rotation towards a target [duplicate]
I have an object which moves towards a target destination by gradually adjusting its facing while moving forwards. If the target destination is in a "blind spot", then the object is incapable of ...
2
votes
2answers
89 views
Finding the shorter turning direction towards a target
I'm trying to implement a type of movement where the object gradually faces the target. The problem I've run into is figuring out which turning direction is faster. The following code works until the ...
2
votes
1answer
79 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
1answer
81 views
Rotate 2d sprite towards pointer
I'm using Crafty.js and am trying to point a sprite towards the mouse pointer.
I have a function for getting the degree between two points and I'm pretty sure it works mathematically (I have it under ...
1
vote
1answer
134 views
Rubik's cube array rotation
I'm about to make a 3D Rubik's cube based game in Flash AS3 and Away3d.
I don't really know how to manage the 2D arrays of the Rubik's cube.
For example, how do I rotate the corresponding arrays if ...
1
vote
1answer
85 views
How do you rotate a material 90 degrees in UDK?
So, I have started checking out UDK since yesterday, and most of it is clear and understandable.
I'm trying to create a curved road. The idea was to use a brush (Curved Staircase) and set the steps ...
0
votes
2answers
72 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 ...
0
votes
3answers
70 views
Rotating each quad in a batch separately?
Background
In my app I use the following code to rotate my quad:
Code
//Rotate the quad
Matrix.setIdentityM(mRotationMatrix, 0);
Matrix.translateM(mRotationMatrix, 0, centreX, centreY, 0f);
...
0
votes
1answer
51 views
Type of 3D Rotation Animation used in this video [closed]
http://youtu.be/IUZqinlhono
I have referred to an application for interactive rotation in 3D space. The same is uploaded on youtube for your reference.
I am having difficulty in understanding the ...
0
votes
1answer
48 views
Normals not rotated correctly
While rendering a cube to the gbuffer (diffuse, normal, depth) I noticed something odd when applying rotations. I build a world matrix for the cube as follows:
Yaw = Yaw % MathUtil.PI2;
Pitch = Pitch ...
1
vote
4answers
153 views
How to smoothly rotate a vector in a direction?
I'm looking for an easy way to achieve the following:
Object A, B
{
Vector2D position;
Vector2D orientation;
}
update(elapsed)
{
//rotate A's orientation in B's direction by x * elapsed ...
1
vote
0answers
58 views
Move parent according to child axis in Unity?
Can I ask my parent to move according to the child axis? This means if I turn right, then right again, the parent has to be at 180° from its original position, and not only at 90° (because "Right" ...
3
votes
1answer
125 views
Matrix represents same rotation with different euler angles
I have Transform component storing it's rotation as Quaternion.
Transform has set/getEulerAngles (rotation order oy, ox, oz).
I want to rotate object in any direction but while testing I get ...
1
vote
1answer
54 views
How to make camera rotation independent from frame rate?
I multiply the mouse movement by a given number to get camera rotation of a desired speed. But it only works at 60 FPS. When I don't limit the frame rate I get around 350 FPS and the camera rotation ...
1
vote
0answers
55 views
How to set object's / node's absolute rotation correctly?
Usually when I want to rotate an object/node in my Ogre scene I call the node's rotate() method. That rotates the node locally relative to it's current rotation. So for example, when I start with 0 ...
3
votes
1answer
72 views
How to map absolute Joystick position to object rotation?
In my (Ogre) 3d scene I have an object that should be rotated locally based on Joystick input. I have a Joystick with min/max values of [-32767, 32767] on both X and Y axes. When the Joystick is in ...
0
votes
1answer
83 views
Getting Rotation Values From A Rotation Matrix
I'm trying to get rotation values along the x, y and z axis from a matrix that can include rotation, translation and scale data. Currently I have this function to return the y rotational value:
float ...
0
votes
1answer
99 views
Mouse Aiming Causing Rotation Jitter
When our game's ships move around, mouse aiming causes them to shake around a lot. The body being aimed is moved kinematically. I think we've narrowed it down to this block of mouse tracking code.
...
0
votes
1answer
85 views
XNA - 2D Rotation of an object to a selected direction
I'm trying to figure out the best way of rotating an object towards the directional input of the user. I'm attempting to mimic making turns on ice skates.
For instance, if the player is moving right ...
0
votes
1answer
169 views
iOS OpenGL ES 2.0 How to Billboard on Sphere and Rotate with Sphere
I have a sphere (earth) in OpenGL ES 2.0 for iOS. I also have markers that I want to place at lat/lons on the earth - but I want the markers to always face the user ( billboards ) but also move with ...
4
votes
3answers
187 views
How do I make an arrow line up with a bow when rotating them?
I am trying to create a bow and arrow animation in which the player can drag downwards to increase the bow strength (see the image) and release it to hit a target. I can't get the arrow to align ...
1
vote
2answers
105 views
Sprite not rotating around its centre after Scaling at its centre
If I scale a sprite at its centre, then try to rotate it around its centre as well, the rotation does not occur around its centre.
If you need to rotate, for example a scaled ball,the way its working ...
2
votes
1answer
91 views
Rotation independent rotation
I came up with some cube rotating, but I could not make it smooth and easy to use because as the cube turned - the keys that handle the turning changed their purpose. Link to demo. The demo rotation ...
1
vote
1answer
106 views
Weapon as camera's child, rotation messed up
I put my weapon as a camera child, it works, but when i rotate my player it seems the weapon rotate a little too.
I'll attach some images so you can see it.
As you can see, when i look up i ...
2
votes
0answers
146 views
Libgdx sprite rotation (image quality)
This one is probably really simple but I didn't find a solution.
I'm trying to create a widget (speedometer) with libgdx.
For the arrows I'm using the setRotation() function.
But when the image is ...
0
votes
0answers
59 views
Understanding quaternions and axis angle representations [closed]
I have a sensor that gives me a quaternion. I convert the quaternion to an axis-angle representation using http://www.euclideanspace.com/maths/geometry/rotations/conversions/quaternionToAngle/. When I ...
0
votes
2answers
236 views
How to I rotate a triangle by dragging the mouse in libGDX?
More specifically, I have rotation working in a way I don't like as follows:
//Draw the triangle using this draw method
//batch.draw(texture, x, y, ...
0
votes
2answers
97 views
How to rotate one object around another moving object in 3-d?
i was wondering if anyone could give me some advice on how to rotate one object around another moving object. After a bit of googling i found some code on another website that worked perfectly but it ...
0
votes
1answer
109 views
Love2D : Problem rotating image in a SpriteBatch
I'm working on a falling blocks type of game with triangular pieces. I'm using a SpriteBatch to accumulate and remember the pieces and their locations.
The problem is that when I rotate a scaled ...
2
votes
2answers
279 views
How to avoid gimbal lock
I am trying to write code with rotates an object.
I implemented it as:
Rotation about X-axis is given by the amount of change in y coordinates of a mouse and
Rotation about Y-axis is given by the ...
1
vote
3answers
200 views
First Person Shooter vertical mouse aim
I've just started writing a 3D First Person Shooter in Java, and I'm having a bit of trouble with tracking the mouse movements and moving the camera accordingly. I'm implementing typical FPS movement, ...
3
votes
3answers
260 views
Getting correct angles between Vector3s
I'm working on a project where you can draw lines between points. You select one point and drag the mouse onto another point and a line is drawn between them.
The line itself is a 3d object which is ...
5
votes
1answer
125 views
Rotating plane to be parallel to given normal via change of basis
I have two planes and their respective normals. I would like to rotate the second plane, planeB, so that it is parallel to the first, planeA.
To do this, I am using a change of basis to rotate each ...
-2
votes
1answer
250 views
Moving A Sprite In The Direction Its Facing XNA [duplicate]
There are many questions on this site that explain this except they seem to all be in Java.
I want to move a sprite in the direction it's facing, in XNA. I know you must use Radians and lots of ...
3
votes
1answer
108 views
Scaling and rotating texture onto another texture by raw buffer data
I've been messing with C++ AMP and OGRE in attempt to make writing to/altering textures to my liking easier on my behalf. In this I've been trying to draw a texture onto my "dynamic" texture with ...
1
vote
1answer
93 views
Moving an object toward another object on sphere knowing their quaternions
I have a sphere centered in world origin. On the sphere surface I have two objects and I know their quaternions (rotation around sphere).
Currently my movement works on Vector2 inputs (cannot change ...
0
votes
0answers
53 views
Proper matrix rotation and storing rotation values
I have GameObject's transform component(position+rotation) and shape mesh(array of vertices).
On each game tick I update coordinates of vertices relatively to game object's rotation.
And my current ...
0
votes
1answer
160 views
Rotation of Rectangle along Y-axis transformed to parallelogram
After the rotation of a rectangular view along the Y-axis, about its center, transformed into parallelogram, how do I get the rotated parallelogram coordinates?
By Y-axis, I mean perpendicular to the ...
3
votes
1answer
204 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
444 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
330 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
0answers
40 views
save bones position after rotation un xna
i'm developping a game for solving a rubik's cube in xna framework c#
i want to know how to save bones positions after rotating them
i'm calling this method to draw bone witch construct the
...
1
vote
1answer
162 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 ...