From: Andrew Straw <strawman@as...> - 2009-10-09 21:54:10
I'm trying to get something like texture mapping to work. (I don't need
anything fancy transforms between texel location and image location,
though. I'm happy to specify just a 2D grid of pixel colors that appear
onto a rectangle positioned in 3D space.)
Given that, I made a demo based on pcolor which I think should do the
job with a little work. I based this mainly on
examples/mplot3d/pathpatch3d_demo.py, which is pretty close to this.
Right now, though, running this results in the following traceback:
$ python poor_mans_texture_map.py
Traceback (most recent call last):
File "poor_mans_texture_map.py", line 21, in <module>
line 301, in patch_collection_2d_to_3d
line 279, in set_3d_properties
xs, ys = zip(*self.get_offsets())
ValueError: need more than 0 values to unpack
Reinier -- can you comment on how the patch offsets are supposed to be
interpreted as x,y values in this context? From the docstring at
lib/matplotlib/collections.py, I read "*offsets* and *transOffset* are
used to translate the patch after rendering (default no offsets)". It's
not immediately clear to me how the offsets should then be resulting in
X,Y values for 3D plotting. Or is something else entirely going on here?
I'm happy to do some leg-work here if you point me in the right direction.
Get latest updates about Open Source Projects, Conferences and News.