[NTG-context] U3D (embedded 3D objects)

Renaud AUBIN aubin at nibua-r.org
Wed Jul 26 01:30:01 CEST 2006


Hans Hagen a écrit :

>
>indeed pdfannot is what we need; however, the first thing is to figure out what kind of control we want (probably best from within javascript); in your sampe i see pretty raw pdf code in the key/val pairs, which is something alien to context 
>
>- what features make sense
>- what features do we expect to be stable 
>
>Hans 
>  
>
How to do that in the ConTeXt way ? ;) I have read spec-tpd.tex but
didn't know much...

Take care of the heart attack.... (I've done it the rookie way, reversed
from movie15)

\starttext

\xdef\uthreedfilename{pa10}

\pdfobj {<</Subtype/P/FOV 30/PS/Min>>}%
      \pdfrefobj\pdflastobj%
      %
      \pdfobj {<<%
        /MS/M% define the view as C2W matrix
        /CO 1200% orbital radius
        /P \the\pdflastobj\space 0 R%
        /C2W [-1.0 0.0 0.0 0.0 -1.0 0.0 0.0 0.0 1.0 0.000000000000000000
-600.000000000000000000 -3200.000000000000000000]%
        /XN(Default)% name of the view appearing in the drop down list
        /BG<</CS/DeviceRGB/C[1 1 1]>>%
      >>}\pdfrefobj\pdflastobj%
\xdef\defaultview{/3DV << /N \the\pdflastobj\space 0 R >>}

\pdfobj stream %
attr {%
  /Subtype/U3D/VA [\the\pdflastobj\space0 R] /DV/F%
}%
file {\uthreedfilename.u3d}%
\pdfrefobj\pdflastobj%
\xdef\iiidstream{\the\pdflastobj}

\pdfobj stream {}\pdfrefobj\pdflastobj%
\xdef\apdict{/AP << /N \the\pdflastobj\space 0 R >>}

\pdfannot width 200pt height 200pt depth 200pt {% don't know how to deal
with w,h and d !!!
          /Subtype/3D%
          /F 4% we cannot put F 5 here; bug in Reader; 3D annot would be
          /T (\uthreedfilename.u3d)%    disabled even if plugin were
available
          /Contents (3D Object (model/u3d))% mime type
          /NM (pa10)% label
          /P 0 0 R%
          \apdict%
          \defaultview%
          /3DI true%
          /3DD \iiidstream\space 0 R% 3D stream object
          /3DA << /A/PV/AIS/I/D/PI/DIS/I >>%
        }%

\stoptext
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.ntg.nl/pipermail/ntg-context/attachments/20060726/8e780d58/attachment.html 


More information about the ntg-context mailing list