Manta Interactive Ray Tracer Development Mailing List

Text archives Help


[MANTA] r1239 - in trunk: Model/AmbientLights SwigInterface


Chronological Thread 
  • From: bigler@sci.utah.edu
  • To: manta@sci.utah.edu
  • Subject: [MANTA] r1239 - in trunk: Model/AmbientLights SwigInterface
  • Date: Fri, 1 Dec 2006 19:10:01 -0700 (MST)

Author: bigler
Date: Fri Dec  1 19:10:00 2006
New Revision: 1239

Modified:
   trunk/Model/AmbientLights/ArcAmbient.cc
   trunk/SwigInterface/manta.i
Log:

Model/AmbientLights/ArcAmbient.cc

  Checks to make sure we don't get NaNs when the normal isn't quite
  normalized.

SwigInterface/manta.i

  Get rid of duplicate typedef.


Modified: trunk/Model/AmbientLights/ArcAmbient.cc
==============================================================================
--- trunk/Model/AmbientLights/ArcAmbient.cc     (original)
+++ trunk/Model/AmbientLights/ArcAmbient.cc     Fri Dec  1 19:10:00 2006
@@ -33,7 +33,11 @@
   rays.computeNormals(context);
   for(int i=rays.begin();i<rays.end();i++){
     Real cosine = Dot(rays.getNormal(i), up);
-    Real sine = SCIRun::Sqrt(1-cosine*cosine);
+    Real sine = 1-cosine*cosine;
+    // This makes this safe from cases where your normal is too "long"
+    // and cosine is greater than 1.  In that case you end up with
+    // sine being NaN, which really sucks.
+    sine = (sine > 0) ? SCIRun::Sqrt(sine): 0;
     // So we want to do the computation for w0 and w1 as type Real,
     // because that is what all the other computation will be done,
     // but we would like to cast that to type ColorComponent, because

Modified: trunk/SwigInterface/manta.i
==============================================================================
--- trunk/SwigInterface/manta.i (original)
+++ trunk/SwigInterface/manta.i Fri Dec  1 19:10:00 2006
@@ -58,7 +58,6 @@
 
 ///////////////////////////////////////////////////////
 // ImageDisplay
-typedef int Window;
 
 %{
 #include <Engine/Display/SyncDisplay.h>




  • [MANTA] r1239 - in trunk: Model/AmbientLights SwigInterface, bigler, 12/01/2006

Archive powered by MHonArc 2.6.16.

Top of page