Text archives Help
- From: arobison@sci.utah.edu
- To: manta@sci.utah.edu
- Subject: [Manta] r1771 - trunk/scenes
- Date: Tue, 9 Oct 2007 18:27:09 -0600 (MDT)
Author: arobison
Date: Tue Oct 9 18:27:09 2007
New Revision: 1771
Modified:
trunk/scenes/teapotRoom.cc
Log:
Placing the bunny correctly in the scene and enabling the command
line arguments for specifying the teapot and bunny meshes.
Modified: trunk/scenes/teapotRoom.cc
==============================================================================
--- trunk/scenes/teapotRoom.cc (original)
+++ trunk/scenes/teapotRoom.cc Tue Oct 9 18:27:09 2007
@@ -26,6 +26,7 @@
#include <Model/AmbientLights/ArcAmbient.h>
#include <Core/Exceptions/IllegalArgument.h>
+#include <Core/Util/Args.h>
#include <iostream>
@@ -80,7 +81,7 @@
// load mesh
if(!strncmp(mesh_name.c_str()+mesh_name.length()-4, ".ply", 4)) {
mesh = new Mesh();
- if (readPlyFile(mesh_name, transform, mesh, material,
MeshTriangle::WALD_TRI)) {
+ if (readPlyFile(mesh_name, transform, mesh, material)) {
DynBVH* mesh_bvh = new DynBVH();
mesh_bvh->setGroup(mesh);
return mesh_bvh;
@@ -89,7 +90,7 @@
return 0;
}
} else if(!strncmp(mesh_name.c_str()+mesh_name.length()-4, ".obj", 4)) {
- mesh = new ObjGroup(mesh_name.c_str(), material,
MeshTriangle::WALD_TRI);
+ mesh = new ObjGroup(mesh_name.c_str(), material);
DynBVH* mesh_bvh = new DynBVH();
mesh_bvh->setGroup(mesh);
Instance* instance = new Instance(mesh_bvh, transform);
@@ -115,9 +116,10 @@
Color::white()*0.3,
400);
AffineTransform bunnyT;
- bunnyT.translate(Vector(-30.0, 15.0, 0));
- // bunnyT.translate(Vector(0,0,0.01));
- bunnyT.scale(Vector(95.0, 95.0, 95.0));
+ bunnyT.initWithIdentity();
+ bunnyT.translate(Vector(-.35, -.0335, .15));
+ bunnyT.rotate(Vector(1,0,0), M_PI_2);
+ bunnyT.scale(Vector(95.0, -95.0, 95.0));
Object* bunny = packMesh(bunny_file, bunnyT, bunny_material);
if (bunny)
group->add(bunny);
@@ -254,6 +256,12 @@
if (arg == "--help") {
usage();
return 0;
+ } else if(arg == "-teapot") {
+ if(!getStringArg(i, args, teapot_file))
+ throw IllegalArgument("scene teapotRoom - teapot", i ,args);
+ } else if(arg == "-bunny") {
+ if(!getStringArg(i, args, bunny_file))
+ throw IllegalArgument("scene teapotRoom - teapot", i ,args);
}
}
- [Manta] r1771 - trunk/scenes, arobison, 10/09/2007
Archive powered by MHonArc 2.6.16.