Manta Interactive Ray Tracer Development Mailing List

Text archives Help


[MANTA] r470 - in branches/itanium2: Model/Groups scenes


Chronological Thread 
  • From: abe@sci.utah.edu
  • To: manta@sci.utah.edu
  • Subject: [MANTA] r470 - in branches/itanium2: Model/Groups scenes
  • Date: Fri, 12 Aug 2005 11:00:59 -0600 (MDT)

Author: abe
Date: Fri Aug 12 11:00:57 2005
New Revision: 470

Modified:
   branches/itanium2/Model/Groups/kdtree.cc
   branches/itanium2/scenes/boeing777.cc
Log:
Incremental Change to demo, need to commit before renaming kdtree.cc..

Modified: branches/itanium2/Model/Groups/kdtree.cc
==============================================================================
--- branches/itanium2/Model/Groups/kdtree.cc    (original)
+++ branches/itanium2/Model/Groups/kdtree.cc    Fri Aug 12 11:00:57 2005
@@ -768,14 +768,17 @@
        
        // Initialize the first two entries on the stack.
        entryPos = 0;
-       nearNode = travStack[entryPos].node = rootNode; 
-       travStack[entryPos].prev = 1;
-       travStack[entryPos].t = minDist < 0.0f ? 0 : minDist;
+       nearNode = rootNode;
+       travStack[0].node = rootNode; 
+       travStack[0].prev = 1;
+       
+       // Check for the case that the minimum intersection point is behind 
the origin.
+       travStack[entryPos].t = minDist < 0.0f ? 0.0 : minDist;
        
        exitPos = 1;
-       travStack[exitPos].node = NULL;
-       travStack[exitPos].t = maxDist;
-       travStack[exitPos].prev = 0;
+       travStack[1].node = NULL;
+       travStack[1].t = maxDist;
+       travStack[1].prev = 0;
        
        while (travStack[entryPos].prev) {
                
@@ -795,13 +798,16 @@
                        
                        // Check to see which side of the split the ray 
enters first.
                        if (entryPos_coord_on_axis <= split) {
+                       
                                // Check to see if entry and exit are on the 
                                // same side of the split.
                                if (exitPos_coord_on_axis <= split) {
+
                                        // Same side of the split, so the 
original interval is ok.
                                        nearNode = nearNode->left();
                                        continue;
                                }
+                               
                                // Otherwise update the near and far nodes, 
and then update
                                // the interval below.
                                farNode = nearNode->right();
@@ -813,6 +819,7 @@
                                        nearNode = nearNode->right();
                                        continue;
                                }
+                               
                                // Update otherwise.
                                farNode = nearNode->left();
                                nearNode = nearNode->right();
@@ -824,10 +831,10 @@
                        // ??? Increment to an unused node ???
                        if (++exitPos == entryPos) ++exitPos;
                        
+                       // Update the far node.
                        // Specify a new exit node.
                        travStack[exitPos].node = farNode;
                        travStack[exitPos].t = (split - ray->origin()[axis])* 
e.inverseDirection[axis];
-                       
                        travStack[exitPos].prev = tmp;
                }
                

Modified: branches/itanium2/scenes/boeing777.cc
==============================================================================
--- branches/itanium2/scenes/boeing777.cc       (original)
+++ branches/itanium2/scenes/boeing777.cc       Fri Aug 12 11:00:57 2005
@@ -86,6 +86,7 @@
        CuttingPlaneType cutting_type = CUTTING_NONE;
        int workers_np = 1;
        bool use_transparency = false;
+       double alpha = 1.0;
        
        // Parse args.i
        for (int i=0;i<args.size();++i) {
@@ -98,8 +99,10 @@
                        if (!getIntArg(i, args, workers_np ))
                                throw IllegalArgument("boeing777 -np <num 
build workers>", i, args);
                }
-               else if (args[i] == "-transparent") {
+               else if (args[i] == "-alpha") {
                        use_transparency = true;
+                       if (!getDoubleArg(i, args, alpha ))
+                               throw IllegalArgument("boeing777 -alpha 
<alpha>", i, args);
                }
                else if (args[i] == "-cutting") {
                        string cutting_string;
@@ -130,12 +133,12 @@
        // Create a kd tree.
        // KDTree *kdtree = new KDTree( new Lambertian( new KDTreeTexture ) );
        
-// #if 0       
+  // #if 0     
        KDTree *kdtree = new KDTree( new Phong( new KDTreeTexture, 
                                                new 
Constant<Color>(Color::white()),
                                                                              
                                                                              
            512,
                                                                              
                                                                              
            new Constant<double>(0.0) ) );
-// #endif
+  // #endif
 #if 0
        KDTree *kdtree = new KDTree( new AmbientOcclusion( new KDTreeTexture, 
                                                new Constant<float>(5.0),
@@ -160,7 +163,9 @@
        // Determine if we should start with a transparent kdtree or not.
        Primitive *kd_primitive = kdtree;
        if (use_transparency) {
-               kd_primitive = new TransparentKDTree( kdtree, new 
KDTreeCopyColorMaterial );
+               TransparentKDTree *transparent = new TransparentKDTree( 
kdtree, new KDTreeCopyColorMaterial );
+               transparent->setAlpha( alpha );
+               kd_primitive = transparent;
        }
        
        
////////////////////////////////////////////////////////////////////////////




  • [MANTA] r470 - in branches/itanium2: Model/Groups scenes, abe, 08/12/2005

Archive powered by MHonArc 2.6.16.

Top of page