Manta Interactive Ray Tracer Development Mailing List

Text archives Help


[MANTA] r577 - trunk/scenes


Chronological Thread 
  • From: aek@sci.utah.edu
  • To: manta@sci.utah.edu
  • Subject: [MANTA] r577 - trunk/scenes
  • Date: Tue, 27 Sep 2005 19:25:04 -0600 (MDT)

Author: aek
Date: Tue Sep 27 19:25:03 2005
New Revision: 577

Modified:
   trunk/scenes/ParticleBVHTest.cc
Log:
* Added back option to ParticleBVHTest scene to limit the number of particles 
to load
  and display.  This makes previewing a little faster.
* Added option to ParticleBVHTest scene to specify position of the light 
source.



Modified: trunk/scenes/ParticleBVHTest.cc
==============================================================================
--- trunk/scenes/ParticleBVHTest.cc     (original)
+++ trunk/scenes/ParticleBVHTest.cc     Tue Sep 27 19:25:03 2005
@@ -1,4 +1,5 @@
 
+
 #include <Core/Exceptions/IllegalArgument.h>
 #include <Core/Util/Args.h>
 #include <Core/Math/MiscMath.h>
@@ -43,25 +44,35 @@
                           Color( RGB( 1.0, 0.4, 0.0 ) ),
                           Color( RGB( 1.0, 0.0, 0.0 ) ) };
   string model_name = "/usr/sci/data/Geometry/particle/sd173-crop.mpm";
+  int maximum_particles = 0;
   int map_channel = 0;
   double default_radius = 0.0005;
+  Point light_position( 5.0, 5.0, 8.0 );
   int argc = static_cast< int >( args.size() );
   for ( int i = 0; i < argc; i++ ) {
     string arg = args[ i ];
     if ( arg == "-model" ) {
       if ( !getStringArg( i, args, model_name ) )
         throw IllegalArgument( "scene particlebvhtest -model", i, args );
+    } else if ( arg == "-maxparticles" ) {
+      if ( !getIntArg( i, args, maximum_particles ) )
+        throw IllegalArgument( "scene particlebvhtest -maxparticles", i, 
args );
     } else if ( arg == "-mapchannel" ) {
       if ( !getIntArg( i, args, map_channel ) )
         throw IllegalArgument( "scene particlebvhtest -mapchannel", i, args 
);
     } else if ( arg == "-radius" ) {
       if ( !getDoubleArg( i, args, default_radius ) )
         throw IllegalArgument( "scene particlebvhtest -radius", i, args );
+    } else if ( arg == "-lightpos" ) {
+      if ( !getPointArg( i, args, light_position ) )
+        throw IllegalArgument( "scene particlebvhtest -lightpos", i, args );
     } else {
       cerr << "Valid options for scene particlebvhtest:" << endl
            << " -model file - MPM particle set model to show" << endl
+           << " -maxparticles number - Maximum number of particles to read 
and show" << endl
            << " -mapchannel number - Index of data field to use for color 
map" << endl
-           << " -radius number - Default radius if none given in file" << 
endl;
+           << " -radius number - Default radius if none given in file" << 
endl
+           << " -lightpos point - Position of the light source" << endl;
       throw IllegalArgument( "scene particlebvhtest", i, args );
     }
   }
@@ -70,6 +81,8 @@
     throw IllegalArgument( "Couldn't load model: " + model_name, 0, args );
   int number_of_particles, number_of_variables, radius_index;
   in1 >> number_of_particles >> number_of_variables >> radius_index;
+  if ( maximum_particles > 0 && number_of_particles > maximum_particles )
+      number_of_particles = maximum_particles;
   static const int maximum_number_of_variables = 32;
   double data[ maximum_number_of_variables ];
   double minimum_value = numeric_limits< double >::max();
@@ -88,6 +101,8 @@
   if ( !in2.is_open() )
     throw IllegalArgument( "Couldn't load model: " + model_name, 0, args );
   in2 >> number_of_particles >> number_of_variables >> radius_index;
+  if ( maximum_particles > 0 && number_of_particles > maximum_particles )
+      number_of_particles = maximum_particles;
   ParticleBVH::ParticleTexture *texture = new ParticleBVH::ParticleTexture();
   Material *material = new Lambertian( texture );
   ParticleBVH *bvh = new ParticleBVH( material, number_of_particles );
@@ -109,7 +124,7 @@
                                               Vector( 0.0, 1.0, 0.0 ) ) );
   scene->setObject( bvh );
   LightSet *lights = new LightSet();
-  lights->add( new PointLight( Point( 5.0, 5.0, 8.0), Color( RGB( 2.0, 2.0 , 
2.0 ) ) ) );
+  lights->add( new PointLight( light_position, Color( RGB( 2.0, 2.0 , 2.0 ) 
) ) );
   lights->setAmbientLight( new ArcAmbient( Color( RGB( 0.1, 0.3, 0.8 ) ),
                                            Color( RGB( 0.8, 0.6, 0.6 ) ),
                                            Vector( 0.0, 1.0, 0.0 ) ) );




  • [MANTA] r577 - trunk/scenes, aek, 09/27/2005

Archive powered by MHonArc 2.6.16.

Top of page