[Python-talk] Mat3d
Labitt, Bruce
labittb1 at tycoelectronics.com
Wed Sep 10 17:52:23 EDT 2008
First post - python noob alert!
I'm looking to generate 3d plots of data that has been crunched by a
Cell based blade processor. The code has been written in C and creates
the data file. I'd like to render the images on my Scientific Linux 5.2
work station (RHEL 5.2 clone). I have an ATI/AMD video card which is
running the closed source video drivers, because the open 3d drivers for
my card do not exist yet. You may have witnessed some of my stupid
questions on the main gnhlug list.
My first attempt at plotting was to use gnuplot - which is not 3d
accelerated. My word - that is slow! What takes 5 seconds to render on
my win32 laptop takes tens of minutes to render on gnuplot. Not a
satisfactory solution.
Next I looked at vtk - it looks promising. However, it looks like a
longer term project. I could write everything in C, but honestly, I am
not very good at it. From what I hear, the vtk books are not too good
either. However, vtk has python linkages (or what ever you call it.) So
it has possibilities.
Quite a while back I went to a PySIG meeting and asked a couple of
questions about python. I don't remember anything about the answer, or
even the question, but I received a favorable impression about python.
I stumbled upon a reference to mat3d.py which is a simple 3d renderer
for python. So I dutifully attempted to install most of the
python/numpy/scipy stuff. After floundering about I managed to get some
of the functionality going.
The 3D rendering part seems to work - at least the example files seem to
render. When I try to save the file is when I'm getting an error
message that I'm not sure how to interpret.
Here it is:
Exception in Tkinter callback
Traceback (most recent call last):
File "/usr/lib64/python2.4/lib-tk/Tkinter.py", line 1345, in __call__
return self.func(*args)
File "/home/me/mypython/mat3d/mat3d.py", line 637, in save
self.SaveTo(fileName)
File "/home/me/mypython/mat3d/mat3d.py", line 645, in SaveTo
data = glReadPixels(0, 0, width, height, GL_RGB, GL_UNSIGNED_BYTE)
File
"/usr/lib/python2.4/site-packages/PyOpenGL-3.0.0b5-py2.4.egg/OpenGL/GL/i
mages.py", line 323, in glReadPixels
ctypes.c_void_p( imageData )
ArgumentError: argument 3: exceptions.TypeError: wrong type
Any ideas?
Bruce
More information about the Python-talk
mailing list