A
anne001
I am using a tree and traversing down a tree to generate opengl code
How could I easily list the opengl code that I am generating, instead
of running it?
def applytransform
GL.PushMatrix();
GL.Translate(*@Translation);
GL.Translate(*@jointP);
if @parent != nil
GL.Translate(*@parentjointP);
end
GL.Rotate(*@rotation);
GL.Translate(*@jointP.minus);
end
def traversetree
GL.Clear(GL::COLOR_BUFFER_BIT);
GL.PushMatrix();
applytransform
@children.each {|childnode| childnode.traversetree}
drawprimitive
GL.PopMatrix();
GLUT.SwapBuffers();
end
How could I easily list the opengl code that I am generating, instead
of running it?
def applytransform
GL.PushMatrix();
GL.Translate(*@Translation);
GL.Translate(*@jointP);
if @parent != nil
GL.Translate(*@parentjointP);
end
GL.Rotate(*@rotation);
GL.Translate(*@jointP.minus);
end
def traversetree
GL.Clear(GL::COLOR_BUFFER_BIT);
GL.PushMatrix();
applytransform
@children.each {|childnode| childnode.traversetree}
drawprimitive
GL.PopMatrix();
GLUT.SwapBuffers();
end