This topic is 4785 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

for(int i=0;i<1;i+=STEP_SIZE) {
for(int j=0;j<100;j+=STEP_SIZE) {
glTexCoord2f(0,0);
glVertex3f(j,6,i+sin(50+(waterX+(j/STEP_SIZE*2+2)*5)*5 * M_PI/180));
glTexCoord2f(0,1);
glVertex3f(j,6,i+STEP_SIZE+sin(50+(waterX+(j/STEP_SIZE*2)*5)*5 * M_PI/180));
glTexCoord2f(1,1);
glVertex3f(j+STEP_SIZE,6,i+STEP_SIZE+sin(50+(waterX+(j/STEP_SIZE*2)*5)*5 * M_PI/180));
glTexCoord2f(1,0);
glVertex3f(j+STEP_SIZE,6,i+sin(50+(waterX+(j/STEP_SIZE*2+2)*5)*5 * M_PI/180));
glEnd();
}
}
the probalem i'm having is each strip of quads seems to as if they are joined separately instead of acting like they're joined together

##### Share on other sites
The right hand edges of the first strip bases its height off of j while the left hand side of the second strip, which is at the same x & y coordinates bases its height off of j + STEP_SIZE.
for (int i=0; i < 1; i += STEP_SIZE){	for(int j=0; j < 100; j += STEP_SIZE)	{		glBegin(GL_QUADS);		glTexCoord2f(0, 0);		glVertex3f(j, 6, i + sin(50 + (waterX + (j / STEP_SIZE * 2 + 2) * 5) * 5 * M_PI / 180));		glTexCoord2f(0, 1);		glVertex3f(j, 6, i + STEP_SIZE + sin(50 + (waterX + (j / STEP_SIZE * 2) * 5) * 5 * M_PI / 180));		glTexCoord2f(1, 1);		glVertex3f(j + STEP_SIZE, 6, i + STEP_SIZE + sin(50 + (waterX + ((j + STEP_SIZE) / STEP_SIZE * 2) * 5) * 5 * M_PI / 180));		glTexCoord2f(1, 0);		glVertex3f(j + STEP_SIZE, 6, i + sin(50 + (waterX + ((j + STEP_SIZE) / STEP_SIZE * 2 + 2) * 5) * 5 * M_PI/180));		glEnd();	}}

Enigma

1. 1
2. 2
Rutin
17
3. 3
4. 4
5. 5

• 9
• 9
• 14
• 12
• 10
• ### Forum Statistics

• Total Topics
633271
• Total Posts
3011161
• ### Who's Online (See full list)

There are no registered users currently online

×