Jump to content
  • Advertisement
Sign in to follow this  
writtensouls

Xna Sprite Rotation Problem

This topic is 4130 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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...

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!