Tag Info

Hot answers tagged

3

Generally speaking, using old OpenGL API is not efficient. In ye olden days of OpenGL 1.0 this pattern was necessary. The model view matrix contains the model and the view matrix. You have the view matrix on the camera and the model matrix on the model. You set the view matrix onto the model view matrix and then push/pop the model matrix on top of it for ...


1

Your problem is that you're doing this: glPushMatrix(); glTranslatef(0, 0.03 * dt, 0); // (...) glPopMatrix(); The offset created by the glTranslatef() command only exists between the glPushMatrix and the glPopMatrix; it doesn't retain its values from previous frames; the offset goes away forever as soon as the matrix is popped. So assuming that dt ...


1

There's an easy solution - don't translate with a matrix. Since you're using immediate mode, it's an incredibly easy matter to simply offset the texture coords however much you'd like. EG, glTexCoord2f(1, 0.03 * dt); This will, of course, not be so easily done when you learn about the OpenGL Core Profile, which is highly recommended to be used. But until ...


1

You can solve this by looking at the typical procedure followed when rendering a game world. When you render a 3D object, you typically apply three transformations: 1. Model Transformation (Model coordinates to World coordinates) This tranformation is applied to the model itself, disregarding anything else in the scene. It is used to scale, rotate ...


1

generally it's acceptable but not best. If objects share same material and animation skeleton, make them into one batch and call glDrawArray once, though it's advanced usage if you are new to opengl, and it need more code work to achieve. you can read this and this for reference. Another simpler way is reduce the glPush/Pop Call by grouping objects share ...



Only top voted, non community-wiki answers of a minimum length are eligible