Tagged Questions
3
votes
1answer
92 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 ...
2
votes
1answer
86 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 ...
3
votes
3answers
194 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 ...
1
vote
5answers
317 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 ...
4
votes
1answer
160 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 ...
2
votes
1answer
315 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
101 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 ...
0
votes
1answer
149 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 ...
0
votes
1answer
112 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 , ...
1
vote
2answers
226 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
187 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 ...
3
votes
2answers
291 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 ...
2
votes
2answers
239 views
Rotating a child shape relative to its parent's orientation
When rotating a shape using a quaternion value I also wish rotate its child shape.
The parent and child shapes both start with different orientations but their relative orientations should always be ...
6
votes
1answer
215 views
How can I get a 2D texture to rotate like a compass in XNA?
I'm working on a small maze puzzle game and I'm trying to add a compass to make it somewhat easier for the player to find their way around the maze. The problem is: I'm using XNA's draw method to ...
2
votes
2answers
1k views
Rotate sphere in Javascript / three.js while moving along x/z plane
I have a sphere/ball in three.js which I want to "roll" around on the x/z plane. For the z axis I could simply do this no matter what the current x and y rotation is:
sphere.roll_z = ...
3
votes
2answers
297 views
How to derive euler angles from matrix or quaternion?
Currently working on steering behavior for my AI and just hit a little mathematical bump.
I'm in the process of writing an align function, which basically tries to match the agent's orientation with ...
8
votes
2answers
290 views
Render 3d object to 2d surface (embedded system)
i am working on an embedded system of a sort, and in some free time i would like to test its drawing capabilities.
System in question is ARM Cortex M3 microcontroller attached to EasyMX Stellaris ...
-5
votes
1answer
117 views
is object facing another object or facing it in opposite direction?
In 2d, in degrees, negative degrees possible.
What I want is to rotate the player to face the same direction as the door before opening it, but when I'll do the same again now from the opposite side, ...
1
vote
3answers
219 views
Inverting matrix then decomposing gives different quaternion than decomposing then inverting the quat
I'm getting different signs when I convert a matrix to quaternion and invert that, versus when I invert a matrix and then get the quaternion from it:
Quaternion a = Quaternion.Invert(getRotation(m));
...
1
vote
2answers
170 views
How can I determine the direction of turn?
I want a function that gives me the turn direction for my object (1 or -1)
I have two angles
1 - current rotation(A)
0 <= A <= 360
2 - target rotation(B)
0 <= B <= 360
int turnSide ...
3
votes
1answer
311 views
Smoothing rotation
I've spent the last three days trying to work out how to rotate a sprite smoothly depending on the velocity.x value of the sprite. I'm using this:
float Proportion = 9.5;
float maxDiff = 200;
float ...
0
votes
1answer
577 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 ...
9
votes
2answers
2k views
How can I rotate about an arbitrary point in 3D (instead of the origin)?
I have some models that I want to rotate using quaternions in the normal manner, except instead of rotation about the origin, I want it to be offset slightly. I know that you don't say, in 3d space, ...
1
vote
2answers
1k views
How can I rotate a sphere in response to mouse movement?
I'm using jMonkeyEngine to develop a game. I'm good at scripting, but math usually goes over my head. I tried the Wiki page for Quaternion, but I was far too confused to figure this out myself :P
My ...
2
votes
1answer
544 views
Allegro 5 Mouse Look
I found good tutorial on how to do mouse look for 2D game here: http://www.atburrow.com/2010/03/08/objects-facing-the-cursor/
My code looks like this:
w = (double)mouse_x - (double)pos_x;
h = ...
1
vote
0answers
541 views
Rotation deforming mesh (Opengl ES 2.0)
I'm trying to render a rotating cube on Opengl ES 2.0, using some math classes I wrote (based on a lot of online and offline info) for quaternions, matrixes and the like. As far as I know all the math ...
6
votes
2answers
687 views
What is eigenvalue decomposition and why would it be useful in games?
In various math libraries developed for game engines, I see 2x2 and 3x3 square matrices having this function (along with some helper functions). I tried to find information regarding it but did not ...
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 ...
