extern
EXTERNPROTO MultiTexture [
exposedField MFString mode
exposedField MFNode texture
exposedField MFNode textureTransform
exposedField MFInt32 textureOp
]
[ "urn:inet:blaxxun.com:node:MultiTexture" "<a href=http://www.blaxxun.co>/vrml/protos/nodes.wrl#MultiTexture" ]
EXTERNPROTO Particles[
exposedField SFVec3f bboxSize
exposedField SFVec3f bboxCenter
exposedField SFFloat lodRange
exposedField SFBool enabled
exposedField SFFloat particleRadius
exposedField SFFloat particleRadiusVariation
exposedField SFFloat particleRadiusRate
exposedField SFNode geometry
exposedField SFVec3f emitterPosition
exposedField SFFloat emitterRadius
exposedField SFFloat emitterSpread
exposedField SFVec3f emitVelocity
exposedField SFFloat emitVelocityVariation
exposedField SFRotation emitterOrientation
exposedField SFFloat creationRate
exposedField SFFloat creationRateVariation
exposedField SFInt32 maxParticles
exposedField SFTime maxLifeTime
exposedField SFFloat maxLifeTimeVariation
exposedField SFVec3f gravity
exposedField SFVec3f acceleration
exposedField SFColor emitColor
exposedField SFColor fadeColor
exposedField SFFloat fadeAlpha
exposedField SFFloat fadeRate
exposedField SFInt32 numTrails
exposedField SFInt32 numSparks
exposedField SFVec3f sparkGravity
exposedField SFColor sparkFadeColor
]
["urn:inet:blaxxun.com:node:Particles","<a href=http://www.blaxxun.co>/vrml/protos/nodes.wrl#Particles","nodes.wrl#Particles"]
EXTERNPROTO DrawGroup[
exposedField SFVec3f bboxSize
exposedField SFVec3f bboxCenter
exposedField SFBool sortedAlpha
exposedField MFNode drawOp
exposedField MFNode children
eventIn MFNode addChildren
eventIn MFNode removeChildren
]
["urn:inet:blaxxun.com:node:DrawGroup","<a href=http://www.blaxxun.co>/vrml/protos/nodes.wrl#DrawGroup","nodes.wrl#DrawGroup"]
DEF _1 PointLight {
color 1 0.05 0.05
on FALSE
location 0 2 0
}
WorldInfo {
info "Contact 5.0 Particle system test"
title "Particles"
}
DEF _2 NavigationInfo {visibilityLimit 200}
DEF TS TimeSensor {
cycleInterval 10
enabled TRUE
loop TRUE
}
DEF _3 Viewpoint {
fieldOfView 1
position 0 2.75 70
description "Entry"
}
DEF Background Background {
skyColor 0 0 0
}
DEF Objects Switch {
whichChoice -1
choice [
DEF PS Particles {
bboxSize -1 -1 -1
lodRange 0
particleRadius 0.55
particleRadiusVariation 1.4
particleRadiusRate 3
emitterPosition 0 2 0
emitterRadius 0
emitterSpread 0.342724
emitVelocity 15 25 15
emitVelocityVariation 1
creationRate 10
maxParticles 100
maxLifeTime 4
gravity 0 10 0
emitColor 0 1 0.781729
fadeColor 1 1 0.5
fadeAlpha 0
fadeRate 0.25
numTrails 0
numSparks 0
},
DEF PS-S Shape {
appearance Appearance {texture
DEF M1 MultiTexture {
#color TRUE
mode [ "MODULATE"
# "COMPLEMENT_MODULATE"
] #COMPLEMENT_MODULATE
texture [
DEF M1 MovieTexture {
url "local/clips/effects/balls.wmv"
repeatS FALSE repeatT FALSE
loop TRUE
repeatS FALSE
repeatT FALSE
}
# DEF PS-TEX ImageTexture {
# url "logo.jpg"
# repeatS FALSE
# repeatT FALSE
# }
]
}
}
geometry USE PS
},
DEF PS2 Transform {
translation 0 10 0
rotation 1 0 0 1.7
children [
Transform {
translation -5 0 4
children USE PS-S
},
Transform {
translation 7 0 -8
children USE PS-S
},
Transform {
translation 2 0 15
children USE PS-S
}
]
}
]
}
DrawGroup {
sortedAlpha TRUE
children [
DEF Mirror-SW Switch {
whichChoice -2
choice DEF Mirror Transform {
scale 1 -1 1
children USE PS2
}
},
DEF Shadow-SW Switch {
whichChoice -1
choice DEF Shadow Transform {
scale 1 0 1
children Shape {
appearance Appearance {material Material {
diffuseColor 0 0 0
emissiveColor 0.5 0.5 0.5
transparency 0.5
}}
geometry USE PS
}
}
},
DEF PS-T Transform {
children USE PS2
}
]
}
DEF PS-translation PositionInterpolator {keyValue [0 0 0,0 0 0]}
DEF PS-rate ScalarInterpolator {keyValue [
50,100,80,10,50]}
DEF PS-spread ScalarInterpolator {keyValue [
0.25,0.35,0.3,0.1,
0.25]}
DEF PS-color ColorInterpolator {keyValue [1 0 0,0 0 1,1 0 1,1 0 0]}
DEF Controller Script {
eventIn SFColor color
field SFNode background USE Background
url "javascript:
function color (c) {
f=0.4;
background.skyColor[0] = new SFColor(f*(1.0-c.r),f*(1.0-c.g),f*(1.0-c.b));
}
"
}
DEF Viewpoint2 Viewpoint {
fieldOfView 1.5708
orientation 0 1 0 0.0671873
position 0.325514 2.75 25.5818
description "Viewpoint2"
}
DEF Viewpoint3 Viewpoint {
fieldOfView 2.96706
orientation 0 1 0 0.0681525
position 3.77006 2.75 69.8829
description "Viewpoint3"
}
DEF Viewpoint4 Viewpoint {
fieldOfView 1.32913
orientation 0.104288 -0.990171 -0.0931975 3.04577
position -1.02878 9.08635 -11.1508
description "Viewpoint4"
}
DEF Viewpoint5 Viewpoint {
fieldOfView 1.25635
orientation 0.101163 -0.99079 -0.0900092 3.1008
position 2.83966 9.08635 31.491
description "Viewpoint5"
}
ROUTE TS.fraction TO PS-rate.fraction
#ROUTE PS-rate.value TO PS.set_creationRate
ROUTE TS.fraction TO PS-spread.fraction
ROUTE PS-spread.value TO PS.set_emitterSpread
ROUTE TS.fraction TO PS-color.fraction
ROUTE PS-color.value TO PS.set_emitColor
#ROUTE PS-color.value TO Controller.color
# VRML absolute time
# startup timer
DEF initTS TimeSensor {
cycleInterval 0.1
loop TRUE
}
# start videos
ROUTE initTS.cycleTime TO M1.set_startTime
# stop the startup timer
ROUTE initTS.cycleTime TO initTS.set_stopTime