On 14 Jan 2009 at 12:05, Robert Hanson wrote:

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

It moves around (not leaving its 3D coordinate), but yes, always facing the 
viewer (in the 
special implementation I mentioned, not in the default one).
You can see both -if you have a vrml plugin installed- at the url given below. 
I am using 
solution nr.2, the central text above the sphere. Always readable!
Or better see the attached file.


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

In  "meters" as all the other dimensions of objects. As far as I can see, Jmol 
is passing the 
angstroms, even if vrml thinks it's meters. So for us, it would be in agnstroms.
And yes the fonts get bigger when you get closer, same as all the other objects 
do. 
To all effects, text is like a cut-out piece of paper for each letter, placed 
in the 3D scene.
I am attaching an example vrml file so you can see how they look. Those are 
size 0.5 family 
"SANS", located manually in the proper place (a 0.3A offset from the atom's 
coordinates).


> > 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.

No, it's a documented feature:
http://accad.osu.edu/~pgerstma/class/vnv/resources/info/AnnotatedVrmlRef/ch3-347.htm
Scroll down to after "3.47.3 Appearance", the 3rd and 4th "Tips", 
"Use the emissiveColor field ...."
"Combine a Text node with a screen-aligned Billboard  node ..."
and the example at the bottom.


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

Best -at least for labels- would be to pass just a reference to the associated 
atom. Then we 
can use atom.x, atom.y, atom.z  to position the label. I think the offset can 
be fixed at say 
0.2A in x and y. Looks good enough.

A question: how does the normal renderer calculate the position to draw a 
label? I guess it 
takes the atom coordinates, converts them to current position in screen pixels 
and adds the 
offsets. 
So, either we reverse-calculate the xyz -as you suggest- or we pass the atom 
id. Does that 
make sense?


The following section of this message contains a file attachment
prepared for transmission using the Internet MIME message format.
If you are using Pegasus Mail, or any other MIME-compliant system,
you should be able to save it or view it from within your mailer.
If you cannot, please ask your system administrator for assistance.

   ---- File information -----------
     File:  ibogaine-d.wrl
     Date:  13 Jan 2009, 21:22
     Size:  32982 bytes.
     Type:  Unknown

Attachment: ibogaine-d.wrl
Description: Binary data

------------------------------------------------------------------------------
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