MarsuGL
07-01-2001, 06:34 AM
Hello,
i want to make a very simple water effect without blending yet,
so i have a 2D square with a water texture mapped on it.
i have tried to move glTexCoord2f parameters
(at first i just want to animate the Y coordinates)
i want the wather to move from the top of my quad from the bottom and to make a circular movement (i'm not sure it's a very clear explaination..)
here's what i am tried :
.
.
.
GLfloat ycdeb=0.0f;
GLfloat ycfin=4.0f;
.
.
glBegin(GL_QUADS);
glTexCoord2f(0.0f, ycdeb);glVertex3f(-20.0,0.0,0.0);
glTexCoord2f(0.0f, ycfin);glVertex3f(-20.0,0.0,-50.0);
glTexCoord2f(4.0f, ycfin);glVertex3f(20.0,0.0,-50.0);
glTexCoord2f(4.0f, ycdeb);glVertex3f(20.0,0.0,0.0);
glEnd();
.
.
.
if (g_keys->keyDown [VK_F5] == TRUE) // Is F1 Being Pressed?
{
if (ycfin==4.0)
{
ycfin=0.1f;
ycdeb+=0.001f;
}
if (ycdeb==4.0)
{
ycdeb=0.1f;
ycfin+=0.001f;
}
ycfin+=0.001f;
ycdeb+=0.001f;
}
.
.
.
the circular effets seem to be good but the texture is not looking good, like if it was extensed.
if you can help me with this, tanks by advance.
Marsu
i want to make a very simple water effect without blending yet,
so i have a 2D square with a water texture mapped on it.
i have tried to move glTexCoord2f parameters
(at first i just want to animate the Y coordinates)
i want the wather to move from the top of my quad from the bottom and to make a circular movement (i'm not sure it's a very clear explaination..)
here's what i am tried :
.
.
.
GLfloat ycdeb=0.0f;
GLfloat ycfin=4.0f;
.
.
glBegin(GL_QUADS);
glTexCoord2f(0.0f, ycdeb);glVertex3f(-20.0,0.0,0.0);
glTexCoord2f(0.0f, ycfin);glVertex3f(-20.0,0.0,-50.0);
glTexCoord2f(4.0f, ycfin);glVertex3f(20.0,0.0,-50.0);
glTexCoord2f(4.0f, ycdeb);glVertex3f(20.0,0.0,0.0);
glEnd();
.
.
.
if (g_keys->keyDown [VK_F5] == TRUE) // Is F1 Being Pressed?
{
if (ycfin==4.0)
{
ycfin=0.1f;
ycdeb+=0.001f;
}
if (ycdeb==4.0)
{
ycdeb=0.1f;
ycfin+=0.001f;
}
ycfin+=0.001f;
ycdeb+=0.001f;
}
.
.
.
the circular effets seem to be good but the texture is not looking good, like if it was extensed.
if you can help me with this, tanks by advance.
Marsu