Is there a way to cast from CATransform3D to GLKMatrix4, or do I always need to manually convert them from value to value? I guess casting would be faster.
相关问题
- How to use GLKMathUnproject
- Using GLKView with a UIViewController
- GLKit vs. Metal perspective matrix difference
- Texture mapping in GLKit is not working only in de
- GLKit & adding tints to textures
相关文章
- Using GLKView with a UIViewController
- GLKit vs. Metal perspective matrix difference
- Texture mapping in GLKit is not working only in de
- GLKit & adding tints to textures
- opengles display human face in iphone
- OpenGL ES 2.0 render to texture
- EXC_BAD_ACCESS与glTexImage2D在GLKViewController(EXC_
- OpenGL ES 2.0的平局全屏四十分缓慢(OpenGL ES 2.0 draw Fullscr
Something like this should work:
Assuming
CATransform3d
andGLKMatrix4
have the same column/row setup. (I think so)Unfortunately there is not as of now. There's most likely a hidden API call that Apple uses to convert via CALayers and OpenGL, but for now the following is your best bet. I would just make a utility class that would contain this in it.
Using something like
Is called type punning. Unless you understand how this works, you should not use it. You cannot type pun a CATransform3D to a GLKMatrix4 as their data structures are different in memory.
reference link: type punning
GLKMatrix4
CATransform3D