Manta Interactive Ray Tracer Development Mailing List

Text archives Help


[MANTA] r355 - in branches/itanium2: Model/Cameras scenes


Chronological Thread 
  • From: abe@sci.utah.edu
  • To: manta@sci.utah.edu
  • Subject: [MANTA] r355 - in branches/itanium2: Model/Cameras scenes
  • Date: Fri, 27 May 2005 17:13:33 -0600 (MDT)

Author: abe
Date: Fri May 27 17:13:32 2005
New Revision: 355

Modified:
   branches/itanium2/Model/Cameras/PinholeCamera.h
   branches/itanium2/scenes/boeing777.cc
Log:
positioned camera on corner of bbox

Modified: branches/itanium2/Model/Cameras/PinholeCamera.h
==============================================================================
--- branches/itanium2/Model/Cameras/PinholeCamera.h     (original)
+++ branches/itanium2/Model/Cameras/PinholeCamera.h     Fri May 27 17:13:32 
2005
@@ -14,6 +14,8 @@
 
   class PinholeCamera : public Camera {
   public:
+               PinholeCamera( const Point &eye_, const Point &lookat_, const 
Vector &up_, Real fov_ ) :
+                       eye( eye_ ), lookat( lookat_ ), up( up_ ), hfov( fov_ 
) { setup(); }
     PinholeCamera(const vector<string>& args);
     virtual ~PinholeCamera();
     virtual void makeRays(RayPacket&) const;

Modified: branches/itanium2/scenes/boeing777.cc
==============================================================================
--- branches/itanium2/scenes/boeing777.cc       (original)
+++ branches/itanium2/scenes/boeing777.cc       Fri May 27 17:13:32 2005
@@ -23,6 +23,7 @@
 #include <Model/Primitives/Parallelogram.h>
 #include <Model/Primitives/Sphere.h>
 #include <Model/Textures/CheckerTexture.h>
+#include <Model/Cameras/PinholeCamera.h>
 #include <Core/Geometry/AffineTransform.h>
 #include <Core/Util/NotFinished.h>
 #include <Model/AmbientLights/ConstantAmbient.h>
@@ -59,13 +60,16 @@
   KDTree *kdtree = new KDTree;
   kdtree->load( file_name.c_str() );
        
+       // min = (0, -1200 -7)
+       // max = (2606, 1200, 716)
+       
        // Determine the bounds of the model.
        BBox bounds;
        kdtree->computeBounds( bounds );
        
        // Compute the height of a light above the scene.
-       Real light_height = bounds.diagonal().maxComponent();
-       Point light_position = bounds.center() + Vector(0,0,light_height);
+  Real  light_height = bounds.diagonal().maxComponent();
+       Point light_position = Point((bounds[1]-bounds[0])*0.5) + 
Vector(0,0,light_height);
        
        std::cout << "Adding light above scene: position: " << light_position 
<< std::endl;
        
@@ -79,7 +83,7 @@
   scene->setObject( kdtree );
 
   // Set other important scene properties.
-  // ...?
+  PinholeCamera *camera = new PinholeCamera( bounds[1], bounds[0], 
Vector(0,1,0), 40.0 );
        
   // Background.
   scene->setBackground( new ConstantBackground(Color(RGB(0.8, 0.8, 0.8))) );




  • [MANTA] r355 - in branches/itanium2: Model/Cameras scenes, abe, 05/27/2005

Archive powered by MHonArc 2.6.16.

Top of page