Archived

This topic is now archived and is closed to further replies.

Ys

Moving probs

Recommended Posts

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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites