[x3d-public] Non-Hand Coding of X3D (John Carlson)

Joe D Williams joedwil at earthlink.net
Fri Feb 26 08:54:48 PST 2016


> If only there were animation templates?

Not a template, but I think a fair example representation why you 
might want to use some sort of template or parameterized prototype. 
Either way, for this stuff when documented in our essential 
human-readable text or whatever transcoding style, will always need 
great lists and graphs of names and events and paths. The more the 
design is to be reused, the more sense it makes to invest in 
abstractions to make it appear to be simple.

But maybe you just want a good style guide for doing the documentation 
of how those vertices are to be moved, and when.
What is the basic 'template' of a general authoring tool that exports 
timers and interpolators to X3D?

My guess? Don't worry, just keep it simple and show them one at a time 
in readable clear text for keeping track of. Later, the X3D user code 
might be edited for author convenience and clarity and to tune up the 
scene for realtime. .


OK, here is one that needs a good browser like BS to do (last I could 
check Octaga didn't do skin), but it is 100% by the current X3D hanim 
spec and is indicative of what any highend "CG"  tool does under their 
covers.

http://www.hypermultimedia.com/x3d/hanim/JoeH-AnimKick1a.x3dv

I intended this as a scriptless update to our beloved Seamless 
Boxman(1), he being the only example of a continious-mesh skin in 
there. Note that I depend upon the default texture mapping of IFS, so 
if the player doesn't provide, or if the player doesn't do skin, then 
maybe you won't see much.
Can you run this one? Please tell me if you cannot.

Here is a text version with a part of the animation text following

http://www.hypermultimedia.com/x3d/hanim/JoeH-AnimKick1a.txt

is a scene that uses several ROUTE statements

DEF Ex_Time TimeSensor { cycleInterval 3.73 loop TRUE }

# Ex_Animation Group

DEF r_ankleRotInterp OrientationInterpolator { key [ 0, 0.25 0.5, 0.75 
1 ]
keyValue [ -1 0 0 1, 0 0 1 0, 1 0 0 1, 1 0 0 1, 1 0 0 0.5 ] }
DEF r_kneeRotInterp OrientationInterpolator { key [ 0, 0.25 0.5, 0.75 
1 ]
keyValue [ 1 0 0 0.1, 0 0 1 0, 1 0 0 1, 1 0 0 1, 1 0 0 1.5 ] }
DEF r_hipRotInterp OrientationInterpolator { key [ 0, 0.25 0.5, 0.75 
1 ]
keyValue [ 1 0 0 1, 1 0 0 1, -1 0 0 1, -1 0 0 1, -1 0 0 1 ] }

DEF l_ankleRotInterp OrientationInterpolator { key [ 0, 0.25, 1 ]
keyValue [ -1 0 0 1, 0 0 1 0, 1 0 0 1 ] }
DEF l_kneeRotInterp OrientationInterpolator { key [ 0, 0.2 0.35 0.5 
1 ]
keyValue [ 1 0 0 1, 0 0 1 0, 0 0 1 0.2, 1 0 1 0.5, 1 0 0 1.4 ] }
DEF l_hipRotInterp OrientationInterpolator { key [ 0, 0.1 0.3, 0.45, 
1 ]
keyValue [ -1 0 0 1.5, -1 0 0 1, 0 0 1 0, 1 0 0 0.5, 1 0 0 1 ] }

DEF r_wristRotInterp OrientationInterpolator { key [ 0, 0.5, 0.7 1 ]
keyValue [ 0 1 0 0.3, 0 0 1 0, 0 0 -1 1, 0 -1 0 0.3 ] }
DEF r_elbowRotInterp OrientationInterpolator { key [ 0, 0.5, 1 ]
keyValue [ -1 0 0 3, -1 0 0 0.75, -1 -1 0 0.5 ] }
DEF r_shoulderRotInterp OrientationInterpolator { key [ 0, 0.5, 1 ]
keyValue [ 0 0 -1 2.5, 0 0 -1 1.5, 0 0 -1 1.75 ] }
DEF l_wristRotInterp OrientationInterpolator { key [ 0, 0.4, 0.8 1 ]
keyValue [ 0 0 1 0, 0 1 0 1.3, 0 -0.5 1 1.3, 0 0 1 0 ] }
DEF l_elbowRotInterp OrientationInterpolator { key [ 0, 0.5, 1 ]
keyValue [ -1 0 0 3, -1 0 0 0.75, -1 -1 0 0.5 ] }
DEF l_shoulderRotInterp OrientationInterpolator { key [ 0, 0.4, 1 ]
keyValue [ 0 0 1 0, 0 0 1 1.5, -1 0 1 1.75 ] }

DEF headRotInterp OrientationInterpolator { key [ 0, 0.2, 0.75, 1 ]
keyValue [ 0 -1 0 0.5, 0 0 1 0, 0 0 1 0, 0 1 0 0.35 ] }
DEF neckRotInterp OrientationInterpolator { key [ 0, 0.3, 0.4, 1 ]
keyValue [ 1 0 1 0.25, -1 0 -1 0.35, 1 0 0 0.75, 1 0 1 0.5 ] }

DEF lower_bodyRotInterp OrientationInterpolator { key [ 0, 0.5, 1 ]
keyValue [ 0 0 1 0, 0 0 1 0, 0 0 1 0 ] }
DEF upper_bodyRotInterp OrientationInterpolator { key [ 0, 0.5, 1 ]
keyValue [ 0 0 1 0, 0 0 1 0, 0 0 1 0 ] }

DEF whole_bodyRotInterp OrientationInterpolator { key [ 0, 0.1, 0.4, 
0.60, 1 ]
keyValue [ 1 0 0 0.5, 1 0 0 0.5, -1 0 0 0.1, -1 0 0 0.5, -1 0 0 
0.5 ] }
DEF whole_bodyTransInterp PositionInterpolator { key [ 0, 0.2, 0.6, 
1 ]
keyValue [ 1 0.3 -1, 0.4 -0.04 -0.4, -0.18 0.1 0 -0.2 0.15 0.15 ] }

# ex
ROUTE Ex_Time.fraction_changed TO r_ankleRotInterp.set_fraction
ROUTE Ex_Time.fraction_changed TO r_kneeRotInterp.set_fraction
ROUTE Ex_Time.fraction_changed TO r_hipRotInterp.set_fraction
ROUTE Ex_Time.fraction_changed TO l_ankleRotInterp.set_fraction
ROUTE Ex_Time.fraction_changed TO l_kneeRotInterp.set_fraction
ROUTE Ex_Time.fraction_changed TO l_hipRotInterp.set_fraction
ROUTE Ex_Time.fraction_changed TO lower_bodyRotInterp.set_fraction
ROUTE Ex_Time.fraction_changed TO r_wristRotInterp.set_fraction
ROUTE Ex_Time.fraction_changed TO r_elbowRotInterp.set_fraction
ROUTE Ex_Time.fraction_changed TO r_shoulderRotInterp.set_fraction
ROUTE Ex_Time.fraction_changed TO l_wristRotInterp.set_fraction
ROUTE Ex_Time.fraction_changed TO l_elbowRotInterp.set_fraction
ROUTE Ex_Time.fraction_changed TO l_shoulderRotInterp.set_fraction
ROUTE Ex_Time.fraction_changed TO headRotInterp.set_fraction
ROUTE Ex_Time.fraction_changed TO neckRotInterp.set_fraction
ROUTE Ex_Time.fraction_changed TO upper_bodyRotInterp.set_fraction
ROUTE Ex_Time.fraction_changed TO whole_bodyRotInterp.set_fraction
ROUTE Ex_Time.fraction_changed TO whole_bodyTransInterp.set_fraction

ROUTE r_ankleRotInterp.value_changed TO Joe_r_ankle.set_rotation
ROUTE r_kneeRotInterp.value_changed TO Joe_r_knee.set_rotation
ROUTE r_hipRotInterp.value_changed TO Joe_r_hip.set_rotation
ROUTE l_ankleRotInterp.value_changed TO Joe_l_ankle.set_rotation
ROUTE l_kneeRotInterp.value_changed TO Joe_l_knee.set_rotation
ROUTE l_hipRotInterp.value_changed TO Joe_l_hip.set_rotation
ROUTE lower_bodyRotInterp.value_changed TO Joe_sacroiliac.set_rotation
ROUTE r_wristRotInterp.value_changed TO Joe_r_wrist.set_rotation
ROUTE r_elbowRotInterp.value_changed TO Joe_r_elbow.set_rotation
ROUTE r_shoulderRotInterp.value_changed TO Joe_r_shoulder.set_rotation
ROUTE l_wristRotInterp.value_changed TO Joe_l_wrist.set_rotation
ROUTE l_elbowRotInterp.value_changed TO Joe_l_elbow.set_rotation
ROUTE l_shoulderRotInterp.value_changed TO Joe_l_shoulder.set_rotation
ROUTE headRotInterp.value_changed TO Joe_skullbase.set_rotation
ROUTE neckRotInterp.value_changed TO Joe_vc4.set_rotation
ROUTE upper_bodyRotInterp.value_changed TO Joe_vl1.set_rotation
ROUTE whole_bodyRotInterp.value_changed TO 
Joe_HumanoidRoot.set_rotation
ROUTE whole_bodyTransInterp.value_changed TO 
Joe_HumanoidRoot.set_translation
...


(1)(Boxman)
http://www.web3d.org/x3d/content/examples/Basic/HumanoidAnimation/index.html

Of course there are browser/player dependent issues so please tell me.

Thanks,
Joe







More information about the x3d-public mailing list