media @ VU
web3d-x-nurb-anim.vr
web3d-x-nurb-anim.vr
(wrl
)
[ flux /
bitmanagement /
cortona /
octaga
]
Web3D/VR
animated nurb
scene
WorldInfo
{
title "Simple NurbsSurface"
info "NurbsSurface with CV-Animation"
}
NavigationInfo {
type ["EXAMINE","ANY"]
}
extern proto
EXTERNPROTO NurbsSurface [
field SFInt32 uDimension
field SFInt32 vDimension
field MFFloat uKnot
field MFFloat vKnot
field SFInt32 uOrder
field SFInt32 vOrder
exposedField MFVec3f controlPoint
exposedField MFFloat weight
exposedField SFInt32 uTessellation
exposedField SFInt32 vTessellation
exposedField SFNode texCoord
field SFBool ccw
field SFBool solid
]
[
"urn:inet:blaxxun.com:node:NurbsSurface",
"nurbs.wrl#NurbsSurface" # for local testing
"<a href=http://www.blaxxun.co>/vrml/protos/nurbs.wrl#NurbsSurface"
]
transform root
Transform {
translation -1.5 -1.5 0
children [
Shape {
geometry DEF nurb NurbsSurface {
uOrder 4
vOrder 4
uTessellation 50
uTessellation 51
uDimension 4
vDimension 4
controlPoint[ 0 0 0, 1 0 0, 2 0 0, 3 0 0,
0 1 0, 1 1 0, 2 1 0, 3 1 0,
0 2 0, 1 2 0, 2 2 0, 3 2 0,
0 3 0, 1 3 0, 2 3 0, 3 3 0]
}
appearance
appearance Appearance {
material Material {
diffuseColor 0 0 1
emissiveColor 1 0 0
}
texture ImageTexture {url "alchemy.gif"}
}
}
]
}
animation script
DEF animate Script {
eventIn SFFloat setTime
field SFNode nurb USE nurb
directOutput TRUE
url "javascript:
function setTime(value) {
nurb.controlPoint[3].z = 5*Math.sin(value*2*Math.PI);
nurb.controlPoint[10].z = 10*Math.sin(value*2*Math.PI);
nurb.controlPoint[14].z = 5*Math.sin(value*2*Math.PI);
}
"
}
routing
DEF TimeSource TimeSensor { cycleInterval 2.0 loop TRUE}
ROUTE TimeSource.fraction_changed TO animate.setTime
(C) A. Eliëns
21/5/2007
You may not copy or print any of this material without explicit permission of the author or the publisher.
In case of other copyright issues, contact the author.