Manta Interactive Ray Tracer Development Mailing List

Text archives Help


[MANTA] r298 - trunk/scenes


Chronological Thread 
  • From: thiago@sci.utah.edu
  • To: rtrt@sci.utah.edu
  • Subject: [MANTA] r298 - trunk/scenes
  • Date: Thu, 12 May 2005 17:00:45 -0600 (MDT)

Author: thiago
Date: Thu May 12 17:00:44 2005
New Revision: 298

Modified:
   trunk/scenes/primtest.cc
Log:
includes ply code now

Modified: trunk/scenes/primtest.cc
==============================================================================
--- trunk/scenes/primtest.cc    (original)
+++ trunk/scenes/primtest.cc    Thu May 12 17:00:44 2005
@@ -30,6 +30,7 @@
 #include <Model/Textures/Constant.h>
 #include <Model/Textures/CheckerTexture.h>
 #include <Model/Textures/MarbleTexture.h>
+#include <Model/Readers/PlyReader.h>
 #include <Model/Textures/WoodTexture.h>
 #include <Model/Textures/OakTexture.h>
 #include <Core/Math/MinMax.h>
@@ -51,9 +52,10 @@
   double texscale = 20;
   int numx = 8;
   int numy = 8;
-  string primtype = "sphere";
+  string primtype = "ply";
   string material = "redphong";
   string arraytype = "spin";
+  string modelName = 
"/usr/sci/data/Geometry/Stanford_Sculptures/bun_zipper_res4.ply";
   bool set_primtype = false;
   bool bgpoly = true;
   int argc = static_cast<int>(args.size());
@@ -74,6 +76,9 @@
     } else if(arg == "-array"){
       if(!getStringArg(i, args, arraytype))
        throw IllegalArgument("scene primtest -array", i, args);
+    } else if(arg == "-model"){
+      if(!getStringArg(i, args, modelName))
+       throw IllegalArgument("scene primtest -model", i, args);
     } else {
       if(arg[0] == '-' || set_primtype) {
        cerr << "Valid options for scene primtest:\n";
@@ -234,6 +239,13 @@
     if ( mapr )
         prim->setTexCoordMapper( mapr );
     spinprim = prim;
+  } else if(primtype == "ply"){
+    Transform t;
+    t.pre_scale(Vector(scale/max*30, scale/max*30, scale/max*30));
+    Group *model = new Group();
+    readPlyFile(modelName, t, model, 0, matl);
+    //spinprim = model;
+    group->add(model);
   } else {
     throw IllegalArgument("Unknown primitive type for primtest: "+primtype, 
0, args);
   }




  • [MANTA] r298 - trunk/scenes, thiago, 05/12/2005

Archive powered by MHonArc 2.6.16.

Top of page