mayavi2 problem with light sources

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

mayavi2 problem with light sources

Andreas Knittel
Dear mailing list members,

I have a problem with the light in Mayavi2. Let me describe what I am
trying to do:
I am using the GUI in order to visualize a 3D vector field, which I
import from a vtk file. The vector field is defined on a pyramid with a
square base (of that kind as you can find in Gizeh;)). Let's say that
the base of the pyramid lies in the xy plane while its tip is aligned
along the z direction. I use the ExtractVectorComponents filter in order
to define the vector field's z component as a scalar field, and the
Surface module for depicting the latter. Now I'd like to create a
picture, which shows the surface from the top together with a
corresponding color bar. However, the standard settings for the mayavi2
light sources lead to shading effects on the surface. I can get rid of
the shading effects by placing a separate light source for each side
face of the pyramid, but then (looking from the top) the coloring of the
surface differs from the one displayed in the colorbar.

Is there the possibility that the surface displays exactly the same
colors as the colorbar? Of course, I could try to play around with the
light sources and try to get something which is roughly right. But since
I want to use corresponding plots in scientific publications I would
prefer to have a more objective method.

I hope the discription of my problem is well understandable and I would
appreciate any helpful comments.

Many thanks,

Andreas

_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: mayavi2 problem with light sources

Gael Varoquaux
On Mon, Mar 22, 2010 at 01:15:00PM +0000, Andreas Knittel wrote:
> Is there the possibility that the surface displays exactly the same
> colors as the colorbar? Of course, I could try to play around with the
> light sources and try to get something which is roughly right. But since
> I want to use corresponding plots in scientific publications I would
> prefer to have a more objective method.

You need to put the ambient property of the material to the maximum: go
to the 'actor' tab of you module, click on the 'more options' button at
the bottom of the 'property' box, and put the 'Ambient' slider to the
max. Also, in the 'Actor' tab of the module, select 'interplolate scalars
before mapping'.

Those setting should give you something pretty close to what you are
looking for.


HTH,

Gaƫl
_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: mayavi2 problem with light sources

Andreas Knittel

> You need to put the ambient property of the material to the maximum: go
> to the 'actor' tab of you module, click on the 'more options' button at
> the bottom of the 'property' box, and put the 'Ambient' slider to the
> max. Also, in the 'Actor' tab of the module, select 'interplolate scalars
> before mapping'.
>
> Those setting should give you something pretty close to what you are
> looking for.

Certainly close enough;) Thank you very much for your quick answer,
Gael. Just for the records: Since I have Linux Debian on my computer, I
had a quite old version of mayavi2 on my system (version 2.2 or
something). Therefore, in order to follow Gael's instruction, I had to
upgrade to a more recent version. I did this by using the precompiled
binding's of Debian's testing release.

Once again, many thanks,

Andreas



_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev