Try My first "3DEngine" =)

Started by
10 comments, last by Metus 22 years, 8 months ago
Well, It''s pretty simple..
Just create a structure defining a vertex point
typedef struct
{
GLfloat vX;
GLfloat vY;
GLfloat vZ;
}Heightmap;

Heightmap hMap[10][10];

for(int i = 0; i < 10; i++)
{
for(int j = 0; i < 10; i++)
{
hMap[j].vX = i;
hMap[j].vZ = j;<br> hMap[j].vY = (Rand() % 1000) / 990 <br> }<br>}<br><br>/*Draw*/<br>glBegin(GL_QUADS);<br>for(int i = 0; i < 10; i++)<br>{<br> for(int j = 0; j < 10; j++)<br> {<br> glvertex3f(hMap[j ].vX, hMap[j ].vY, hMap[j ].vZ);<br> glVertex3f(hMap[i+1][j ].vX, hMap[i+1][j ].vY, hMap[i+1][j ].vZ);<br> glVertex3f(hMap[i+1][j+1].vX, hMap[i+1][j+1].vY, hMap[i+1][j+1].vZ);<br> glVertex3f(hMap[j+1].vX, hMap[j+1].vY. hMap[j+1].vZ);<br> }<br>}<br>glEnd();<br><br>Basically: then you have to recalcualte the texture position to X / 10<br>Y / 10 </i>
Ethereal
Advertisement
My third edition of my simple 3D engine "glEngine" is now up @ http://www22.brinkster.com/wixner/glengine.zip

The world''s a little bit bigger, better generated, but thus, a bigger texture has to be used (512*512) so therefore the bigger download
Furthermore, FULL 3D Movement support is implemented...

Have a Nice...Whatever it is at you place =)
Ethereal

This topic is closed to new replies.

Advertisement