Andrew Davey
05-06-2004, 11:54 PM
Hi,
I have a problem, i create random starting poistions for my objects and i also have a quad which i have set up as my ground, but more often than not some of my objects are under the ground.
How can i get it so the objects always draw ontop of it.
Here is the coords for the ground:
glTranslatef(0,-100,100);
glBegin(GL_QUADS);
//bl
glVertex3f(-4000.0,-100,10000.0);
//br
glVertex3f(4000.0,-100,10000.0);
//tr
glVertex3f(4000.0,80,-10000.0);
//tl
glVertex3f(-4000.0,80,-10000.0);
glEnd();Heres how i draw something, i translate to the same place i tranlstae the ground to and draw, before it was working ok, but i have just improved the random generator and the objects are uner the ground.
Also if the way i am drawing my ground is not the best could someone mention a better way, eventually i would like to do hightmapping but not sure yet.
The ground is a bit of an angle i.e. its as if you are looking down on a plato from a hill and i'd like the objects to draw on it.
Cheers for any help.
I have a problem, i create random starting poistions for my objects and i also have a quad which i have set up as my ground, but more often than not some of my objects are under the ground.
How can i get it so the objects always draw ontop of it.
Here is the coords for the ground:
glTranslatef(0,-100,100);
glBegin(GL_QUADS);
//bl
glVertex3f(-4000.0,-100,10000.0);
//br
glVertex3f(4000.0,-100,10000.0);
//tr
glVertex3f(4000.0,80,-10000.0);
//tl
glVertex3f(-4000.0,80,-10000.0);
glEnd();Heres how i draw something, i translate to the same place i tranlstae the ground to and draw, before it was working ok, but i have just improved the random generator and the objects are uner the ground.
Also if the way i am drawing my ground is not the best could someone mention a better way, eventually i would like to do hightmapping but not sure yet.
The ground is a bit of an angle i.e. its as if you are looking down on a plato from a hill and i'd like the objects to draw on it.
Cheers for any help.