Manta Interactive Ray Tracer Development Mailing List

Text archives Help


[MANTA] r1241 - trunk/scenes/galileo


Chronological Thread 
  • From: bigler@sci.utah.edu
  • To: manta@sci.utah.edu
  • Subject: [MANTA] r1241 - trunk/scenes/galileo
  • Date: Fri, 1 Dec 2006 19:36:12 -0700 (MST)

Author: bigler
Date: Fri Dec  1 19:36:11 2006
New Revision: 1241

Modified:
   trunk/scenes/galileo/galileo.cc
   trunk/scenes/galileo/grparse.y
Log:

galileo.cc

  Set the ambient color to not white.

grparse.y

  Parse Triangle primitives now.


Modified: trunk/scenes/galileo/galileo.cc
==============================================================================
--- trunk/scenes/galileo/galileo.cc     (original)
+++ trunk/scenes/galileo/galileo.cc     Fri Dec  1 19:36:11 2006
@@ -73,7 +73,7 @@
   Color cdown(RGB(0.82, 0.62, 0.62));
   Vector up(0,0,1);
   //  lights->setAmbientLight(new ArcAmbient(cup, cdown, up));
-  lights->setAmbientLight(new ConstantAmbient(Color(RGBColor(1,1,1))));
+  lights->setAmbientLight(new ConstantAmbient(Color(RGBColor(0.3,0.3,0.3))));
   scene->setLights(lights);
   return scene;
 }

Modified: trunk/scenes/galileo/grparse.y
==============================================================================
--- trunk/scenes/galileo/grparse.y      (original)
+++ trunk/scenes/galileo/grparse.y      Fri Dec  1 19:36:11 2006
@@ -19,6 +19,7 @@
 
   #include <Model/Groups/Group.h>
   #include <Model/Primitives/Parallelogram.h>
+  #include <Model/Primitives/Triangle.h>
   #include <Model/Materials/Lambertian.h>
   #include <Model/Textures/Constant.h>
 
@@ -787,6 +788,26 @@
                                  /* anchor   */ anchor,
                                  /* v1       */ v1,
                                  /* v2       */ v2));
+  } else if (strcmp($2, "Triangle") == 0) {
+    map<string, vector<Vector> >::iterator found = params.vectors.find("P");
+    if (found != params.vectors.end()) {
+      size_t num_vectors = (*found).second.size();
+      if (num_vectors == 3) {
+        world->add(new Triangle(current_material,
+                                (*found).second[0],
+                                (*found).second[1],
+                                (*found).second[2]));
+      } else {
+        fprintf(stderr, "Got wrong number of P vectors (got %llu) \n",
+                (unsigned long long)num_vectors);
+        exit(2);
+      }
+    } else {
+      // woot woot
+      fprintf(stderr, "vector base not found for Parallelogram\n");
+      exit(2);
+    }
+    
   } else {
     fprintf(stderr, "Unknown surface object (%s)\n", $2);
   }




  • [MANTA] r1241 - trunk/scenes/galileo, bigler, 12/01/2006

Archive powered by MHonArc 2.6.16.

Top of page