Enhance light rendering
This commit is contained in:
parent
640f801441
commit
5b6e61cec9
3 changed files with 3 additions and 3 deletions
|
@ -59,7 +59,7 @@ class MarchingCubes {
|
||||||
const Cuboid& box=Cuboid(
|
const Cuboid& box=Cuboid(
|
||||||
Point(-20, -20, -20),
|
Point(-20, -20, -20),
|
||||||
Point(20, 20, 20)),
|
Point(20, 20, 20)),
|
||||||
double resolution=.25);
|
double resolution=.1);
|
||||||
|
|
||||||
/** Add a starting point hint
|
/** Add a starting point hint
|
||||||
*
|
*
|
||||||
|
|
|
@ -12,7 +12,7 @@ int main(int argc, char** argv) {
|
||||||
GlutRender& render = GlutRender::get_instance();
|
GlutRender& render = GlutRender::get_instance();
|
||||||
render.init(&argc, argv, 640, 480, "Bouncing stuff");
|
render.init(&argc, argv, 640, 480, "Bouncing stuff");
|
||||||
|
|
||||||
Ball ball(Point(0, 5, 0), 0.75, -.5, -1, 1, 1);
|
Ball ball(Point(0, 5, 0), 0.75, -.5, -.7, 1, 1);
|
||||||
|
|
||||||
Cuboid bbox = ball.get_surface()->max_bounding_box();
|
Cuboid bbox = ball.get_surface()->max_bounding_box();
|
||||||
printf("%.2lf %.2lf %.2lf | %.2lf %.2lf %.2lf\n",
|
printf("%.2lf %.2lf %.2lf | %.2lf %.2lf %.2lf\n",
|
||||||
|
|
|
@ -34,7 +34,7 @@ void GlutRender::init(int* argc, char** argv,
|
||||||
GLfloat light0_pos[] = {10., 15., 10.};
|
GLfloat light0_pos[] = {10., 15., 10.};
|
||||||
GLfloat light0_ambient[] = {0., 0., 0., 1.};
|
GLfloat light0_ambient[] = {0., 0., 0., 1.};
|
||||||
GLfloat light0_diffuse[] = {1., 1., .65, 1.};
|
GLfloat light0_diffuse[] = {1., 1., .65, 1.};
|
||||||
GLfloat light0_specular[] = {1., 1., .65, 1.};
|
GLfloat light0_specular[] = {5., 5., .33, 1.};
|
||||||
glLightfv(GL_LIGHT0, GL_POSITION, light0_pos);
|
glLightfv(GL_LIGHT0, GL_POSITION, light0_pos);
|
||||||
glLightfv(GL_LIGHT0, GL_AMBIENT, light0_ambient);
|
glLightfv(GL_LIGHT0, GL_AMBIENT, light0_ambient);
|
||||||
glLightfv(GL_LIGHT0, GL_DIFFUSE, light0_diffuse);
|
glLightfv(GL_LIGHT0, GL_DIFFUSE, light0_diffuse);
|
||||||
|
|
Loading…
Reference in a new issue