simple but hard
...this is very simple, but i can''t get it to work! i can''t get these texture coords right. here is the code:
glColor3f(1,1,1);
glTranslatef(-25,15,0);
glBindTexture(GL_TEXTURE_2D,texture[0]);
glBegin(GL_QUADS);
for (int x=0;x<50;x++){
for (int y=0;y<30;y++){
float z=sin(x+sincnt/10);
float z2=sin(x+1+sincnt/10);
glTexCoord2f(x/50,y/30); glVertex3f(x,-y,z);
glTexCoord2f(x+1/50,y/30); glVertex3f(x+1,-y,z2);
glTexCoord2f(x+1/50,y+1/30); glVertex3f(x+1,-y-1,z2);
glTexCoord2f(x/50,y+1/30); glVertex3f(x,-y-1,z);
}
}
glEnd();
you wouldn''t mind telling us what your actually trying to draw....?
glTexCoord2f((x+1)/50,y/30); glVertex3f(x+1,-y,z2);
^
--------------|
forgot the english word for "(" or ")" but if you do not use them at this position you would get a value of 49 + 1/50 and i think you want (49+1) / 50 at the end of your loop :/
^
--------------|
forgot the english word for "(" or ")" but if you do not use them at this position you would get a value of 49 + 1/50 and i think you want (49+1) / 50 at the end of your loop :/
hehe i am more interested what the english words for this:"(" and that: ")" is..
it lets my head hurt =)
it lets my head hurt =)
wow, i cant imagin such word for them... uhm. thought there was a short word for them but ok im coder no english teacher 
thx

thx
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement