On Wed, Jan 14, 2009 at 11:13 AM, Angel Herraez <[email protected]> wrote:
> My next aim: labels, maybe other texts (echo, measure).
> For this, I have identified two potential targets in
> _VrmlExporter.java:
>   drawString()
>   plotText()
>
> Apparently, the first should be the one called to render labels, but
> right now it's the second that gets called.

Right. drawString() isn't implemented in any of the renderers. I
should remove it. Early idea; wasn't needed.


> One problem with plotText (but maybe too with drawString) is that it
> takes screen coordinates (pixels), as it thinks of rendering a
> snapshot of the Jmol screen (e.g. for POV-Ray it works so). That is
> not good for VRML, since the labels are shown far away from the atoms
> and the model (which are coded in angstroms).
> The way I see it, the VRML exporter needs to clone the objects, not
> the image, so that the model can be rotated in the vrml viewer.
>

What we can do is set up a way of passing 3D coordinates to the
renderer; right now we just don't need them.


> Now to the point:
>
>
> El 14 Jan 2009 a las 10:37, Robert Hanson escribió:
>
>> Well, Angel, I'm looking forward to seeing how you handle this! My
>> concern with POV-Ray was that the result was as close as possible to
>> an exact rendering, so that's why I needed to rasterize the fonts in
>> Jmol and send out pixels.
>
> Yes, POV-Ray is basically an image. VRML is a 3D world, and has a
> tool to specify text using the string, the font style, size and
> color. So we should NOT be rasterizing them for vrml, but just using
> the tool.
>

And this text rotates with the structure when it is rotated? Or does
it stay positioned to always "face" the viewer?

>
>> You mention thinking about fonts later, but I recommend thinking about
>> them right now. Here are some starting points. Get these design
>> decisions as much as possible answered now, and we can see how to make
>> Jmol do what you want to do.
>
> Right now, I have a hard-coded font style and I am checking how to
> have the label text located at its proper place (That's what I meant
> by leaving fonts for later on). Then I want to substitute the
> hardcoded style for the one Jmol dictates, as far as possible.

How does VRML define font size? In terms of what? Do these fonts scale
when you move toward the object?

>
>
>> To what extent does the font in Jmol need to match the font in VRML?
>
> Not much, I think. Font face (serif/sans/fixed)  looks easy to match.
> Font color too. Font size is not, since vrml text is sized in
> angstroms, not pixels. But we could go for a hardcoded size as a
> decent solution (I have 0.5 angstroms right now).
>
>
>> Is it important that the font stays visible to the reader in VRML, or
>> does it rotate with the structure? -- so does VRML support that sort
>> of thing, or when you rotate the structure, the fonts rotate with it?
>
> Yes, by default it tilts and rotates, a very ugly effect imho, to the
> extent of becoming invisible from certain angles (since the text
> object has zero thickness). But I have already found the solution for
> that: the font can be given a flat color, no shininess or lighting
> effects, and remain front-viewed all the time while the model is
> rotated.
>

ok, interesting. Almost sounds like a bug.


>
>> How do you want to handle the offsets, which are in 2D pixels, not XYZ
>> coordinates?
>
> I guess you mean labelOffset. I'd go for a fixed offset (+0.2A in X
> and Y looks good for ball&stick, though of course high spacefill
> settings will obscure the label). Something else would be difficult,
> if at all possible. There is always the choice to edit the resulting
> vrml file (those that are REALLY interested in vrml will have an
> editor, I guess; chaging a parameter for an existing obejct seems
> easy enough even in plain-text editor; not so identifying wich sphere
> is the atom I'm interested in and adding a text label close to it
> from scratch).

It could probably be calculated in actual coordinate angstroms. But
the exact xyz position of the offset could be a trick.

>
> The idea is that when some atoms are labeled, we can get some sort of
> label for them in the vrml, even if not precisely identical in all
> features.
>
>
>> Once we understand the design constraints, we can make Jmol fit the design.


Bob

-- 
Robert M. Hanson
Professor of Chemistry
St. Olaf College
1520 St. Olaf Ave.
Northfield, MN 55057
http://www.stolaf.edu/people/hansonr
phone: 507-786-3107


If nature does not answer first what we want,
it is better to take what answer we get.

-- Josiah Willard Gibbs, Lecture XXX, Monday, February 5, 1900

------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
Jmol-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-developers

Reply via email to