Squeed traduction7/4/2023 This is where glPushMatrix and glPopMatrix come in handy. Since they're combined you'll need to "save" the state of the ModelView matrix prior to making your view transformations. If they were separated you could transform your object and camera independently using the model and view matrices respectively. This (in my opinion) makes things more difficult to understand when starting out. With the version of GL you're using the model and view matrices are combined into the ModelView matrix. If not, I'm all ears.įrom your code I can't tell exactly what behavior your expecting but I suspect you're trying to continuously read in mouse input and augment the "camera". In my mind moving the camera is easier than recalculating the position of thousands of vertices. I thought that would be easier than redrawing the entire model and transforming all the vertices. I modify the projection matrix to view the model from different perspectives. I am drawing a CAD model with thousands of vertices in 3D space. Projection Matrix: Let me back up for a second. My draw loop is: GL.Clear(ClearBufferMask.ColorBufferBit) GL.Rotate(_YposEnd * _MouseSpeed, 0, 1, 0) GL.Rotate(_XposEnd * _MouseSpeed, 1, 0, 0) ![]() GL.Translate(_XposEnd * _MouseSpeed, _YposEnd * _MouseSpeed, 0) Private Sub GlControl1_MouseMove(sender As Object, e As ) Handles GlControl1.MouseMove ![]() Also, I am very green with OpenGL so please talk slowly. After the first rotation the translations and rotations are forever skewed. I simply want the translation and rotation behavior to remain how it is before I rotate the image. ![]() I've seen this asked before, but I have not seen it answered in such a way that I understand how to apply it to my code. I am trying to correct the translation and rotation behavior of my model after I rotate the image.
0 Comments
Leave a Reply. |