Jump to content

  • Log In with Google      Sign In   
  • Create Account

Interested in a FREE copy of HTML5 game maker Construct 2?

We'll be giving away three Personal Edition licences in next Tuesday's GDNet Direct email newsletter!

Sign up from the right-hand sidebar on our homepage and read Tuesday's newsletter for details!


We're also offering banner ads on our site from just $5! 1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


rotating vertices


Old topic!
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.

  • You cannot reply to this topic
21 replies to this topic

#21 BitMaster   Crossbones+   -  Reputation: 4233

Like
1Likes
Like

Posted 30 September 2013 - 08:05 AM

That's nonsense. You can rotate around any point you please with matrices (and obviously by glRotatef). You just have to apply T^-1 * R * T instead of just R, where T is a translation matrix which moves the desired center point to the origin.

Sponsor:

#22 L. Spiro   Crossbones+   -  Reputation: 13970

Like
0Likes
Like

Posted 30 September 2013 - 10:16 AM

He needs to. He wants to rotate AROUND a point. Not at the centerpoint which glRotatef() would do. tongue.png

According to this:

but it still rotates around the center of the screen, but does not rotate around the center of the shape.

He wants to rotate around the center of the shape.
But either way raw trigonometry is unnecessary, as it was already pointed out that applying first the inverse translate of the center point prior to rotating, lastly followed by the object’s translation, can all be done with matrix math.




What, in wrong order? I don't understand, when would he even want to use the order you suggested? First translate, then rotate.

When you want to rotate around the center of the object, as he said he wants to do.
Otherwise you translate by the opposite of the center of rotation, rotate, and then apply object translation. In other words, when working with only the object’s translate and rotate, rotate always comes last.
SCALE * ROTATE * TRANSLATE.


L. Spiro
It is amazing how often people try to be unique, and yet they are always trying to make others be like them. - L. Spiro 2011
I spent most of my life learning the courage it takes to go out and get what I want. Now that I have it, I am not sure exactly what it is that I want. - L. Spiro 2013
I went to my local Subway once to find some guy yelling at the staff. When someone finally came to take my order and asked, “May I help you?”, I replied, “Yeah, I’ll have one asshole to go.”
L. Spiro Engine: http://lspiroengine.com
L. Spiro Engine Forums: http://lspiroengine.com/forums




Old topic!
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.



PARTNERS