Manta Interactive Ray Tracer Development Mailing List

Text archives Help


[MANTA] r1470 - in trunk: DynLT Model/Groups/private scenes


Chronological Thread 
  • From: brownlee@sci.utah.edu
  • To: manta@sci.utah.edu
  • Subject: [MANTA] r1470 - in trunk: DynLT Model/Groups/private scenes
  • Date: Fri, 13 Jul 2007 03:14:39 -0600 (MDT)

Author: brownlee
Date: Fri Jul 13 03:14:37 2007
New Revision: 1470

Modified:
   trunk/DynLT/DynLTWorker.cc
   trunk/Model/Groups/private/ParticleCGT.cc
   trunk/Model/Groups/private/ParticleCGT.h
   trunk/scenes/particleCGTTest.cc
Log:
minor changes to particlCGT and test file

Modified: trunk/DynLT/DynLTWorker.cc
==============================================================================
--- trunk/DynLT/DynLTWorker.cc  (original)
+++ trunk/DynLT/DynLTWorker.cc  Fri Jul 13 03:14:37 2007
@@ -19,7 +19,7 @@
 using namespace SCIRun;
 using namespace std;
 
-#define RAND() ((float)rng.nextInt()/(unsigned int)0xffffffff)  
//Carson/10/07
+#define RAND() rng.nextFloat()  //Carson 07/12/07
 
 // XXX:  the exit strategy for static thread scheduling only works 
occasionally
 //       (no segfault) when the queue isn't empty, and never when it is empty

Modified: trunk/Model/Groups/private/ParticleCGT.cc
==============================================================================
--- trunk/Model/Groups/private/ParticleCGT.cc   (original)
+++ trunk/Model/Groups/private/ParticleCGT.cc   Fri Jul 13 03:14:37 2007
@@ -213,6 +213,7 @@
     }
 #else
 
+#endif
   //we can use the previous macrocell grid to quickly get to the cells
   //that had triangles and just clear those.
 #if 1
@@ -250,7 +251,11 @@
                     //                   myCell[id].triIDs.clear();
                     //                  else
                     //if (myCell[id].triIDs.size())
+#ifdef SPHERE_CENTER
+                   // myCell[id].particles.resize(0);
+#else
                     myCell[id].triIDs.resize(0);
+                   //myCell[id].varIDs.resize(0);
                     //myCell[id].triIDs.clear();
                     id++;
                   }

Modified: trunk/Model/Groups/private/ParticleCGT.h
==============================================================================
--- trunk/Model/Groups/private/ParticleCGT.h    (original)
+++ trunk/Model/Groups/private/ParticleCGT.h    Fri Jul 13 03:14:37 2007
@@ -45,6 +45,12 @@
   }
   */
 
+  //struct Particle
+    //{
+    // sse_t sphere;  // x,y,z,r  (postion, radius)
+    //    sse_t data; // v0,v1,v2,v3 
+    //  };
+
   struct ParticleGrid : public AccelerationStructure,
                         public AlignedAllocator<ParticleGrid>
   {
@@ -72,6 +78,7 @@
 
     struct CellData {
       vector<int> triIDs;
+      //vector<Particle> particles;
     };
 
 #ifdef NUM_BUILD_THREADS
@@ -187,6 +194,7 @@
     bool buildQueue_was_resized;
 
     Group *currGroup;
+    //vector<Particle> particles; // set to homogenous spheres
 
 #ifdef MACRO_CELLS
     int oldN_mc[3];

Modified: trunk/scenes/particleCGTTest.cc
==============================================================================
--- trunk/scenes/particleCGTTest.cc     (original)
+++ trunk/scenes/particleCGTTest.cc     Fri Jul 13 03:14:37 2007
@@ -55,6 +55,7 @@
 #include <Model/Cameras/PinholeCamera.h>
 
 #include <Model/Groups/private/ParticleCGT.h>
+#include <Model/Readers/ParticleNRRD.h>
 
 #include <sgi_stl_warnings_off.h>
 #include <iostream>
@@ -69,6 +70,7 @@
 {
        /************ SKELETON FILE **********************/
        Group* world = new Group();
+       Group* pGroup = new Group();
        Scene* scene = new Scene();
        scene->setBackground(new LinearBackground(Color(RGB(0.2, 0.4, 0.9)),
                                             Color(RGB(0.0,0.0,0.0)),
@@ -76,11 +78,28 @@
 
        Material* lam = new Lambertian(Color(RGB(1,0,0)));
         Primitive* prim = new Cube(lam, Vector(-0.4, -0.3, 0.2), 
Vector(0.41, 0.3, 1.0));
+       ParticleNRRD reader;
+       reader.readFile("~/");
+       cout << "NVars: " << reader.getNVars() << endl;
+       int nvars = reader.getNVars();
+       for(int i = 0; i < reader.getNParticles(); i++)
+         {
+           float* data = reader.getParticleData() + i*nvars;
+           Vector pos(data[0], data[1], data[2]);
+           pGroup->add(new Sphere(lam, pos, 0.0001f));
+           }
+
        //world->add(prim);
        
        ParticleGrid* grid = new ParticleGrid();
+       //KeyFrameAnimaction* animation = new KeyFrameAnimation();
+       //animation->useAccelerationStructure(grid);
+       //world->add(grid);
+       world->add(pGroup);
+       //pGroup->useAccelerationStructure(grid);
+       grid->rebuild(pGroup);
        world->add(grid);
-       
+
        scene->setObject(world);
        LightSet* lights = new LightSet();
        lights->add(new PointLight(Vector(5,5,8), Color(RGB(1,1,1))*2));




  • [MANTA] r1470 - in trunk: DynLT Model/Groups/private scenes, brownlee, 07/13/2007

Archive powered by MHonArc 2.6.16.

Top of page