简体   繁体   中英

OpenGL rotating a 3d cylinder

I am currently using opengl to make two cylinders which are joined together in a criss cross fashion in the middle.

They both have to be rotated in the horizontal axis, one 45 degrees in the clockwise direction and the other 45 degrees in the anti clockwise direction.

Am I right in thinking that one will be rotated in the x axis by 45 degrees and the other is to be rotated by 45 degrees in the z axis?

Or is one rotate in the x axis by 45 degrees and the other rotated by 315 degrees(360 - 45)?

I've tried both, and they both look so similar I can't tell which is correct. I'm just struggling to get my head around which is correct!

Thanks lucy

Your question looks like it has already been answered here in "How to draw cylinder in y or x axis in opengl"

Which has examples of how to apply rotate to it as well.

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