Tagged Questions
1
vote
1answer
82 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 ...
3
votes
1answer
170 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
312 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 ...
0
votes
0answers
38 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
98 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 ...
0
votes
3answers
202 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
128 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
226 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 ...
2
votes
1answer
311 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
95 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
117 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
1answer
47 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);
...
1
vote
1answer
211 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
318 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
votes
1answer
194 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 ...
8
votes
2answers
562 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 ...
4
votes
1answer
1k views
How do I rotate a sprite so that it is 'pointing' in the direction it is moving
I have a sprite, e.g a missile, heading in a certain direction (using a velocity vector).
How do I figure out its how much to rotate it so that it gets drawn 'pointing' in the direction it is ...
1
vote
0answers
168 views
Camera not staying behind model while moving in circle
I have a camera behind a model (3rd Person) and I'm having problems KEEPING it behind the model. When I first start my game, you see the back of the model. If the model moves forward, backward or ...
1
vote
1answer
122 views
Camera wont stay behind model after pitch, then rotation
I have a camera position behind a model. Currently, if I push the left thumbstick making my model move forward, backward, or strafe, the camera stays with the model. If I push the right thumbstick ...
7
votes
2answers
404 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 ...
4
votes
2answers
550 views
XNA 2D Rotated Rectangle Collision Response
I am using Rotated Rectangles which collide using the Separating Axis Theorem and they work perfectly fine for collision detection using Intersects and Contains.
However, I am starting to use faster ...
8
votes
4answers
226 views
Keeping rotation between two objects
In my XNA game I have two objects that collide. When the first object collides with the other it is able to latch on to it and move it about the world. I am having a problem with the math here (Math ...
1
vote
1answer
382 views
Pitch camera around model
Currently, my camera rotates with my model's Y-Axis (yaw) perfectly. What I'm having trouble with is rotating the X-Axis (pitch) along with it. I've tried the same method for cameraYaw() in the form ...
0
votes
1answer
237 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 ...
6
votes
1answer
214 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 ...
7
votes
1answer
856 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 ...
1
vote
0answers
166 views
Getting and Setting Rotation in XNA around the Center of my Model with XNA
Alright, so I'm currently debating how I want to do this. Basically this is what I'm trying to accomplish.
I've created a system to allow me to make my environment a little bit easier. I'm ...
2
votes
1answer
374 views
XNA and Draw rotation
From Wikipedia the (image) conversion degrees / radians shows the quadrants so that the increase of radians causes a counter-clockwise rotation but when using the following code the sprite is rotated ...
0
votes
2answers
517 views
XNA - positioning after rotation
I have a turret with a 2 gunbarrels. The turret rotates towards my mouse. So far no problem. When it creates a few bullets and positions them at the end of the gun barrels.
Here is the problem. It ...
0
votes
2answers
687 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, ...
-2
votes
2answers
139 views
C# XNA 4.0 Rectangle Rotation Collision
I can easily rotate my sprite, but how could I rotate my rectangle for my collision (Thinking of using the Separating Axis Theorem, But I have no clue how to apply it) Help or Example would be ...
1
vote
3answers
813 views
XNA create differences in enemies
I created an enemy class for my game. It works well, except for one dilemma. When I spawn more than one enemy, eventually they begin to "overlap" and look like one enemy. I was wondering if anyone had ...
3
votes
1answer
1k views
Moving a rotated model in XNA
This seems like a simple problem with an equally simple solution that is invisible to me.
I have a model that spawns at the origin and looks at my player model wherever it goes.
I would like it to ...
1
vote
4answers
1k views
Rotating a model AND translating it forward in XNA
I have this enemy class, and I want it to
1) Spawn at a certain place Vector3 pos
2) Rotate to face my player position
3) Move forward
As this code is now, it will appear at it's specified place: ...
0
votes
1answer
101 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 ...
6
votes
2answers
927 views
Simple thruster like behaviour when rotating sprite
I'm prototyping some 2D game concepts with XNA and have added some basic keyboard inputs to control a triangle sprite.
When I press key up the sprite accelerates in it's current facing direction, ...
2
votes
2answers
415 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 ...
1
vote
2answers
597 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 ...
1
vote
3answers
1k views
Can I use SpriteBatch when drawing sprites on a rotating 3D plane
I'd like to have my plane of sprites rotate similarly as in this game (YouTube Video). So basically, everything is drawn in 2D, but the 2D plane is then "rotated in 3D" (or camera is rotated). When ...
2
votes
2answers
615 views
What is the difference between Vector2.Transform and this method?
I've been working on some steering behaviors and ran into trouble with my logic for converting points in world space into points in local space. I had this (it's not optimized for multiple points yet, ...
3
votes
3answers
465 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 ...
3
votes
4answers
625 views
Is it better to track rotation with a vector or a float?
In XNA, you can see that to draw a rotated sprite with SpriteBatch, you'll need a float describing the angle in radians.
I'm used to making games in OpenGL. I just want a rapid prototyping ...
1
vote
2answers
361 views
Creating a rotation offset based on camera position with XNA
I have an XNA project where characters have the ability to pick up and move objects around (in 3d). When an object is picked up by a character, I want ithe objects position to always be out in front ...
1
vote
2answers
2k views
XNA advanced rotation 3D
I'm able to rotate any model with any angle I want, where I can not rotate my model around a given point.
e.g: My model rotates from the origin assigned in its .fpx file. I want it to rotate related ...
6
votes
3answers
662 views
Why is my model's scale changing after rotating it?
I have just started a simple flight simulator and have implemented Roll and pitch. In the beginning, testing went very well; however, after about 15-20 seconds of constantly moving the thumbsticks in ...
19
votes
2answers
1k views
Calculating the rotational force of a 2D sprite
I am wondering if someone has an elegant way of calculating the following scenario.
I have an object of (n) number of squares, random shapes, but we will pretend they are all rectangles.
We are ...
2
votes
1answer
507 views
Rotating a group of sprites - How to calculate origin
I am rotating a group of sprites in XNA, which I developed with the help of the following example: http://msdn.microsoft.com/en-us/library/bb194912%28v=xnagamestudio.10%29.aspx
It all works very ...
3
votes
1answer
836 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
1k 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 ...
0
votes
3answers
3k views
How to rotate a rectangle?
I can easily rotate sprites using the Draw method. However I would like to simply rotate a Rectangle (the structure) so that I can get the coordinate of the four corners of the rectangle. How can I do ...

