简体   繁体   中英

I need help on how to rotate an image with OpenGL using SDL

I'm making a game and the arm of the character will be constantly rotating since it will be following the mouse cursor. I've never worked with openGL before and I need some help getting started. If anyone knows any good websites to start learning and one that specifically contains rotation, please let me know.

I've already visited NeHe and went to that rotation tutorial but after attempting to go through the other basic tutorials, it still seems very confusing to me, so some clarification on the topic would also be appreciated.

Also, I don't know if this would change things, but I need to rotate about the player's "shoulder," so I need to know how to make the arm rotate about this point.

Use glTranslate to move the origin of your coordinate system and glRotate to rotate around this origin. Anyway, you should probably get a book about the basics of computer graphics. If you are serious about this, go for 3d computer graphics by Alan Watt .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM