Re: [Jmol-developers] Jmol - labels in VRML?

2009-01-19 Thread Angel Herraez
El 18 Jan 2009 a las 21:51, Robert Hanson escribió:

> comments:
> 
> -- camera angle is not correct.

I had realized that the orientation was different. Don't know 
anything about that, but it is as it was in the first exporter. I 
will study the vrml doc to see if I can find the proper way.
I suspect that the axes orientation may be different than in Jmol. 
Could that be the cause?

Correction: the orientation is OK, but matches the Jmol model as in 
"reset", so it is the current orientation that is not being exported.


> -- huge distortion is a result of incorrect camera positioning.

I'm not sure what distorsion you mean. There is a big perspective 
effect, but when you rotate the model around it looks pretty similar 
to Jmol's.


> -- are font sizes correct?

No. They are all fixed at 0.4A. I know how to read Jmol's font size, 
but vrml only works in angstroms, not pixels, and I don't think we 
can do any reasonable conversion. The difference, as I see it, is:
- Jmol fonts are in pixels, by default at a fixed size irrespective 
of zoom. Or they can be optionally scalable with zoom.
- VRML fonts are objects, must be dimensioned in angstroms and will 
always be rescalable.

So the result will always be different than in Jmol anyway. The only 
thing we are missing is a possible difference in size among lables.
I don't think we can find a solution for that.


--
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
Jmol-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-developers


Re: [Jmol-developers] Jmol - labels in VRML?

2009-01-19 Thread Rolf Huehne
Angel Herraez wrote:
> El 18 Jan 2009 a las 21:51, Robert Hanson escribió:
> 
>> comments:
>>
>> -- camera angle is not correct.
> 
> I had realized that the orientation was different. Don't know 
> anything about that, but it is as it was in the first exporter. I 
> will study the vrml doc to see if I can find the proper way.
> I suspect that the axes orientation may be different than in Jmol. 
> Could that be the cause?
> 
> Correction: the orientation is OK, but matches the Jmol model as in 
> "reset", so it is the current orientation that is not being exported.
> 
I noticed the same problem with PyMOL VRML export:
the orientation set within PyMOL is not preserved after import into the
Adobe 3D program.

Regards,
Rolf

--
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
Jmol-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-developers


Re: [Jmol-developers] Jmol - labels in VRML?

2009-01-19 Thread Robert Hanson
Angel, I think the labels look pretty good.

There must be some way of defining the VRML view -- look for a
definition of a 4x4 transformation matrix (includes zoom and
centering) or a 3x3 rotation matrix. Those are available via Viewer
methods. We sidestepped this in POV-Ray by using the screen xyz
coordinates, which already take into account perspective. But the
method is there:

  public Matrix4f getMatrixtransform() {
return transformManager.getMatrixtransform();
  }

Then you can do what you want with that. Alternatively, if you need
something else, you could get the axis and angle and do something with
that.

  void getAxisAngle(AxisAngle4f axisAngle) {
transformManager.getAxisAngle(axisAngle);
  }


The distortion is due to the perspective having the camera too close
to the model. I think you just have to get close, not a perfect
rendition the way we have done in POV-Ray -- there the idea was to get
a perfect rendition of the specific view. Here we are after a more
adaptable representation.




On Mon, Jan 19, 2009 at 5:00 AM, Rolf Huehne  wrote:
> Angel Herraez wrote:
>> El 18 Jan 2009 a las 21:51, Robert Hanson escribió:
>>
>>> comments:
>>>
>>> -- camera angle is not correct.
>>
>> I had realized that the orientation was different. Don't know
>> anything about that, but it is as it was in the first exporter. I
>> will study the vrml doc to see if I can find the proper way.
>> I suspect that the axes orientation may be different than in Jmol.
>> Could that be the cause?
>>
>> Correction: the orientation is OK, but matches the Jmol model as in
>> "reset", so it is the current orientation that is not being exported.
>>
> I noticed the same problem with PyMOL VRML export:
> the orientation set within PyMOL is not preserved after import into the
> Adobe 3D program.
>
> Regards,
> Rolf
>
> --
> 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
> Jmol-developers@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/jmol-developers
>



-- 
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
Jmol-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-developers


Re: [Jmol-developers] Jmol - labels in VRML?

2009-01-19 Thread Angel Herráez
All this playing with the VRML export is making me think.

First we had the POV-ray export, but that's basically a sophisticated  image, 
right?

Then we have VRML, which I am extending with not much difficulty, thanks to 
Bob's 
implementation of new bits of code.

I've also prepared X3D export. This is a superset of VRML (which dates back to 
1997), and 
its claimed successor in every webpage I find. It is very similar, but apart 
from some 
additions which we shouldn't need for Jmol, it has the advantage (I am assuming 
it is) to be 
XML. I can have it ready in parallel to whatever we do with VRML, or we can 
leave it hidden 
in a drawer until someone requests it. However, it seems that 3DPDF won't take 
it, so we 
must stick to VRML.

And then we have U3D, which would be the best choice for going after 3DPDF. 
This latter is 
something we definitely want!

I'm starting to collect ideas and links for all these in the Wiki
http://wiki.jmol.org:81/index.php/3D_Formats
>From what I am reading, there is even the chance that Jmol could produce the 
>PDF with 
interactive model embedded! Or at least will ease the construction of the PDF 
in another 
software, by providing the U3D file.

So, my concern is: the current design of the exporters is to match the 
generators, in order to 
produce (with both) images or snapshots, i.e. 2D depictions -- that Jmol 
updates constantly 
while you rotate, if I am getting it ok. Therefore, all coordinates are 
converted to 2D for the 
exporters.

But now we have these formats that define 3D objects, so we are having to fetch 
those 2D 
coordinates and convert them back to 3D. Wouldn't it make more sense to receive 
3D 
coordinates directly?  That is, maybe we need a set of 2D renderers/exporters 
and a set of 
3D exporters, which are designed different.
Of course, I haven't got the grasp of the inner design of the java modules, so 
this is just a 
naive view.

Please, enlighten me :)




--
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
Jmol-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-developers


Re: [Jmol-developers] Jmol - labels in VRML?

