Advertisement

simple but hard

Started by September 04, 2002 07:54 PM
12 comments, last by PmanC 22 years, 5 months ago
...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....?
Advertisement
a waving flag.
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 :/
oh... i never thought of that, i will go try it! -PmanC
hehe i am more interested what the english words for this:"(" and that: ")" is..
it lets my head hurt =)
Advertisement
''('' '')'' = Parentheses
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
I have a full waving-flag demo from a book if you''d like it let me know.
The short word is brackets.

This topic is closed to new replies.

Advertisement