Xna Sprite Rotation Problem

Started by
11 comments, last by j14rk1n 16 years, 10 months ago
This may not be a problem just how the rotation works but unsure so i came here to ask. Well i got this texture and when i rotate it by making origin the center of the image it rotates fine but when i use the origin of 0,0 as the vector to rotat it on the texture rotates in a small circle around the point. Well I want to rotate the texture right on a pinpoint without it moving off in an orbit around the point. Is that possible? Thanks, Much appreciated, Anthony out
Advertisement
You did basically answer you own question. The origin sets the point the sprite will rotate around. If you leave it at the default the sprite will rotate around the 0,0 point, if you set it to the centre then it will rotate around the centre... That's just the way it works.
sigh, maybe it should be called orbit then lol is there a way to turn a sprite at a point? without it orbiting around the point the point?

Anthony out
Thanks for the quick responce Dark
What exactly are you trying to do...? Do you want the sprite to rotate without actually "tilting around"?
Maybe he is trying to translate the sprite to a different point and rotate around that? But then he could just change the position, and rotate around the origin...

You need to post more information. We can't understand what you are asking.
Mike Popoloski | Journal | SlimDX
All I want to do is turn a texture at a point and when it turns its a different angle of course but its still fixed at a point. I dont want the image to orbit around a point, I want the image to turn at a point. AT being the operative word.

Let me make an example. hmmm now what kind of example can I make...lets say theres a crank to turn a gear. Well the crank turns but doesnt leave its central point. If the crank orbited the point it would be in the wrong positions and look weird LOl.

Anthony out
Thanks for the replies.
Quote:Original post by writtensouls
All I want to do is turn a texture at a point and when it turns its a different angle of course but its still fixed at a point. I dont want the image to orbit around a point, I want the image to turn at a point. AT being the operative word.


So rotate around the center of the texture. Normally, the process here is to translate your object to the origin, perform the rotation, and translate back.
Maybe i should just give up lol no one seems to get what im saying. Well Rotate is not the function i need obviously. Now that i understand what it does it just isnt going to work. I never thought it would be this difficult. with a circle rotating at the center it doesnt move from its spot and it spins, Yay. lol and if you rotate a line from the center it will look like a helicoper yay lol. ok my problem comes in when you dont want that to happen.

say you have a arm connected to a joint. Well the arm turns at the joint. The arm is connected to the joint. it moves but stays connected to the joint. Now a Arm doesnt orbit around the joint Lol when we move our arm it doesnt leave the joint in orbit lol. thats just wrong, not right, evil. well that is my problem. I want the point to be as a joint that it turns at. I dont want the arm to orbit around the joint like some demented planet LOL

Anthony out
Quote:Original post by writtensouls
say you have a arm connected to a joint. Well the arm turns at the joint. The arm is connected to the joint. it moves but stays connected to the joint. Now a Arm doesnt orbit around the joint Lol when we move our arm it doesnt leave the joint in orbit lol. thats just wrong, not right, evil. well that is my problem. I want the point to be as a joint that it turns at. I dont want the arm to orbit around the joint like some demented planet LOL


Right, so translate your object such that the pivot point is at the origin, perform the rotation, and translate back...
so basically do the rotation outside of the spritebatch.draw function. So rotate it outside of draw then draw it at the point I want? Isnt that somewhat slow? Well thanks I think that helps a lot if i understand right.

Anthony out

This topic is closed to new replies.

Advertisement