2009-01-19 Thread Rolf Huehne
Angel Herráez wrote:
> All this playing with the VRML export is making me think.
> 
> First we had the POV-ray export, but that's basically a sophisticated  image, 
> right?
> 
I don't think so. As I understood it it is rather a sophisticated 3D
format. At this URL (http://tag.povray.org/povQandT/filesQandT.html) it
is described as a scripting language going much beyond the included 3D data.

Regards,
Rolf

--
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
Jmol-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-developers


Re: [Jmol-developers] Jmol - labels in VRML?

2009-01-19 Thread Angel Herráez
On 19 Jan 2009 at 9:44, Robert Hanson wrote:
[...]
> The distortion is due to the perspective having the camera too close
> to the model. 

Are you sure of that difference? See
http://biomodel.uah.es/Jmol/vrml/comparison1.png

I see them much the same.



--
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
Jmol-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-developers


Re: [Jmol-developers] Jmol - labels in VRML?

2009-01-19 Thread Angel Herráez
On 19 Jan 2009 at 9:44, Robert Hanson wrote:
> There must be some way of defining the VRML view -- look for a
> definition of a 4x4 transformation matrix (includes zoom and
> centering) or a 3x3 rotation matrix. Those are available via Viewer
> methods. 

Don't know what to do with the orientation matrix.

This is the vrml doc I found:
"The position and orientation fields of the Viewpoint node specify relative 
locations in the 
local coordinate system. Position is relative to the coordinate system's origin 
(0,0,0), while 
orientation specifies a rotation relative to the default orientation. In the 
default position and 
orientation, the user is on the Z-axis looking down the -Z-axis toward the 
origin with +X to 
the right and +Y straight up. "



--
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
Jmol-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-developers


Re: [Jmol-developers] Jmol - labels in VRML?

2009-01-19 Thread Robert Hanson
two threads going on here simultaneously -- my fault

u3d. I understand the file format. Nothing terribly difficult there,
at least not if we choose the "not compressed" format. But there
appears to be a single object type: mesh. So I'm interested in how
that works with all the spherical atoms and tubular bonds which
currently are not done that way. Could be a challenge; could be a VERY
large file. I'm definitely going to need help.

VRML. camera. Here's what I read:

http://www.vrmlsite.com/feb97/a.cgi/spot1.html

Maybe you can figure out what they are talking about:



DEF OpenView PerspectiveCamera {
position 0 50 500
orientation 1 0 0 -0.25
heightAngle .0034
}


   1. position - an XYZ coordinate of world.
   2. orientation - radian value for turning the camera through an
axis. The orientation flags for XYZ are floating point values. You can
use combinations to create isometric view angles, etc. It helps if you
have an editor or program to do this, because the calculations are
complex. You can treat these as integer flags to turn the camera. Note
that the movement is orthogonal to the axis used. Think of this as a
camera lens with three steel bars through them.
 1. X axis turn: camera lens tilts up and down
 2. Y axis turn: camera swings left or right
 3. Z axis turn: camera tilts left or right (view is upside down)
   3. heightAngle - view volume. Use with care. Like a fish eye lens,
it can produce distortions, but also, it lets you see more when camera
is closer to an object. Err... "objects are closer than they appear in
the mirror" effects.



This writer may be wrong about the axes. Looks to me like an axisAngle
definition of orientation to me. I also see regarding VRML 2.0:

Viewpoint   Specify viewpoints. This node replaces the VRML 1.0
PerspectiveCamera node.

So, for example, I see:

Viewpoint {
fieldOfView 0.785398
position 0 0 10
orientation 0 0 1 0
description "v1"
jump TRUE

}

That's got to be it. Orientation should be the viewer axisAngle.





So I suppose it's the "heightAngle" that is the key to removing that
distortion. Also:


There are two types of VRML cameras: perspective and orthographic.
Perspective cameras have a vanishing point, and orthographic cameras
don't. A perspective camera looks more natural to the human eye, so I
use it mainly. An orthographic camera does not allow objects in the
distance to disappear as one moves away. This is useful when one
object is the center of attention such as might be the case in a parts
catalog. Try them both.




On Mon, Jan 19, 2009 at 2:49 PM, Angel Herráez  wrote:
> On 19 Jan 2009 at 9:44, Robert Hanson wrote:
>> There must be some way of defining the VRML view -- look for a
>> definition of a 4x4 transformation matrix (includes zoom and
>> centering) or a 3x3 rotation matrix. Those are available via Viewer
>> methods.
>
> Don't know what to do with the orientation matrix.
>
> This is the vrml doc I found:
> "The position and orientation fields of the Viewpoint node specify relative 
> locations in the
> local coordinate system. Position is relative to the coordinate system's 
> origin (0,0,0), while
> orientation specifies a rotation relative to the default orientation. In the 
> default position and
> orientation, the user is on the Z-axis looking down the -Z-axis toward the 
> origin with +X to
> the right and +Y straight up. "
>
>
>
> --
> 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
> Jmol-developers@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/jmol-developers
>



-- 
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
Jmol-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-developers


Re: [Jmol-developers] Jmol - labels in VRML?

2009-01-19 Thread rhuehne
Quoting Robert Hanson :

> two threads going on here simultaneously -- my fault
>
> u3d. I understand the file format. Nothing terribly difficult there,
> at least not if we choose the "not compressed" format. But there
> appears to be a single object type: mesh. So I'm interested in how
> that works with all the spherical atoms and tubular bonds which
> currently are not done that way. Could be a challenge; could be a VERY
> large file. I'm definitely going to need help.
>
That fits to my experiences in creating an interactive 3D PDF figure.
The combined size of the  different parts exported as VRML was about 8 MB.
After importing them into the 'Adobe 3D Reviewer' the size of the  
resulting PDF file was about 150 MB. I couldn't find any way to reduce  
the size within the 'Adobe 3D Reviewer'. But within the main 'Adobe  
Acrobat' application I found an optimization option. This reduced the  
size of the PDF file to about 9 MB. I couldn't see any quality  
difference between the two PDF figures.

Regards,
Rolf


This message was sent using IMP, the Internet Messaging Program.


--
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
Jmol-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-developers


Re: [Jmol-developers] Jmol - labels in VRML?

2009-01-19 Thread Robert Hanson
Was that a protein?

On Mon, Jan 19, 2009 at 5:22 PM,   wrote:
> Quoting Robert Hanson :
>
>> two threads going on here simultaneously -- my fault
>>
>> u3d. I understand the file format. Nothing terribly difficult there,
>> at least not if we choose the "not compressed" format. But there
>> appears to be a single object type: mesh. So I'm interested in how
>> that works with all the spherical atoms and tubular bonds which
>> currently are not done that way. Could be a challenge; could be a VERY
>> large file. I'm definitely going to need help.
>>
> That fits to my experiences in creating an interactive 3D PDF figure.
> The combined size of the  different parts exported as VRML was about 8 MB.
> After importing them into the 'Adobe 3D Reviewer' the size of the
> resulting PDF file was about 150 MB. I couldn't find any way to reduce
> the size within the 'Adobe 3D Reviewer'. But within the main 'Adobe
> Acrobat' application I found an optimization option. This reduced the
> size of the PDF file to about 9 MB. I couldn't see any quality
> difference between the two PDF figures.
>
> Regards,
> Rolf
>
> 
> This message was sent using IMP, the Internet Messaging Program.
>
>
> --
> 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
> Jmol-developers@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/jmol-developers
>



-- 
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
Jmol-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-developers


Re: [Jmol-developers] Jmol - labels in VRML?

2009-01-19 Thread Robert Hanson
Please send links to a few PDB models -- turned into U3D files and
embedded in PDF files (prior to optimization).



On Mon, Jan 19, 2009 at 6:59 PM, Robert Hanson  wrote:
> Was that a protein?
>
> On Mon, Jan 19, 2009 at 5:22 PM,   wrote:
>> Quoting Robert Hanson :
>>
>>> two threads going on here simultaneously -- my fault
>>>
>>> u3d. I understand the file format. Nothing terribly difficult there,
>>> at least not if we choose the "not compressed" format. But there
>>> appears to be a single object type: mesh. So I'm interested in how
>>> that works with all the spherical atoms and tubular bonds which
>>> currently are not done that way. Could be a challenge; could be a VERY
>>> large file. I'm definitely going to need help.
>>>
>> That fits to my experiences in creating an interactive 3D PDF figure.
>> The combined size of the  different parts exported as VRML was about 8 MB.
>> After importing them into the 'Adobe 3D Reviewer' the size of the
>> resulting PDF file was about 150 MB. I couldn't find any way to reduce
>> the size within the 'Adobe 3D Reviewer'. But within the main 'Adobe
>> Acrobat' application I found an optimization option. This reduced the
>> size of the PDF file to about 9 MB. I couldn't see any quality
>> difference between the two PDF figures.
>>
>> Regards,
>> Rolf
>>
>> 
>> This message was sent using IMP, the Internet Messaging Program.
>>
>>
>> --
>> 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
>> Jmol-developers@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/jmol-developers
>>
>
>
>
> --
> 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
>



-- 
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
Jmol-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-developers


[Jmol-developers] u3d support

2009-01-19 Thread Robert Hanson
After some reading, here are my ideas regarding u3d support for Jmol:

The two key documents are

http://www.adobe.com/devnet/acrobat/pdfs/U3DElements_v9.pdf
http://www.ecma-international.org/publications/standards/Ecma-363.htm

It looks to me that for now it is not feasible to implement a u3d
encoder for Jmol.

The reason I say this is that there is the clear indication in the
Adobe document that Adobe 8.0 will have a new encoding option that is
totally different from the previous ECMA standard. This new option is
far simpler and far more flexible than that described in the Ecma
standard, which is very complex unless the uncompressed option is
chosen, and that cannot be done, it seems, becaue the Adobe
documentation notes that Acrobat 7 can crash or refuse to decode a u3d
file that has the uncompressed format. But Acrobat 8 will support
uncompressed data and several other simple options.

In addition, I worry that we would have to encode every single atom as
a separate mesh. I could be wrong there -- maybe you get to re-use
meshes. But it's not obvious how that would work -- I would need to
see some files. Forget text altogether, as far as I can see.

In short, it's something to look into and certainly to follow the
progress of. This could be a good "summer of code" project.

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
Jmol-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-developers