We get it. We use ad blockers too. But GameDev.net displays them so we can continue to be a great platform for you.
Please whitelist GameDev.net and our advertisers.
Also consider a GDNet+ Pro subscription to remove all ads from GameDev.net.
Subscribe to GameDev.net's newsletters to receive the latest updates and exclusive content.
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.
Posted 06 December 2012 - 09:32 AM
Posted 06 December 2012 - 10:26 AM
Posted 06 December 2012 - 02:20 PM
Posted 06 December 2012 - 07:51 PM
When you say:
x' = x*cos(A) - y*sin(A)
y' = y*cos(A) + x*sin(A)
Does your code happen to 'actually' do:
x = x*cos(A) - y*sin(A)
y = y*cos(A) + x*sin(a)
aka, you update the value for x, then you are using the new value for x in the computation for y isntead of the old one?
Edited by GDsnakes, 06 December 2012 - 08:03 PM.
Posted 07 December 2012 - 12:07 AM
glTranslatef(BaseAX+(60.0*cos(AngleD)-10.0*sin(AngleD)),baseAY+(10.0*cos(AngleD)-60.0*sin(AngleD)),0.0f);
glTranslatef(BaseAX+(60.0*cos(AngleD)-10.0*sin(AngleD)),baseAY+(10.0*cos(AngleD)+60.0*sin(AngleD)),0.0f);
Posted 07 December 2012 - 07:57 AM
glTranslatef(BaseAX+(60.0*cos(AngleD)-10.0*sin(AngleD)),baseAY+(10.0*cos(AngleD)-60.0*sin(AngleD)),0.0f);
There is a sign error in there. It should beglTranslatef(BaseAX+(60.0*cos(AngleD)-10.0*sin(AngleD)),baseAY+(10.0*cos(AngleD)+60.0*sin(AngleD)),0.0f);
Posted 07 December 2012 - 08:05 AM
Yes, as I said above
I changed the + to a - for the Y because my Y axis is inverted. Origin is (0,1500). I noticed that when it was a + the object rotated the opposite way as the mouse. When changed to a - it followed the mouse like its supposed to.
Do you think that is the problem?
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.
GameDev.net™, the GameDev.net logo, and GDNet™ are trademarks of GameDev.net, LLC.