I am creating an application in opengl es 2.0. I have two drawings in my scene. One is a bar graph and the other is a sphere. My bargraph will be making various transitions like rotations and translations. I want the sphere to control the various transitions of the graph. My main objective is that as my bar graphs performs transitions, my sphere should not.
Can someone assist me as to how do I accomplis开发者_运维技巧h this? I guess I create more than one drawing layer? If yes, could you please assist me with the same? Thanks.
your request is quite easy and the final result can be achieved using basic OpenGL concepts such as Model Matrix Push/Pop.
You have to perform the following sequence of Matrix Stack Operations.
PUSH MATRIX PERFORM THE DESIRED TRANSFORMATION (MOVE, ROTATION, SHADERS ETC) DRAW THE BAR POP MATRIX
PUSH MATRIX DRAW THE SPHERE POP MATRIX
About layers, I don't have enough information about it but it can be achieved for instance by disabling the DEPTH_TEST and respecting the sequence of drawing.
For example
glDisable (GL_DEPTH_TEST); DO THE AFOREMENTIONED DRAWING.
Cheers Mao
精彩评论