Well, we're in good company. I admit to not knowing anything about
perspective and motion in U3D. the motion frame stuff there is just an early
attempt I had at trying to get this to work. I think the IDTF converter is
buggy in this regard -- I certainly could never get it to work properly. I'm
glad to see that SOMEONE (the pdfLatex folks) has.

Consider everything in that header to be developable.

KEY_FRAME_XXXXX values are being calculated. Here are my development notes
to mull over:

  /*
   * by Bob Hanson 8/6/2009 -- preliminary only -- needs testing
   *
   * after
   *
   * write t.idtf
   *
   * using IDTFConverter.exe, on Windows one can turn these files into VERY
COMPACT U3D files.
   *
   * IDTFConverter.exe -input t.idtf -output t.u3d
   *
   * see http://sourceforge.net/projects/u3d/
   *
   *   especially
http://u3d.svn.sourceforge.net/viewvc/u3d/trunk/Docs/IntermediateFormat/IDTF%20Format%20Description.pdf
   *   and in the downloadable zip file, see
Bin/Win32/Release/IDTFConverter.exe
   *
   * see also http://en.wikipedia.org/wiki/Universal_3D
   * see also
http://www.ecma-international.org/publications/standards/Ecma-363.htm
   *
   * for the complete Windows package, see also
http://chemapps.stolaf.edu/jmol/docs/misc/idtf.zip
   *
   * Development comment:
   *
   * I have spent quite a bit of time now tearing my hair out trying to
   * figure out how to do this right. The documentation is so opaque,
   * I can hardly believe it. Nowhere is there a definition of what the
   * view matrix really means, how a view relates to actual camera position
   * or how translations are to be applied. For example, I simply cannot
   * figure out how to invoke a default view within a PDF or DeepView short
   * of having the user go in and choose the view. But then when I get that
   * going, the zoom is terribly wrong. A "view" has "units" that are
   * either in pixels or "percent". Here is all we have on that:
   *
     9.5.4.4 U32: View Node Attributes
     View Node Attributes is a bitfield used to indicate different modes of
operation of the view
     node. View Node Attributes are defined for projection mode and for
screen position units
     mode.
   *
   * Period. That's it. What the heck is "screen position units mode"? Beats
me.
   * Nowhere can I find any documentation that actually demonstrates how do
   * use this resource.
   *
   * It's interesting, as well, that the two viewers -- 3D PDF and DeepView
--
   * do not give the same result with some of my tests. I can only conclude
that
   * view model is ill defined.
   *
   * Amazingly, with VRML it was straightforward to convert from Jmol. We
have a
   * viewing axisAngle that we can pop straight into VRML and get the proper
view.
   * Not so here. I can get initial orientation, but the zoom is all wrong.
   *
   * So the U3D documentation reads:
   *
     The default node is a group node with no parents. The default node is
located at the world origin
     (the identity transform).
     There is no default model node, default light node, nor default view
node.

     The default light resource is an ambient light that is enabled, no
specularity, and color values
     rgb(0.75, 0.75, 0.75).

     A scene graph can have several view nodes that define different
viewpoints in the world.
     Although there is no default view node, there is a preference for
having the coordinate system
     oriented such that the Z-axis is in the up direction with the Y-axis
oriented in the direction of
     the view.
     The default view resource has the following properties: pass count one,
root node is the default
     node, and fog disabled.

   * Right, OK. But obviously in a real viewer there IS a default for all of
these.
   * I have instead implemented a default view using animation. This is a
total hack.
   * The true default view in both 3D-PDF and DeepView appears to be the
rotation associated
   * with quaternion (0.6414883, -0.5258319, 0.3542887, 0.43182528)
   *
   * The problem that the documentation itself is totally unhelpful.
   * I had to go through the C++ code for IDTFConverter to find the correct
set
   * of IDTF format fields for the modifiers. Has anyone actually done
this??
   *
   * As it turns out, you can get a default view, at least for orientation.
   * You just add an animation modifier that negates that default quaternion
and applies
   * the correct one. However, ZOOM is a completely different issue. I
simply
   * cannot get the default zoom to work here.
   *
   * Bob Hanson 8/15/2009
   *
   */


  /* IDTF documentation is in error with regard to motion resources. This is
correct:
   *
 RESOURCE_LIST "MOTION" {
  RESOURCE_COUNT 1
  RESOURCE 0 {
    RESOURCE_NAME "Motion0"
    MOTION_TRACK_COUNT 1
    MOTION_TRACK_LIST {
      MOTION_TRACK 0 {
        MOTION_TRACK_NAME "M00"
        MOTION_TRACK_SAMPLE_COUNT 1
        KEY_FRAME_LIST {
          KEY_FRAME 0 {
            KEY_FRAME_TIME 0
            KEY_FRAME_DISPLACEMENT 0 0 0
            KEY_FRAME_ROTATION 1 0 0 0
            KEY_FRAME_SCALE 1 1 1
          }
        }
      }
    }
  }
 }

   */

....

Bob


On Thu, Jul 15, 2010 at 11:05 AM, Van der Lee <avder...@univ-montp2.fr>wrote:

