Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

skinner

rotation

This topic is 5534 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

uh hi, i am working on a 3d app in vb (yea i know,vb is evil/slow/crappy etc) and i am having a bit of trouble with roation. i am trying to make a function that will rotate a point (x1,y1) around another point(x2,y2) by a number of degrees.. i cant for the life of me work it out (yea i am braindead ). i have managed to find the distance and create a point x degrees from zero the right distance away but i cant find the original angle that i could add,,,, if this doesn''t make any sense at all please say thanks in advance for any help -skinner

Share this post


Link to post
Share on other sites
Advertisement
I'm not so clear on what is the exact problem but...

Does p1 rotates about p2?

If so, then:
1. Calculate where p1 should be if the rotation is about the origin.
2. Translate p1 to p2 (p1 + p2).

Ensure all of your rotation calculations are in Radians or all in Degrees as this is an easy way to receive bogus output.

[edited by - citizen3019 on October 22, 2003 3:27:32 PM]

Share this post


Link to post
Share on other sites
quote:
Calculate where p1 should be if the rotation is about the origin


that is the bit i am having some trouble with,,,, i think i have to get the existing angle and the distance, then make a point at the same distance at 0 degrees + the original angle + extra Angle but i am having trouble getting the existing angle (i tried using an inverse sine function but weird stuff was happening)..

Share this post


Link to post
Share on other sites
quote:
Original post by skinner
i am having trouble getting the existing angle (i tried using an inverse sine function but weird stuff was happening)..


Tell me more about what you are doing?

Don''t forget Radians or degrees you only need one.
Also, check your quadrants.
Which quadrants can your point be in?

Share this post


Link to post
Share on other sites
quote:
Original post by citizen3019
quote:
Original post by skinner
i am having trouble getting the existing angle (i tried using an inverse sine function but weird stuff was happening)..


Tell me more about what you are doing?

Don''t forget Radians or degrees you only need one.
Also, check your quadrants.
Which quadrants can your point be in?


hmm you have just given me an idea....

Share this post


Link to post
Share on other sites
argh i had my quadrants different for my inverse sin and inverse cos mixed up,,,, argh i feel so stuuupid, so sorry for wasting your time. thanks

-skinner

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

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

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!