[vtkusers] Shading and colors
Ulf Lorenz
ulf82 at users.sf.net
Wed Mar 24 09:29:30 EST 2004
Hi,
we recently started playing around with vtk. However, there are two
things which I have problems with.
I don't know if I have missed something, but I didn't
manage to work it out. I have appended two python scripts to demonstrate
my problem. creator.py creates a vtk file with the data using pyvtk,
viewer.py does some minimalistic setup and views the data (using Gouraud
shading)
First, it seems that the shading doesn't work great if the light
intensity is low. If you view the output of the scripts and rotate a
bit, you find a peak in the middle of the dataset. The shading works
well if you look at the bright side of the peak, however the darker side
does not look very smooth. If you don't want to run the script, a
screenshot is to be found under
http://www.physik.tu-dresden.de/~baecker/vtk/test.png
Ok, this is a minimalistic example. I don't want to bloat the mail with
attachments, so I have made another screenshot under
http://www.physik.tu-dresden.de/~baecker/vtk/other_example.png
The underlying grid here has the same structure as in my example and a
size of 40x40. I have used Phong shading (I didn't spot a visible
difference to Gouraud), which works good for
the bright pieces but not for the less bright areas. Is this a problem
of VTK and/or how can I improve the quality of the images?
The second problem covers lookup tables. I have to admit that I haven't
spent too much time on them. Again with my example script here there is
an automatic coloring, but the transitions look very edgy. In my
example, even if I increase the size of the grid to 60x60 points,
the color transitions still seem to follow the underlying polygon
structure. Does increasing the number of colors help in this case or is
there another hint?
cu,
Ulf
-------------- next part --------------
A non-text attachment was scrubbed...
Name: creator.py
Type: text/x-python
Size: 982 bytes
Desc: not available
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20040324/52c3a15a/attachment.py>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: viewer.py
Type: text/x-python
Size: 1148 bytes
Desc: not available
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20040324/52c3a15a/attachment-0001.py>
More information about the vtkusers
mailing list