Try My first "3DEngine" =)
Started by Metus, Aug 05 2001 01:39 AM
11 replies to this topic
Sponsor:
#4 Members - Reputation: 122
Posted 05 August 2001 - 04:07 AM
I checked out your 3D Engine. Not bad. It is certainly a good start. The "sphere" option didn''t seem to work for me. Also, there is an issue when you press a key combination that it goes really fast. Meaning, I press Alt + G to generate a new land and it looks like the landscape is jumping all around. I didn''t see anything that reported frame per second. Anyways, nice start. By the way, the ALT + Q did work for me. As did every other key. Just not ALT + S.
#5 Anonymous Poster_Anonymous Poster_* Guests - Reputation:
Posted 05 August 2001 - 04:14 AM
The demo looks good, I initially thought that the keys wouldn''t work on my system. The problem is that Alt+key requires you to press Alt+Shift+key as the keys are in Capitals.
-------
FireFly
-------
FireFly
#6 Members - Reputation: 168
Posted 05 August 2001 - 06:44 AM
Ok, I''ve updated the Demo, Now with full 3D Movement Support =)
The Keys Are Moved to the Numeric Keypad [0, 1, 2, 3, Enter]
The only reason why everything''s going to fast is that no Timing is implemented...no FPS Calculations either
Anyway, the Updated demo is:
http://www22.brinkster.com/wixner/glengine.zip
The Keys Are Moved to the Numeric Keypad [0, 1, 2, 3, Enter]
The only reason why everything''s going to fast is that no Timing is implemented...no FPS Calculations either
Anyway, the Updated demo is:
http://www22.brinkster.com/wixner/glengine.zip
#7 Members - Reputation: 122
Posted 05 August 2001 - 08:33 AM
Metus, I wrote a little movement routine a while back that lets you move in the quake3 ghost mode style. I couldn''t get the camera to look up or down with the mouse in your demo so I thought you might want to look at the way I do it. It took me a while to figure out how to make it work perfectly so if you don''t already have that working and you want to save some time I''ll send it to you.
#11 Members - Reputation: 168
Posted 05 August 2001 - 09:30 PM
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[i][j].vZ = j;
hMap[i][j].vY = (Rand() % 1000) / 990
}
}
/*Draw*/
glBegin(GL_QUADS);
for(int i = 0; i < 10; i++)
{
for(int j = 0; j < 10; j++)
{
glvertex3f(hMap[i ][j ].vX, hMap[i ][j ].vY, hMap[i ][j ].vZ);
glVertex3f(hMap[i+1][j ].vX, hMap[i+1][j ].vY, hMap[i+1][j ].vZ);
glVertex3f(hMap[i+1][j+1].vX, hMap[i+1][j+1].vY, hMap[i+1][j+1].vZ);
glVertex3f(hMap[i ][j+1].vX, hMap[i][j+1].vY. hMap[i][j+1].vZ);
}
}
glEnd();
Basically: then you have to recalcualte the texture position to X / 10
Y / 10
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[i][j].vZ = j;
hMap[i][j].vY = (Rand() % 1000) / 990
}
}
/*Draw*/
glBegin(GL_QUADS);
for(int i = 0; i < 10; i++)
{
for(int j = 0; j < 10; j++)
{
glvertex3f(hMap[i ][j ].vX, hMap[i ][j ].vY, hMap[i ][j ].vZ);
glVertex3f(hMap[i+1][j ].vX, hMap[i+1][j ].vY, hMap[i+1][j ].vZ);
glVertex3f(hMap[i+1][j+1].vX, hMap[i+1][j+1].vY, hMap[i+1][j+1].vZ);
glVertex3f(hMap[i ][j+1].vX, hMap[i][j+1].vY. hMap[i][j+1].vZ);
}
}
glEnd();
Basically: then you have to recalcualte the texture position to X / 10
Y / 10
#12 Members - Reputation: 168
Posted 06 August 2001 - 10:40 AM
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 =)
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 =)