> Robert Hanson wrote the following on 15/07/2010 17:33:
>
>
>>
>> AH-HAH! That's what I've been looking for. How do these values for 3D
>> parameters relate to our perspective in Jmol? We can have Jmol write this
>> file if you can explain it.
>>
>>
>>
>>    4) decomment in a first run the \movieref line. You will have the
>>    possibility to better center the object and by clicking on 'click
>> here!'
>>    AR calculates you a new set of coordinates that may replace by copy and
>>    paste the old set. The bigger the object the longer AR takes to
>>    calculate the set of coordinates. Be patient, this may be long and not
>>    feasable on a notebook. By the way, if your initial set of coordinates
>>    is totally wrong, then you may not see your object at all after the
>>    initial pdflatex runs. You need to zoom or dezoom and/or translate to
>>    get the object into your visible frame.
>>
>>
>> OK, we can do this automatically. Will take some experimentation. Can you
>> help, Arie? We need to see exactly what the relationship is between the
>> numbers there and (perhaps)
>>
>>
>
> Yes, I could help ofcourse, but wouldn't this be just a fix just for
> pdflatex/movie15 postprocessing? What happens if you import the .u3d
> straight into a pdf using Adobe Professionnel? Is there by the way any
> software to visualize directly a .u3d file?
>
> There is another issue with the 'MOTION' resource in the idtf file
> This is the original one:
>          KEY_FRAME 0 {
>            KEY_FRAME_TIME 0
>            KEY_FRAME_DISPLACEMENT 0 0 0
>            KEY_FRAME_ROTATION 0.5057303 0.69191486 -0.41868728 -0.3003194
>            KEY_FRAME_SCALE 1 1 1
>          }
>          KEY_FRAME 1 {
>            KEY_FRAME_TIME 1
>            KEY_FRAME_DISPLACEMENT 1.169039E-7 -6.9596204E-8 -2.1710136E-7
>            KEY_FRAME_ROTATION 0.5057303 0.69191486 -0.41868728 -0.3003194
>            KEY_FRAME_SCALE 0.9611686 0.9611686 0.9611686
>          }
>
> I need to reset this (I have automated this with a python script) to:
>          KEY_FRAME 0 {
>            KEY_FRAME_TIME 0
>            KEY_FRAME_DISPLACEMENT 0 0 0
>            KEY_FRAME_ROTATION 0.5057303 0.69191486 -0.41868728 -0.3003194
>            KEY_FRAME_SCALE 1.0 1.0 1.0
>          }
>          KEY_FRAME 1 {
>            KEY_FRAME_TIME 1
>            KEY_FRAME_DISPLACEMENT 0.00001 0.00001 0.00001
>            KEY_FRAME_ROTATION 0.5057303 0.69191486 -0.41868728 -0.3003194
>            KEY_FRAME_SCALE 1.0 1.0 1.0
>          }
>
> i.e. no scale change and a very tiny displacement. Combined with
> movie15-autoplay this gives the desired effect. Bob, is there a special
> reason for this change in scale? and if I am right your displacement is not
> always the same, sometimes it is really important.
> Can we actually remove the motion resource? I admit that I do not know
> anything about idtf.
>
>
I have this now reading  as follows -- but we can do anything we want --
including drop it.

My immediate goal is to have you be able to scuttle the python script. We
want this done right without need for messing with it. Show me that script!


RESOURCE_LIST "MOTION" {
  RESOURCE_COUNT 1
  RESOURCE 0 {
    RESOURCE_NAME "Motion0"
    MOTION_TRACK_COUNT 1
    MOTION_TRACK_LIST {
      MOTION_TRACK 0 {
        MOTION_TRACK_NAME "M00"
        MOTION_TRACK_SAMPLE_COUNT 2
        KEY_FRAME_LIST {
          KEY_FRAME 0 {
            KEY_FRAME_TIME 0
            KEY_FRAME_DISPLACEMENT 0 0 0
            KEY_FRAME_ROTATION 0.08178142 0.82542 -0.55586654 -0.054826617
            KEY_FRAME_SCALE 1 1 1
          }
          KEY_FRAME 1 {
            KEY_FRAME_TIME 1
            KEY_FRAME_DISPLACEMENT -.0060 -.615 -.719
            KEY_FRAME_ROTATION 0.08178142 0.82542 -0.55586654 -0.054826617
            KEY_FRAME_SCALE 1 1 1
          }
         }
      }
    }
  }
}



>
> Arie
>
>
> --
> ***************************************************************************
> A. van der Lee
> Institut Européen des Membranes
> CNRS - UMR 5635
> Université de Montpellier II - Case Courrier 047
> Place E. Bataillon
> 34095 MONTPELLIER Cedex 5 - FRANCE
>
> Tel :  33 (0) 4 67 14 91 35
> Fax : 33 (0) 4 67 14 91 19
>
> Website X-ray scattering facility ICG/IEM:
> http://www.iemm.univ-montp2.fr/xrayweb/main_uk.html
>
> ****************************************************************************
>



-- 
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 Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users

Reply via email to