#VRML V2.0 utf8 ## ##:@+ nurb interpolation ##@ externnproto EXTERNPROTO NurbsPositionInterpolator [ eventIn SFFloat set_fraction eventIn MFFloat set_knot eventIn MFFloat set_order eventIn MFFloat set_keyValue exposedField SFBool fractionAbsolute exposedField MFFloat keyWeight field MFFloat knot field SFInt32 order field MFVec3f keyValue eventOut SFVec3f value_changed ] [ "urn:inet:blaxxun.com:node:NurbsPositionInterpolator", "nurbs.wrl#NurbsPositionInterpolator" # for local testing "http://www.blaxxun.com/vrml/protos/nurbs.wrl#NurbsPositionInterpolator" ] ##@ extern proto curve EXTERNPROTO NurbsCurve [ field MFFloat knot field SFInt32 order exposedField MFVec3f controlPoint exposedField MFFloat weight exposedField SFInt32 tessellation ] [ "urn:inet:blaxxun.com:node:NurbsCurve", "nurbs.wrl#NurbsCurve" # for local testing "http://www.blaxxun.com/vrml/protos/nurbs.wrl#NurbsCurve" ] ##@ transform root Transform { children [ Shape { appearance Appearance { material Material { diffuseColor 0 1 0 ambientIntensity 1 emissiveColor 1 0 0 } } geometry NurbsCurve { knot [0, 0, 0, .2, .4, .6, .8, 1, 1] tessellation 50 controlPoint [0 0 0, 1 1 0, 0 2 0, 2 3 0, -1 4 0, 5 5 0] } } ##@ interpolator DEF NurbsInt NurbsPositionInterpolator { knot[0, 0, 0, .2, .4, .6, .8, 1, 1] keyValue[0 0 0, 1 1 0, 0 2 0, 2 3 0, -1 4 0, 5 5 0] } DEF sphere Transform { children [ Shape { appearance Appearance { material Material { diffuseColor 0 1 0 emissiveColor 1 0 0 } } geometry Sphere {radius .1} } ] } ##@ timer and routing DEF spherets TimeSensor { loop TRUE cycleInterval 10 } ] } ROUTE spherets.fraction_changed TO NurbsInt.set_fraction ROUTE NurbsInt.value_changed TO sphere.set_translation ##