Text archives Help
- From: bigler@sci.utah.edu
- To: manta@sci.utah.edu
- Subject: [MANTA] r803 - trunk/SwigInterface
- Date: Thu, 22 Dec 2005 16:47:06 -0700 (MST)
Author: bigler
Date: Thu Dec 22 16:47:06 2005
New Revision: 803
Modified:
trunk/SwigInterface/runmanta.py
Log:
Use a RealisticBvh for the Dielectric scene. It made a 60%
improvement in speed on my laptop. The Array1::add() code seems to
work properly for Swig version 1.3.27, but not for 1.3.21.
Modified: trunk/SwigInterface/runmanta.py
==============================================================================
--- trunk/SwigInterface/runmanta.py (original)
+++ trunk/SwigInterface/runmanta.py Thu Dec 22 16:47:06 2005
@@ -38,14 +38,19 @@
def createDielectricTestScene():
scene = manta_new(Scene())
scene.setBackground(manta_new(ConstantBackground(Color(RGBColor(0.5,
0.8, 0.9)))))
+ # world will be added to the scene
world = manta_new(Group())
+ # Collection of objects that will be put in the BVH.
+ objs = Array1_ObjectP()
# The gound plane
groundmatl = manta_new(Lambertian(Color(RGBColor(0.95, 0.65, 0.35))))
+ # We can't add the plane to objs, because it doesn't have a proper
+ # bounding box.
world.add(manta_new(Plane(groundmatl, Vector(0,0,1), Point(0,0,2.5))))
# Metal sphere
ball_matl = manta_new(MetalMaterial(Color(RGBColor(0.8, 0.8, 0.8)), 100))
- world.add(manta_new(Sphere(ball_matl, Point(-6, 3.5, 3.5), 1.0)))
+ objs.add(manta_new(Sphere(ball_matl, Point(-6, 3.5, 3.5), 1.0)))
lenscale = 2.5
glass = Color(RGBColor(pow(0.80, lenscale), pow(0.93, lenscale),
pow(0.87, lenscale)))
@@ -55,7 +60,7 @@
# transp_matl = manta_new(Lambertian(Color(RGBColor(0.3,0.1,0.1))))
corner = Point(i*1.3 - 4, -3, 2.5+1.e-4);
size = Vector(0.20, 2.5, 1.4);
- world.add(manta_new(Cube(transp_matl, corner, corner+size)))
+ objs.add(manta_new(Cube(transp_matl, corner, corner+size)))
# Line of rings
ringmatl = manta_new(Lambertian(Color(RGBColor(.6, .6, .9))))
@@ -64,11 +69,13 @@
center = Point(-6, 0, 2.5+r)
offset = Vector(2.25*r, 0, 0);
for i in range(9):
- world.add(manta_new(Ring(ringmatl,
- center+offset*i,
- Vector(0.2, -1, -0.2),
- inner_radius, r-inner_radius)))
-
+ objs.add(manta_new(Ring(ringmatl,
+ center+offset*i,
+ Vector(0.2, -1, -0.2),
+ inner_radius, r-inner_radius)))
+
+ # Create a BVH
+ world.add(manta_new(RealisticBvh(objs.get_objs(), objs.size())))
scene.setObject(world)
lights = manta_new(LightSet())
- [MANTA] r803 - trunk/SwigInterface, bigler, 12/22/2005
Archive powered by MHonArc 2.6.16.