
|
Probrem of drawing Map |
Author :
qoojake
Post Date :
2010-02-21 16:51
Posts :
1
|
I have already set up a 4X4 map,
GLfloat GFloor[] ={
1.0f, 0.0f, 1.0f,
1.0f, 0.0f, 0.0f,
0.0f, 0.0f, 0.0f,
0.0f, 0.0f, 1.0f,
2.0f, 0.0f, 1.0f,
2.0f, 0.0f, 0.0f,
1.0f, 0.0f, 0.0f,
1.0f, 0.0f, 1.0f,
3.0f, 0.0f, 1.0f,
3.0f, 0.0f, 0.0f,
2.0f, 0.0f, 0.0f,
2.0f, 0.0f, 1.0f,
4.0f, 0.0f, 1.0f,
4.0f, 0.0f, 0.0f,
3.0f, 0.0f, 0.0f,
3.0f, 0.0f, 1.0f,
......
skip..
......
3.0f, 0.0f, 4.0f,
3.0f, 0.0f, 3.0f,
2.0f, 0.0f, 3.0f,
2.0f, 0.0f, 4.0f,
4.0f, 0.0f, 4.0f,
4.0f, 0.0f, 3.0f,
3.0f, 0.0f, 3.0f,
3.0f, 0.0f, 4.0f,
};
--------------------------
in the display function, i just use that way to draw
-------------------------
glPushMatrix();
glColor4f(1.0f ,0.0f, 0.0f , 1.0f);
glVertexPointer(3, GL_FLOAT, 0, GFloor);
glDrawArrays(GL_LINE_LOOP ,0, 4);
glDrawArrays(GL_LINE_LOOP , 4, 4);
glDrawArrays(GL_LINE_LOOP, 8, 4);
.......
.......
glDrawArrays(GL_LINE_LOOP, 60, 4);
----------------------
in here it is ok !
ugluLookAtf(0.0f,2.0f,0.0f,0.0f,0.0f,2.0f,0.0f, 1.0f, 0.0f);
http://www.uploadgeek.nl/files/70272806233600598509.jpg
if I move near , it appear some line that i have not draw (blue circle)
What happen with that ??
ugluLookAtf(0.0f,2.0f,3.0f,0.0f,0.0f,5.0f,0.0f, 1.0f, 0.0f);
http://www.uploadgeek.nl/files/71822549888889074720.jpg
|
All Rights Reserved, © Zeus Communications, Multimedia & Development 2004-2005
Read the Disclaimer
|
What tutorial would you like to see next?
|
Useful Books :
|
Link to ZeusCMD
|
|