Hmm. Polyhedra are a bit different. Sorry, I missed that in the original 
post.

You will definitely need to hack the code. This discussion moving to 
Jmol-Developers. If you are not on that list, Pim, please sign up for it.

In PolyhedraRenderer.java we have:

    Polyhedra polyhedra = (Polyhedra) shape;
    Polyhedra.Polyhedron[] polyhedrons = polyhedra.polyhedrons;
    drawEdges = polyhedra.drawEdges;
    for (int i = polyhedra.polyhedronCount; --i >= 0;) {
      short colix = polyhedra.colixes == null ? Graphics3D.INHERIT_ALL
          : polyhedra.colixes[polyhedrons[i].centralAtom.getAtomIndex()];
      render1(polyhedrons[i], colix);
    }

So you can see that translating this to POV-Ray requires:

1) getting an RGB value from a color index (colix).
2) setting the translucency (this is embedded in the colix).
3) writing the triangle vertices.

The Polyhedron class provides all the information necessary, including 
central atom, other atoms, and most importantly the "planes" that define 
the atoms that will form the sides of the polyhedra. Atom extends  
Point3f, so we have  atom.x, atom.y, atom.z.

You would have to go through that renderer code and see how it works, 
then reproduce that for a POV-Ray output.

In general, what I'd like to do is set up a getPovRay() method for all 
shapes, sort of like we have now for getShapeState(). I don't think this 
would be too complicated. I'm a little worried that we would be adding 
code to the applet that is application-specific, but if it weren't too 
much it might be worth it, and it's possible that from the applet we 
could even deliver POV-Ray code to some sort of POV-Ray applet, if that 
exists.



pim schravendijk wrote:

> At the moment I only care about the polyhedra, so from a pragmatic
> point of view I would at the moment only need the triangle function:
>
> http://www.povray.org/documentation/view/3.6.1/295/
>
>
> TRIANGLE:
>    triangle
>    {
>        <Corner_1>, <Corner_2>, <Corner_3>
>        [OBJECT_MODIFIER...]
>    }
>
> Could I write an ad-hoc script in jmol to output the wished data in
> the correct, or should I try to find my way in the source code?
>
> If someone could give me a minimal example or website with such a
> coding example, I will try to figure out the rest. Or bug you on the
> developers list if source code hacking is necessary.
>
> On 5/15/07, Bob Hanson <[EMAIL PROTECTED]> wrote:
>
>> [EMAIL PROTECTED] wrote:
>>
>> >
>> >
>> >> De: "pim schravendijk" <[EMAIL PROTECTED]>
>> >> Sujet: [Jmol-users] Exporting planes and (iso)surfaces to povray
>> >>
>> >
>> >
>> > The answer is that it has not been implemented (yet ?).
>> > The povray export is really very basic (atoms and bonds).
>> >
>> > Some time ago, I was interested in enhancing it (traces partially
>> > added), but at the time accessing the informations from Jmol core to
>> > export them in Povray format wasn't easy.
>> > It's maybe now more easy (with the possibily to retrieve properties)
>> > but I am not even sure. Bob, do we have access to enough information
>> > from the getProperty() mechanism to generate a 3D view ?
>> >
>> >
>> >
>> I don't think so. I see at
>> http://www.povray.org/documentation/view/3.6.1/63/ that, for example, a
>> trace should be a "sphere sweep", and that would  take digging into Jmol
>> and pulling out the control points, not just a finished trace.
>> Isosurfaces are just sets of triangles. The order that vertices are
>> listed determines which side is which for lighting purposes. We do
>> expose these triangles via a public interface now, so it's entirely
>> conceivable that we could "deliver" the essential information to
>> something like POV-Ray in the format described by
>> http://www.povray.org/documentation/view/3.6.1/67/. Actually, now that I
>> see http://www.povray.org/documentation/view/3.6.1/68/, this is much
>> more the Jmol model and is what one should use. Jmol has everything
>> listed there -- a set of normals, a set of vertices, a set of faces --
>> all of it. In fact, the final bit there, about texture_lists, is what we
>> would implement. The statement there: "By using the texture_list it is
>> possible to specify a texture per triangle or even per vertex in the
>> mesh. In the latter case the three textures per triangle will be
>> interpolated. " is precisely what Jmol does.
>>
>> To really pay off, I think we would want to do exports to POV-Ray that
>> are not exact duplicates of what Jmol can do. Instead, we should use
>> this as an opportunity to, for example, turn bonds into conic segments
>> rather than straight cylinders. Same goes for cartoons.
>>
>> The goal should not be to reproduce what Jmol does but rather produce
>> what Jmol cannot.
>>
>> I've been thinking that if someone wanted to do some work with POV-Ray
>> and Jmol it would be a great contribution.
>>
>> Bob
>>
>>
>>
>
>


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Jmol-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-developers

Reply via email to