GL Polar Cords

Started by
2 comments, last by Prod 22 years, 4 months ago
Alright, i have a doosy of a problem right now In trig we recently went over polar cords, and i was like "woah! that would be a way easier way to get my program to do the stuff it needs to do" I just have one problem, i have no clue how to achieve incorperating polar cords into my 2d GL program. I was thinking of having the sun that is in the origin of the map (0,0 cart-ized) be the origin for polar cords, and also to have each ship to have a set of polar cords where it is the origin. Is this possible? are there any tutorials for this kind of thing? thanks!
Advertisement
Did they teach you how to convert polar coordinates back into rectangular (actually ''cubular'' in 3D) coordinates? If not, you do it like this:
X = Magnitude*cos(Angle);Y = Magnitude*sin(Angle);

That''s the basic form, I''m sure you can expand on it.

[Resist Windows XP''s Invasive Production Activation Technology!]
Oh, another thing, you can kind of pull off polar coordinates with a rotation and a translation (instead of just a translation). It may not do what you expect though (you may need to have a counter rotation at the end).

[Resist Windows XP''s Invasive Production Activation Technology!]
hey thanks buddy!

This topic is closed to new replies.

Advertisement