From a1ce3752800273300fb84b0a77df748a4248beb4 Mon Sep 17 00:00:00 2001 From: David Date: Thu, 26 Jan 2017 13:56:48 -0600 Subject: [PATCH] fixed minor lighting bugs --- main.cu | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/main.cu b/main.cu index 25cd102..b89c0da 100644 --- a/main.cu +++ b/main.cu @@ -130,8 +130,8 @@ void glut_render(void) { stim::vec3 focus = cam.getLookAt(); //get the camera focal point stim::vec3 up = cam.getUp(); //get the camera "up" orientation - stim::vec3 v = focus - eye; - stim::vec3 v1 = v.cross(up); + stim::vec3 v = focus - eye; //calculate a vector from the camera to the center + stim::vec3 v1 = v.cross(up); stim::vec3 v2 = up.cross(v); v1 = v1.norm(); v2 = v2.norm(); @@ -140,8 +140,10 @@ void glut_render(void) { stim::vec3 s = bb.size(); float r = s.len(); - stim::vec3 p1 = focus + l1*r/10; - stim::vec3 p2 = focus + l2*r/10; + //stim::vec3 p1 = focus + l1*r/5; + //stim::vec3 p2 = focus + l2*r/5; + stim::vec3 p1 = focus + cam.getUp() * 100000; + stim::vec3 p2 = cam.getPosition(); // light GLfloat global_ambient[] = { 0.5, 0.5, 0.5, 1.0 }; @@ -242,7 +244,7 @@ void glut_render(void) { glPushMatrix(); glTranslatef(p2[0], p2[1], p2[2]); glColor3f(0.0, 0.0, 1.0); - glutSolidSphere(10, 10, 10); + //glutSolidSphere(10, 10, 10); glPopMatrix(); glColor3f(1, 1, 1); -- libgit2 0.21.4