Process SMIL directives in XML data: Difference between revisions
m (→{{header|OCaml}}: corrected link (title policy)) |
(wordliness) |
||
Line 1:
{{draft task}}
<!-- {{task|3D}} -->
One very common task in OpenGL is to
* X3D: [[wp:X3D|on Wikipedia]] / [http://www.web3d.org/x3d/specifications/ISO-IEC-19776-1.2-X3DEncodings-XML/Part01/X3D_XML.html SPECS of the XML form] / [http://www.web3d.org/x3d/specifications/ISO-IEC-19776-1.2-X3DEncodings-XML/Part01/examples.html Examples]
Line 48:
</Scene>
</X3D></smil></lang>
Try to make it possible to insert "animate" tags for animating every attribute of the base file.▼
In the example file, there is only a <Box> primitive, try to implement the primitives below too:
Line 58 ⟶ 56:
If you are in shape, try to implement the <seq> tag too ([http://www.w3.org/TR/SMIL/smil-timing.html#edef-seq def], [http://www.w3.org/TR/SMIL/smil-timing.html#q175 ex.]), we could for example put successivelly a Box, a Sphere, a Cone into it.
▲
'''Warnings:'''
*
*
|
Revision as of 21:52, 12 July 2011
One very common task in OpenGL is to obtain data from a file containing geometric data and supplementary information, such as animation data. The task is to obtain data from a given file and place into appropriately organized X3D data structures. The Smil animation statements found within the file should be stored in an XML record, because X3D data structures are not supposed to contain Smil data.
- X3D: on Wikipedia / SPECS of the XML form / Examples
- Smil: on Wikipedia / SPECS / Examples
Here is the pure X3D base of our file containing only geometry:
<lang xml><?xml version="1.0" ?> <X3D>
<Scene> <Viewpoint position="0 0 8" orientation="0 0 1 0"/> <PointLight color='1 1 1' location='0 2 0'/> <Transform translation='0.0 0.0 0.0' scale='1 1 1'> <Shape> <Box size='2 1 2'/> <Appearance> <Material diffuseColor='0.0 0.6 1.0'/> </Appearance> </Shape> </Transform> </Scene>
</X3D></lang>
And here is the same data with additional Smil statments that you should load, display and animate with OpenGL (or something else):
<lang xml><?xml version="1.0" ?> <smil> <X3D>
<Scene> <Viewpoint position="0 0 8" orientation="0 0 1 0"/> <PointLight color='1 1 1' location='0 2 0'/> <Transform translation='0.0 0.0 0.0' scale='1 1 1'> <Shape> <Box size='2 1 2'> <animate attributeName="size" from="2 1 2" to="1 2 1" begin="0s" dur="10s"/> </Box> <Appearance> <Material diffuseColor='0.0 0.6 1.0'> <animate attributeName="diffuseColor" from="0.0 0.6 1.0" to="1.0 0.4 0.0" begin="0s" dur="10s"/> </Material> </Appearance> </Shape> </Transform> </Scene>
</X3D></smil></lang>
In the example file, there is only a <Box> primitive, try to implement the primitives below too: <lang xml> <Sphere radius="1"/>
<Cylinder radius="1" height="2"/> <Cone bottomRadius="1" height="2"/></lang>
If you are in shape, try to implement the <seq> tag too (def, ex.), we could for example put successivelly a Box, a Sphere, a Cone into it.
It should be possible to insert "animate" tags against every attribute of the base file and it is important to be able to insert timelines into the data structure.
Warnings:
- This task is a draft, you can modify it if you find a way to enhance it,
- The coordinates in the X3D data are not important. For example, the provided box data may not be positioned centrally to the viewpoint, Please fix this if you can.