I have seen much 3D engines wich uses both DirectX and OpenGL, they required a custom matrix class in order to have custom transformations for both API. But now the question is:" Is really worth with OpenGL using glRotate, glTranslate, glScale when I can simply set the GL matrix from a mine matrix class?"
I think that glRotate , glTranslate etc. are provided for simpleness in use, so would be always better using directly matrices? If I want to do a custom scene manager with an animator for each node, I have to recompute all the matrices after every frame. So I have to take the matrix of a parent node and multiply by It the child transformation, than I have the aboslute transformation of that child that now can be rendered (if the parent did the same with its parent too of course). I tried to imagine a system wich uses Only OpenGL functionalities for doing that. But I found that there a limit in the matrix stack so that the maximum scene hierachy depth is 32. (Or more on some machines, but if want compatilibity I need to use lower limit). By the way I think that using OpenGL functionalities for that is both fast(not really needed) and most flexible(apart the limit of depth of 32). What are your thoughts about that? Does anyone seen someone using this system instead of the wide used child-parent model wich is not limited to a depth of 32? Or are glRotate,glTranslate etc. functions too slow because they need communications with videocard? (this depends on video drivers I suppose).
I'm asknig this because I have profiled my animated scene and I found that 27% of the CPU time is matrices computing. So maybe OpenGL provide some usefull functionality to reduce load of that task.
DemonDarMember Since 08 Dec 2011
Offline Last Active May 05 2013 10:37 AM
- Group Members
- Active Posts 3
- Profile Views 757
- Submitted Links 0
- Member Title Member
- Age Age Unknown
- Birthday Birthday Unknown