Tag Info

New answers tagged

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 ...


0

have you tried to assign a separate var for each texture? also what is RepeatTexture(); calling? i think that may be the source of your problems


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 ...


0

If you consider all possible orientations of a bounding box, the corners are on the surface of a bounding sphere. If you fit your view to the extents of that bounding sphere, you're guaranteed that your box will always fit.


0

for anyone else wondering how to do this. Try this: http://www.david-gouveia.com/portfolio/limiting-2d-camera-movement-with-zoom/


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

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 ...


0

Ok the problem turned out to be a typo in the way meshes were being loaded. It caused the Z terms of each vertex to be resolved to the X term... If anyone comes across this and wants to know here is my properly working mesh loader method. public static Mesh loadMesh(String fileName){ String[] splitArray = fileName.split("\\."); String extension = ...


0

Can't comment yet so I post it as an answer, but it appears that you should have a - at ry.m[2][0] and + at ry.m[0][2] when looking at the 3d rotation matrices. Does not make a difference though for an x-only rotation as both of these evaluate to 0.


0

Other information, the default constructor for the mat4 class is putting all the values to 0 This is incorrect. Your default matrix should be the identity matrix instead; i.e: 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1


0

Sounds like your talking about inertial force, if right go further right, that sounds like interia. Record previous movement use that as inertia value. If rocket adds rotation of x, it will same rotation for every iteration of x time. If you are talking about gravity, isn't that just a translation of the object some distance based on current speed * time ...



Top 50 recent answers are included