0
votes
2answers
91 views

Set new forward directions based on camera position

I have a 3rd person camera which can rotate around the player. When I look at the back of the player and press forward, player goes forward. Then I rotate 360 around the player and "forward ...
0
votes
1answer
158 views

Moving player in direciton camera is facing

I have a 3rd person camera which can rotate around the player. My problem is that wherever camera is facing, players forward is always the same direction. For example when camera is facing the right ...
0
votes
1answer
48 views

Simultaneously translating and rotating sprite in Unity

I have a 2D object (a PNG file I dragged onto the screen) which is a circle I would like to move left and right when the correct side of the screen is touched and have it rotate in the respective ...
1
vote
3answers
106 views

Rotation matrix for a 3D vector

I have a direction vector on which I have to apply some rotation to align it to positive z-axis. To use Matrix.CreateRotationX(angle) of XNA, I need the angle for which I'd have to compute cos or tan ...
1
vote
0answers
94 views

Unity crashes completely when I rotate my objects [closed]

I've started my first tiny Unity project and after 20 minutes I run into a brick wall. My goal was to create a Android 2D game with falling polygons, that you have to click and they disappear. ...
2
votes
0answers
29 views

Xna 4 Model Rotation with inertia not working as expected with variable updates

I am trying to rotate a model with inertia damping with the keyboard. The code works great with a fixed time step but it doesn't behave the same with a variable update frequency. Update method: ...
0
votes
1answer
226 views

(XNA) 3D Model Rotation Angles

I'm currently in the process of making a 3d "semi" top down game, the camera comes in at a very high angle near 90 to show off the 3d models. I have a main character which can move in 4 axis (up, ...
2
votes
2answers
810 views

Rotate to a set degree then reverse and repeat in Unity

I'm making my first project in Unity, a simple game where touching objects adds points to the player's score. I'd like the objects to have a pleasant back and forth swaying animation on the Z axis. ...
7
votes
3answers
369 views

Slerping rotation mirrors

I rotate my game character to watch at the target using the following code: transform.rotation = Quaternion.Slerp(startQuaternion, lookQuaternion, turningNormalizer*turningSpeed/10f) ...
0
votes
1answer
263 views

Rotating object along bezier curve: not rotating enough?

I tried to follow the instructions from the threads on the forum (Cocos2d rotating sprite while moving with CCBezierBy) with Unity, in order to rotate my object as it moves along a bezier curve. But ...
1
vote
1answer
421 views

Correct rotation with Quaternion

I have some problems with a rotating marble. I've tried it with Matrix.CreateFromYawPitchRoll and Matrix.CreateRotation but there were some problems, I think it's due to the Gimbal lock effect. So, ...
0
votes
1answer
7k views

Rotate an object smoothly on the Y axis in Unity

I am attempting a simple script to swing a door open in Unity. This requires a smooth rotation of 90 degrees around the Y axis. I have seen that one way to do this is using Unity's Quanternion ...
3
votes
1answer
289 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
1answer
298 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. ...
3
votes
3answers
1k 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 ...
-2
votes
1answer
2k 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
460 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) * ...
0
votes
1answer
205 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 ...
2
votes
2answers
365 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 ...
1
vote
1answer
184 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
vote
2answers
523 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 ...
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. ...
7
votes
2answers
605 views

Rotate a vector

I want my first-person camera to smoothly change its viewing direction from direction d1 to direction d2. The latter direction is indicated by a target position t2. So far I have implemented a ...
1
vote
1answer
4k views

Rotate to a set degree then stop Unity [closed]

I'm trying to make an object rotate up on the Y axis 90 degrees, then stop. I've got the rotating up bit working fine, it's getting it to stop once it hits 90. Some of the things I've tried include ...
0
votes
1answer
334 views

(Quaternion based) Trouble moving foward based on model rotation

Using quaternions, I'm having trouble moving my model in its facing direction. Currently the model moves can move in all cardinal directions with no problems. The problem comes when I rotate the move ...
9
votes
1answer
1k views

Xbox thumbstick used to rotate sprite, basic formula makes it “stick” or feel “sticky” at 90 degree intervals! How do you get smooth rotation?

I am using a very basic formula to calculate what angle my sprite (spaceship for example) should be facing based on the Xbox controller thumbstick i.e. you use the thumbstick to rotate the ship. In ...
0
votes
1answer
184 views

Move model forward base on model orientation

My model rotates on it's own Y-axis regardless of where it is in the world. Here are the controls for the left ThumbStick: UP (move model forward on Z-Axis) DOWN (move model backward on Z-Axis) LEFT ...
0
votes
2answers
979 views

Rotate object Up/Down/Left/Right in any orientation

I'm rendering model at the origin with a fixed camera looking at it positioned on the z axis. I want to be able to rotate the model up/down and left/right. Currently I have 2 variables, ...
7
votes
2answers
1k views

Calculating a quaternion so a bone points in a specified direction

In an attempt to solve this question, I decided to figure out the absolute (world space) directions of each joint in the source pose (as normalized unit vectors), and then rotate the joints of the ...
0
votes
1answer
112 views

Creating a 2D Line Branch (Part 2)

Yesterday i asked this question on how to create a 2D line branch; Creating a 2D Line Branch And thanks to the answered provided, i now have this nice looking main branch; *coloured to show the ...
3
votes
2answers
567 views

Passing an objects rotation down through its children

In my topdown 2d game you have a player with a sword, like an old Zelda game. The sword is a seperate entity, and its collision box "rotates" around the player like an orbit, but always follows the ...
2
votes
5answers
3k views

How to make something rotate a certain amount over an exact amount of time

I'm trying to make a plane rotate down a certain amount and 180 degrees horizontally over 2 seconds. Basically I want it to take the plane 1 second to rotate to a horizontal-facing angle, then take ...
1
vote
2answers
845 views

Transformation order when dealing with Meshes

I have created a player model out of primitive types. To do this I have created a Model class and Component (mesh) class. Each model consists of one or more components my problems start when you have ...
4
votes
3answers
600 views

How to calculate origin and position of a weapon which should be “in hands”?

I'm currently stuck with my game, which is from the top perspective. I'm currently using these sprites for player: (using the second at the top): And here's what I use for my gun My problem is ...
2
votes
1answer
615 views

Image spinning in c#

I'm currently in the process of making a top-down shooter for my programming class, and one idea I had, but don't exactly know how to implement is image rotation in order to spin the object ...
4
votes
1answer
1k views

Turning a sprite such that it rotates in the direction that's most efficient

I have a sprite that moves from waypoint to waypoint. It turns to face its velocity vector, but not instantly (there's a rotation speed). The problem I'm having is, from one direction to another, the ...
1
vote
1answer
2k views

XNA - Use Mouse To Rotate & Arrow Keys To Scroll A Linearly Wrapped Texture:

Using XNA I'm working on my first, relatively simple, videogame for the PC. At the moment my game window is 1024 X 768 and I have a 'Starfield' linearly wrapped background texture 1280 X 1280 in ...