Skip to main content
GameDev.net gamedev.net
🔒 Locked

Basic texture manipulation misunderstanding... probably

Started by Lingmops Feb 21, 2005 at 5:08 AM 3 replies 600+ views
Original Post
Lingmops
Lingmops
Right, I'm in glMatrixMode(GL_TEXTURE), I can glScale fine, I can glRotate fine, but I don't seem to be able to get any effect from using glTranslate on it's own. If I use glTranslate and glRotate a noticably different effect is happening than if I just use glRotate on its own. However when I try to just use glTranslate nothing appears to happen. I don't actually want to rotate the texture, just have it scrolling down the surface of the object, I put on the rotation to test that I could actually affect the textures positioning at all. The texture is being applied to a quadratic cylinder if that makes any difference, though I'm assuming it doesn't as glScale and glRotate seem to be working fine. Am I missing something basic with how this is supposed to work here? I'm guessing that it may have something to do with auto generating the texture coords for the quadratic, but then again it's able to rotate the texture fine.... I allways get stuck in the simple little things... :/
Couvillion
Couvillion
Since we're assuming it may be simple, are you translating only along the u axis of the texture? If the texture exactly wraps the cylinder, such a rotation wouldn't change the appearance of the cylinder too much.
~~C--O -
Lingmops
Lingmops
Hrmm, this may be a source of the confusion, I've been using glTranslate and trying to move the texture on each of the three axis's's's (axii?) in turn just trying to get it to do *something* am I supposed to be using a different version of the function for uv coords? Or do the x and x paramaters just map over to being u and v choords when you use it in context of the texture matrix?

I've also tried it on a texture that's on a plain quad and I'm getting the same effects, I can scale, rotate, rotate *and* translate, just not translate on it's own.

I'm sure there'll be some stupidly simple concept somewhere that I've just not grasped which is throwing me out...
Kalidor
Kalidor
Are you only translating by whole numbers? If so than that's probably your problem. Translating a UV of (0,0) by (1,0) will give you (1,0), which will be the same as (0,0) with a repeating wrap mode.

If that's not your problem, post some code.
Lingmops
Lingmops
Ahh, that makes sense and would explain it!

I'll try that out when I get home, ta!

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.