microsoft / angle

ANGLE: OpenGL ES to DirectX translation
Other
615 stars 166 forks source link

glRotate #98

Closed doginthehole closed 7 years ago

doginthehole commented 7 years ago

Hopefully this is a very simple question but I haven't been able to get glRotate() or glRoatatef() to work in project. It isn't being recognized as a function and I'm not sure where to go from here. Let me know if there's some includes that I'm not using or if I'm just an idiot.

stevebest commented 7 years ago

glRotate and friends were once part of OpenGL fixed pipeline, but has been since removed from it, in favor of user-space matrix functions. Because ANGLE implements OpenGL ES 2.0, which features a fully programmable pipeline and is backwards incompatible with OpenGL ES 1.0, it has no such function.

Basically, you want to explicitly manipulate matrices that you provide to your shaders. You can implement the likes on glRotate in your own code, or better yet, grab one of the many existing solutions. In WebGL world (which is basically OpenGL ES 2.0 for JavaScript) a lot of people use gl-matrix. Take a look to have a better idea on what it takes to rotate, translate, look at and perpectivize things in programmable pipeline.

stevebest commented 7 years ago

GLM is what you need.

austinkinross commented 7 years ago

Thanks Stepan for the great answer!

doginthehole, feel free to reactivate this thread if you have further questions on this topic.