Manta Interactive Ray Tracer Development Mailing List

Text archives Help


[MANTA] r500 - trunk/Model/Primitives


Chronological Thread 
  • From: bigler@sci.utah.edu
  • To: manta@sci.utah.edu
  • Subject: [MANTA] r500 - trunk/Model/Primitives
  • Date: Thu, 25 Aug 2005 14:51:34 -0600 (MDT)

Author: bigler
Date: Thu Aug 25 14:51:33 2005
New Revision: 500

Modified:
   trunk/Model/Primitives/Parallelogram.cc
Log:

Normalize ray directions to avoid precision problems with the "dt" dot
product.


Modified: trunk/Model/Primitives/Parallelogram.cc
==============================================================================
--- trunk/Model/Primitives/Parallelogram.cc     (original)
+++ trunk/Model/Primitives/Parallelogram.cc     Thu Aug 25 14:51:33 2005
@@ -42,6 +42,11 @@
 
 void Parallelogram::intersect(const RenderContext&, RayPacket& rays) const
 {
+  // You should normalize the directions to make the "dt" dot product
+  // meaningful.  As the ray directions get longer and shorter it can
+  // affect this value.  You should be doing this dot product against
+  // normalized vectors anyway.
+  rays.normalizeDirections();
   if(rays.getFlags() & RayPacket::ConstantOrigin && rays.getSize()>1){
     RayPacket::Element& e0 = rays.get(0);
     double num = d-Dot(normal, e0.ray.origin());




  • [MANTA] r500 - trunk/Model/Primitives, bigler, 08/25/2005

Archive powered by MHonArc 2.6.16.

Top of page