diff options
author | Stan Seibert <stan@mtrr.org> | 2011-10-08 16:20:10 -0400 |
---|---|---|
committer | Stan Seibert <stan@mtrr.org> | 2011-10-08 16:20:10 -0400 |
commit | 1788d1284a4750924503f67b9e70142343c7fe5a (patch) | |
tree | d77e4ac238e79421b655f0ce075060c4e57fdd05 | |
parent | 873932b758dab87389fc2acbfba1b47cae0dc9e1 (diff) | |
download | chroma-1788d1284a4750924503f67b9e70142343c7fe5a.tar.gz chroma-1788d1284a4750924503f67b9e70142343c7fe5a.tar.bz2 chroma-1788d1284a4750924503f67b9e70142343c7fe5a.zip |
Make Camera.build work with anything callable, not just functions. Also make plain meshes more opaque because the high transparency is visually confusing.
-rw-r--r-- | chroma/camera.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/chroma/camera.py b/chroma/camera.py index 628307a..74ac4ad 100644 --- a/chroma/camera.py +++ b/chroma/camera.py @@ -7,7 +7,6 @@ import os from subprocess import call import shutil import tempfile -import inspect import pycuda.driver as cuda from pycuda import gpuarray as ga @@ -26,7 +25,7 @@ from pygame.locals import * def build(obj): """Construct and build a geometry from `obj`.""" - if inspect.isfunction(obj): + if callable(obj): obj = obj() if isinstance(obj, Geometry): @@ -36,7 +35,7 @@ def build(obj): geometry.add_solid(obj) elif isinstance(obj, Mesh): geometry = Geometry() - geometry.add_solid(Solid(obj, vacuum, vacuum, color=0x99ffffff)) + geometry.add_solid(Solid(obj, vacuum, vacuum, color=0x33ffffff)) else: raise TypeError('cannot build type %s' % type(obj)) |