Editing
Appendix/Ramblings/VirtualReality
(section)
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Clock== On 23 September 2019 I found, and downloaded from GitHub, a useful COLLADA file — [https://github.com/chinedufn/collada-dae-parser/tree/master/test/fixture animated-blender-cube.dae], developed by user "chinedufn" — that performs a simple animation of a cube. I successfully replaced the single, grey cube in chinedufn's model with my multi-colored "[[#Cube_Trio_by_a_Blender_Developer|cube trio]]" then, calling upon the skills that I had acquired by playing with the ''[[#AstroBoyWalk|astro_boy]]'' model, I used this modified animated-cube file to get more comfortable with COLLADA's animation instructions. With this improved understanding, I started from scratch and built a model of a clock entirely within the COLLADA language. This executable .dae file is presented immediately below as '''Example #8'''. This model works wonderfully when displayed by my Mac's Preview app. <table border="0" align="center" width="80%"> <tr><th align="center" colspan="2">Example #8 — Our Constructed Model of a Clock</th></tr> <tr><td align="left"> <div style="height: 400px; width: 700px; overflow: scroll;"> <pre> <?xml version="1.0" encoding="utf-8"?> <COLLADA xmlns="http://www.collada.org/2005/11/COLLADASchema" version="1.4.1"> <!-- On 23 September 2019 I copied the following cube-animation file from github: https://github.com/chinedufn/collada-dae-parser/blob/master/test/fixture/animated-blender-cube.dae I have made substantial modifications in order to better understand how the animation instructions actually work. THIS FILE NAME: Dropbox/3Dviewers/Clock/Arrow07.PERFECT.dae It uses "polylist" and correct implementation of "normals" for all polygons of the Clock. It also displays **two** clocks: [Initially, we made one spin and the other not.] It also adds a red "minute hand" to the clock; now, this is the only segment that spins. --> <asset> <contributor> <author>jet53man</author> <authoring_tool>Raw XML</authoring_tool> </contributor> <created>2019-09-24</created> <modified>2019-09-29</modified> <unit name="meter" meter="1"/> <up_axis>Z_UP</up_axis> </asset> <library_images/> <library_effects> <effect id="ID5"> <profile_COMMON> <technique sid="COMMON"> <lambert> <diffuse> <color>0 0 1 1</color> </diffuse> </lambert> </technique> </profile_COMMON> </effect> <effect id="InnerID5"> <profile_COMMON> <technique sid="COMMON"> <lambert> <diffuse> <color>0.4 0.0 0.7 0.4</color> </diffuse> </lambert> </technique> </profile_COMMON> </effect> <effect id="ArrowID5"> <profile_COMMON> <technique sid="COMMON"> <lambert> <diffuse> <color>1.0 0.0 0.0 1.0</color> </diffuse> </lambert> </technique> </profile_COMMON> </effect> </library_effects> <library_materials> <material id="ID6" name="material"> <instance_effect url="#ID5" /> </material> <material id="InnerID6" name="Inner_material"> <instance_effect url="#InnerID5" /> </material> <material id="ArrowID6" name="Arrow_material"> <instance_effect url="#ArrowID5" /> </material> </library_materials> <library_nodes> <node id="ID3" name="cube_component"> <instance_geometry url="#Clock_OuterEdge"> <bind_material> <technique_common> <instance_material symbol="Material2" target="#ID6"> <bind_vertex_input semantic="UVSET0" input_semantic="TEXCOORD" input_set="0" /> </instance_material> </technique_common> </bind_material> </instance_geometry> <instance_geometry url="#Clock_InnerEdge"> <bind_material> <technique_common> <instance_material symbol="Material2" target="#InnerID6"> <bind_vertex_input semantic="UVSET0" input_semantic="TEXCOORD" input_set="0" /> </instance_material> </technique_common> </bind_material> </instance_geometry> </node> <node id="ArrowID3" name="cube_component"> <instance_geometry url="#Clock_ArrowEdge"> <bind_material> <technique_common> <instance_material symbol="Material2" target="#ArrowID6"> <bind_vertex_input semantic="UVSET0" input_semantic="TEXCOORD" input_set="0" /> </instance_material> </technique_common> </bind_material> </instance_geometry> </node> </library_nodes> <library_geometries> <geometry id="Clock_OuterEdge"> <mesh> <!-- ********************************************** * * Insert first portion of clock's structure * ********************************************** --> <source id="Clock_Positions"> <float_array id="Coordinates01" count="123"> 0.0 1.0 0.2 1.0 1.0 0.2 1.0 0.0 0.2 1.0 -1.0 0.2 0.0 -1.0 0.2 -1.0 -1.0 0.2 -1.0 0.0 0.2 -1.0 1.0 0.2 0.0 1.0 -0.2 1.0 1.0 -0.2 1.0 0.0 -0.2 1.0 -1.0 -0.2 0.0 -1.0 -0.2 -1.0 -1.0 -0.2 -1.0 0.0 -0.2 -1.0 1.0 -0.2 0.9 0.0 0.2 0.779423 0.45 0.2 0.45 0.779423 0.2 0.0 0.9 0.2 -0.45 0.779423 0.2 -0.779423 0.45 0.2 -0.9 0.0 0.2 -0.779423 -0.45 0.2 -0.45 -0.779423 0.2 0.0 -0.9 0.2 0.45 -0.779423 0.2 0.779423 -0.45 0.2 -0.9 0.0 -0.2 -0.779423 0.45 -0.2 -0.45 0.779423 -0.2 -0.0 0.9 -0.2 0.45 0.779423 -0.2 0.779423 0.45 -0.2 0.9 0.0 -0.2 0.779423 -0.45 -0.2 0.45 -0.779423 -0.2 -0.0 -0.9 -0.2 -0.45 -0.779423 -0.2 -0.779423 -0.45 -0.2 0.0 0.0 -0.2</float_array> <technique_common> <accessor source="#Coordinates01" count="41" stride="3"> <param name="X" type="float" /> <param name="Y" type="float" /> <param name="Z" type="float" /> </accessor> </technique_common> </source> <source id="Clock_Normals"> <float_array id="InnerNormals01" count="18"> 1.0 0.0 0.0 -1.0 0.0 0.0 0.0 1.0 0.0 0.0 -1.0 0.0 0.0 0.0 1.0 0.0 0.0 -1.0 </float_array> <technique_common> <accessor source="#Normals01" count="6" stride="3"> <param name="X" type="float" /> <param name="Y" type="float" /> <param name="Z" type="float" /> </accessor> </technique_common> </source> <vertices id="Clock_Vertices"> <input semantic="POSITION" source="#Clock_Positions" /> </vertices> <polylist count="56" material="Material2"> <input semantic="VERTEX" source="#Clock_Vertices" offset="0" /> <input semantic="NORMAL" source="#Clock_Normals" offset="1" /> <vcount> 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3</vcount> <p> 0 2 1 2 8 2 1 2 9 2 8 2 7 2 0 2 15 2 0 2 8 2 15 2 1 0 2 0 9 0 2 0 10 0 9 0 2 0 3 0 10 0 3 0 11 0 10 0 3 3 4 3 11 3 4 3 12 3 11 3 4 3 5 3 12 3 5 3 13 3 12 3 5 1 6 1 13 1 6 1 14 1 13 1 6 1 7 1 14 1 7 1 15 1 14 1 2 4 17 4 16 4 2 4 1 4 17 4 1 4 18 4 17 4 1 4 0 4 18 4 0 4 19 4 18 4 0 4 20 4 19 4 0 4 7 4 20 4 7 4 21 4 20 4 7 4 6 4 21 4 6 4 22 4 21 4 6 4 23 4 22 4 6 4 5 4 23 4 5 4 24 4 23 4 5 4 4 4 24 4 4 4 25 4 24 4 4 4 26 4 25 4 4 4 3 4 26 4 3 4 27 4 26 4 3 4 2 4 27 4 2 4 16 4 27 4 14 5 29 5 28 5 14 5 15 5 29 5 15 5 30 5 29 5 15 5 8 5 30 5 8 5 31 5 30 5 8 5 32 5 31 5 8 5 9 5 32 5 9 5 33 5 32 5 9 5 10 5 33 5 10 5 34 5 33 5 10 5 35 5 34 5 10 5 11 5 35 5 11 5 36 5 35 5 11 5 12 5 36 5 12 5 37 5 36 5 12 5 38 5 37 5 12 5 13 5 38 5 13 5 39 5 38 5 13 5 14 5 39 5 14 5 28 5 39 5 </p> </polylist> </mesh> </geometry> <geometry id="Clock_InnerEdge"> <mesh> <!-- ********************************************** * * Insert second portion of clock's structure * ********************************************** --> <source id="Clock_InnerPositions"> <float_array id="InnerCoordinates01" count="123"> 0.0 1.0 0.2 1.0 1.0 0.2 1.0 0.0 0.2 1.0 -1.0 0.2 0.0 -1.0 0.2 -1.0 -1.0 0.2 -1.0 0.0 0.2 -1.0 1.0 0.2 0.0 1.0 -0.2 1.0 1.0 -0.2 1.0 0.0 -0.2 1.0 -1.0 -0.2 0.0 -1.0 -0.2 -1.0 -1.0 -0.2 -1.0 0.0 -0.2 -1.0 1.0 -0.2 0.9 0.0 0.2 0.779423 0.45 0.2 0.45 0.779423 0.2 0.0 0.9 0.2 -0.45 0.779423 0.2 -0.779423 0.45 0.2 -0.9 0.0 0.2 -0.779423 -0.45 0.2 -0.45 -0.779423 0.2 0.0 -0.9 0.2 0.45 -0.779423 0.2 0.779423 -0.45 0.2 -0.9 0.0 -0.2 -0.779423 0.45 -0.2 -0.45 0.779423 -0.2 -0.0 0.9 -0.2 0.45 0.779423 -0.2 0.779423 0.45 -0.2 0.9 0.0 -0.2 0.779423 -0.45 -0.2 0.45 -0.779423 -0.2 -0.0 -0.9 -0.2 -0.45 -0.779423 -0.2 -0.779423 -0.45 -0.2 0.0 0.0 -0.2</float_array> <technique_common> <accessor source="#InnerCoordinates01" count="41" stride="3"> <param name="X" type="float" /> <param name="Y" type="float" /> <param name="Z" type="float" /> </accessor> </technique_common> </source> <source id="Clock_InnerNormals"> <float_array id="InnerNormals01" count="54"> 1.0 0.0 0.0 -1.0 0.0 0.0 0.0 1.0 0.0 0.0 -1.0 0.0 0.0 0.0 1.0 0.0 0.0 -1.0 -0.965926 -0.258819 0.0 -0.707107 -0.707107 0.0 -0.258819 -0.965926 0.0 0.258819 -0.965926 0.0 0.707107 -0.707107 0.0 0.965926 -0.258819 0.0 0.965926 0.258819 0.0 0.707107 0.707107 0.0 0.258819 0.965926 0.0 -0.258819 0.965926 0.0 -0.707107 0.707107 0.0 -0.965926 0.258819 0.0 </float_array> <technique_common> <accessor source="#InnerNormals01" count="18" stride="3"> <param name="X" type="float" /> <param name="Y" type="float" /> <param name="Z" type="float" /> </accessor> </technique_common> </source> <vertices id="Clock_InnerVertices"> <input semantic="POSITION" source="#Clock_InnerPositions" /> </vertices> <polylist count="24" material="Material2"> <input semantic="VERTEX" source="#Clock_InnerVertices" offset="0" /> <input semantic="NORMAL" source="#Clock_InnerNormals" offset="1"/> <vcount>4 4 4 4 4 4 4 4 4 4 4 4 3 3 3 3 3 3 3 3 3 3 3 3</vcount> <p> 16 6 17 6 33 6 34 6 17 7 18 7 32 7 33 7 18 8 19 8 31 8 32 8 19 9 20 9 30 9 31 9 20 10 21 10 29 10 30 10 21 11 22 11 28 11 29 11 22 12 23 12 39 12 28 12 23 13 24 13 38 13 39 13 24 14 25 14 37 14 38 14 25 15 26 15 36 15 37 15 26 16 27 16 35 16 36 16 27 17 16 17 34 17 35 17 28 5 29 5 40 5 29 5 30 5 40 5 30 5 31 5 40 5 31 5 32 5 40 5 32 5 33 5 40 5 33 5 34 5 40 5 34 5 35 5 40 5 35 5 36 5 40 5 36 5 37 5 40 5 37 5 38 5 40 5 38 5 39 5 40 5 39 5 28 5 40 5 </p> </polylist> </mesh> </geometry> <geometry id="Clock_ArrowEdge"> <mesh> <!-- ********************************************** * * Insert arrow portion of clock's structure * ********************************************** --> <source id="Clock_ArrowPositions"> <float_array id="ArrowCoordinates01" count="30"> 0.0 0.85 0.25 0.1 0.0 0.25 0.0 -0.2 0.25 -0.1 0.0 0.25 0.0 0.85 0.05 0.1 0.0 0.05 0.0 -0.2 0.05 -0.1 0.0 0.05 0.0 0.0 0.25 0.0 0.0 0.05 </float_array> <technique_common> <accessor source="#ArrowCoordinates01" count="10" stride="3"> <param name="X" type="float" /> <param name="Y" type="float" /> <param name="Z" type="float" /> </accessor> </technique_common> </source> <source id="Clock_ArrowNormals"> <float_array id="ArrowNormals01" count="18"> 0 0 1 0 0 -1 0.993151 0.116841 0.0 0.447214 -0.894427 0.0 -0.447214 -0.894427 0.0 -0.993151 0.116841 0.0 </float_array> <technique_common> <accessor source="#ArrowNormals01" count="6" stride="3"> <param name="X" type="float" /> <param name="Y" type="float" /> <param name="Z" type="float" /> </accessor> </technique_common> </source> <vertices id="Clock_ArrowVertices"> <input semantic="POSITION" source="#Clock_ArrowPositions" /> </vertices> <polylist count="12" material="Material2"> <input semantic="VERTEX" source="#Clock_ArrowVertices" offset="0" /> <input semantic="NORMAL" source="#Clock_ArrowNormals" offset="1"/> <vcount>3 3 3 3 3 3 3 3 4 4 4 4</vcount> <p> 0 0 8 0 1 0 1 0 8 0 2 0 2 0 8 0 3 0 3 0 8 0 0 0 4 1 5 1 9 1 5 1 6 1 9 1 6 1 7 1 9 1 7 1 4 1 9 1 0 2 1 2 5 2 4 2 1 3 2 3 6 3 5 3 2 4 3 4 7 4 6 4 3 5 0 5 4 5 7 5 </p> </polylist> </mesh> </geometry> </library_geometries> <library_animations> <animation id="Cube_rotation_euler_Z"> <source id="Cube_rotation_euler_Z-input"> <!-- <float_array id="Cube_rotation_euler_Z-input-array" count="5">0 0.2083333 0.4166666 0.625 0.8333333</float_array> --> <!-- <float_array id="Cube_rotation_euler_Z-input-array" count="5">0 0.4167 0.8333 1.25 1.666</float_array> --> <float_array id="Cube_rotation_euler_Z-input-array" count="17">0 0.25 0.5 0.75 1.0 1.25 1.5 1.75 2.0 2.25 2.5 2.75 3.0 3.25 3.5 3.75 4.0</float_array> <technique_common> <accessor source="#Cube_rotation_euler_Z-input-array" count="5" stride="1"> <param name="TIME" type="float"/> </accessor> </technique_common> </source> <source id="Cube_rotation_euler_Z-output"> <!-- <float_array id="Cube_rotation_euler_Z-output-array" count="5">0 -22.5 -45 -67.5 -90</float_array> --> <float_array id="Cube_rotation_euler_Z-output-array" count="17">0 -22.5 -45 -67.5 -90 -112.5 -135.0 -157.5 -180.0 -202.5 -225.0 -247.5 -270.0 -292.5 -315.0 -337.5 -360.0</float_array> <technique_common> <accessor source="#Cube_rotation_euler_Z-output-array" count="5" stride="1"> <param name="ANGLE" type="float"/> </accessor> </technique_common> </source> <sampler id="Cube_rotation_euler_Z-sampler"> <input semantic="INPUT" source="#Cube_rotation_euler_Z-input"/> <input semantic="OUTPUT" source="#Cube_rotation_euler_Z-output"/> </sampler> <channel source="#Cube_rotation_euler_Z-sampler" target="jetman/rotationZ.ANGLE"/> </animation> <animation id="Cube_scale_Z"> <source id="Cube_scale_Z-input"> <!-- <float_array id="Cube_scale_Z-input-array" count="5">0 0.2083333 0.4166666 0.625 0.8333333</float_array> --> <float_array id="Cube_scale_Z-input-array" count="5">0 0.0694 0.1389 0.2083 0.2778</float_array> <technique_common> <accessor source="#Cube_scale_Z-input-array" count="5" stride="1"> <param name="TIME" type="float"/> </accessor> </technique_common> </source> <source id="Cube_scale_Z-output"> <!-- <float_array id="Cube_scale_Z-output-array" count="5">0.5 0.4 0.3 0.2 0.1</float_array> --> <float_array id="Cube_scale_Z-output-array" count="5">1.0 1.0 1.0 1.0 1.0</float_array> <technique_common> <accessor source="#Cube_scale_Z-output-array" count="5" stride="1"> <param name="Z" type="float"/> </accessor> </technique_common> </source> <sampler id="Cube_scale_Z-sampler"> <input semantic="INPUT" source="#Cube_scale_Z-input"/> <input semantic="OUTPUT" source="#Cube_scale_Z-output"/> </sampler> <channel source="#Cube_scale_Z-sampler" target="jetman/scale.Z"/> </animation> </library_animations> <library_controllers/> <library_visual_scenes> <visual_scene id="EntireLayout"> <!-- *********** * * Evidently, it is important for the "id" of this node to be shared * with the "directory" name that is used in the animation "channel" * instructions. For example, "jetman" is used here. * *********** --> <node id="TwoClocks"> <node id="firstclock" name="instance_1"> <translate>0.0 1.0 0.0</translate> <rotate sid="rotationX">1 0 0 90</rotate> <rotate sid="rotationZ">0 0 1 0</rotate> <!-- <rotate sid="rotationY">0 1 0 90</rotate> --> <scale sid="scale">1 1 1</scale> <instance_node url="#ID3" /> </node> <node id="jetman" name="instance_Arrow"> <translate>0.0 1.0 0.0</translate> <rotate sid="rotationX">1 0 0 90</rotate> <rotate sid="rotationZ">0 0 1 0</rotate> <!-- <rotate sid="rotationY">0 1 0 90</rotate> --> <scale sid="scale">1 1 1</scale> <instance_node url="#ArrowID3" /> </node> <extra> <technique profile="FCOLLADA"> <start_time>0</start_time> <end_time>4.0</end_time> </technique> </extra> <node id="secondClock" name="instance_2"> <translate>10.0 0.0 0.0</translate> <!-- <rotate sid="rotationZ">0 0 1 90</rotate> --> <rotate sid="rotationX">1 0 0 90</rotate> <rotate sid="rotationY">0 1 0 -90</rotate> <scale sid="scale">1 1 1</scale> <instance_node url="#ID3" /> </node> </node> </visual_scene> </library_visual_scenes> <scene> <instance_visual_scene url="#EntireLayout" /> </scene> </COLLADA> </pre> </div> </td> <td align="center" bgcolor="lightgrey">[[File:Clock.png|250px|Clock]]</td> </tr></table>
Summary:
Please note that all contributions to JETohlineWiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
JETohlineWiki:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Log in
Namespaces
Page
Discussion
English
Views
Read
Edit
View history
More
Search
Navigation
Main page
Tiled Menu
Table of Contents
Old (VisTrails) Cover
Appendices
Variables & Parameters
Key Equations
Special Functions
Permissions
Formats
References
lsuPhys
Ramblings
Uploaded Images
Originals
Recent changes
Random page
Help about MediaWiki
Tools
What links here
Related changes
Special pages
Page information