Moving probs

Started by
1 comment, last by Ys 22 years, 5 months ago
Im new to opengl and im making a textured quad move about the screen when you press the arrow keys the prob is that when you press one way the picture seems to slant im not sure why this is happening, thanks for any help.
Im not fat just big boned :)
Advertisement
When you say slant, I guess you mean it is moving in the Z-direction (in other words part of the picture is going "deeper" into the screen). It could also slant if you rotate it in other directions

I would check your glRotatef() and make sure you don''t have part of your qud rotating while the rest does

If you want to move it across the screen horizontally do something like this
glTranslatef(pos, 0, -30.0f);

You could also be using glScalef() don''t scale it in the z direction if you don''t want 2. I know that makes some strange effects.

Also check your vertices of your quad to make sure you aren''t projecting a single vertex farther into the screen then the others

Also check your texture coordinates. That shouldn''t be your problem if your using glTexCoord2f() if you generated a 3d texture I suppose that could be it.

You probably just have a number somewhere you don''t want it to.
When you say slant, I guess you mean it is moving in the Z-direction (in other words part of the picture is going "deeper" into the screen). It could also slant if you rotate it in other directions

I would check your glRotatef() and make sure you don't have part of your qud rotating while the rest does

If you want to move it across the screen horizontally do something like this
glTranslatef(pos, 0, -30.0f);

You could also be using glScalef() don't scale it in the z direction if you don't want 2. I know that makes some strange effects.

Also check your vertices of your quad to make sure you aren't projecting a single vertex farther into the screen then the others

Also check your texture coordinates. That shouldn't be your problem if your using glTexCoord2f() if you generated a 3d texture I suppose that could be it.

You probably just have a number somewhere you don't want it to.

[EDIT] Sorry about the double post.

Edited by - Viscous-Flow on November 3, 2001 7:55:59 PM

This topic is closed to new replies.

Advertisement