Hi,All.I want to draw 4 rectangles in a line and then rotate them(as fig.a,b,c in result.jpg show,this image is manually edited by Gimp,I haven’t got the result yet).However,my result is as fig.d in result.jpg.I follow the examples in SuperBible 4ed,and I step in GLFrame::ApplyActorTransform() when debugging,found that the GetMatrix() function in line1Frame.ApplyActorTransform() didn’t return the identity matrix,it return a matrix like this:
-1 0 0 0
0 1 0 0
0 0-1 0
0 0 0 1
I think this matrix rotate my rectangle incorrectly.How can I fix it? Thanks for any reply!
here is part of my source code,GLFrame.h is also attached.
// Flush drawing commands
// This function does any needed initialization on the rendering
// Black background
glClearColor(0.0f, 0.0f, 0.0f, 1.0f );
and another question:is there a “standard” way to do rotation and translation in OpenGL3.3 or later?I google the “GLFrame”,there are little related article with it.however,the Superbible suggested using GLFrame.
and another question:is there a “standard” way to do rotation and translation in OpenGL3.3 or later?
The “standard” way is to download and use a math library. I suggest GLM myself, but there are others available that can be useful.
however,the Superbible suggested using GLFrame.
In what way does it suggest using GLFrame? They wrote GLFrame, as part of their source code for running OpenGL applications. That doesn’t mean you have to or even ought to use it. They use it because they needed something to do that stuff.