Semantic Object 4

Layout scheme: Flocking

EXTERNPROTO semanticObject4 [

field MFFloat geoRange #[]
field MFFloat infoRange #[]
field MFNode geoLevel #[]
field MFNode infoLevel #[]
field SFBool hasLine
field SFBool constantSize
field SFBool periodicSize
field SFFloat anoscale
field SFBool clicktoHUD #FALSE
field SFBool clicktoOverlay #FALSE
field MFVec3f maxBoundingBox
field SFFloat obInfoOffset
# field SFFloat threshold

exposedField MFString link #["http://www.3dez.net"]
exposedField MFString parameter #[""]
exposedField SFVec3f position #0 0 0
exposedField SFRotation rotation #0 0 0 0
exposedField SFVec3f infoposition #2 1 0
exposedField SFColor linecolor #1 1 1

eventOut SFInt32 activegeoLevel
eventOut SFInt32 activeinfoLevel
eventOut SFFloat modulatedSpeed # not used yet

eventOut MFNode auxinfo

field SFVec3f positionF # 0 0 0
field SFVec3f goal #0 0 0
field SFFloat speed #1
field MFVec3f obstacles #[ ]
field SFInt32 index #0
field SFVec3f direction #0 0 1
field SFVec3f scale #1 1 1
field SFFloat turnLimit #1 # radians per second
eventIn SFVec3f set_goal
eventIn MFVec3f obstacles_changed
eventOut MFFloat report_position

]
["SemanticObj4.wrl"]

PROTO code here

Example Usage

So4_scene.wrl

Caveats :
this version has 2 limitations:

  • y values of the goal points are not registered properly
  • infopanel jumps to goal location when user navigates

We are still working to determine the ideal tunings and proper dynamics for the flocking behavior when used for information panels.


Notes

Must add TimeSensor and Script to drive interactions ie:

DEF SCRIPT Script {
eventIn SFTime beat
eventIn MFFloat update_position
eventOut MFVec3f chasers_moved
field MFVec3f chaserPositions [ ]
field SFInt32 numChasers 4
url "vrmlscript:

function initialize() {
chaserPositions = new MFVec3f();
}

function update_position(val) {
i = val[0];
x = val[1]; y = val[2]; z = val[3];
chaserPositions[i] = new SFVec3f(x, y, z);
}

function beat(val) {
chasers_moved = chaserPositions;
}

"
}

DEF SIMCLOCK TimeSensor { loop TRUE }

Also, must add ROUTES between all flock members ie:

ROUTE SIMCLOCK.time TO SCRIPT.beat

ROUTE s1.report_position TO SCRIPT.update_position
ROUTE s2.report_position TO SCRIPT.update_position
ROUTE s4.report_position TO SCRIPT.update_position
ROUTE s5.report_position TO SCRIPT.update_position

ROUTE SCRIPT.chasers_moved TO s1.obstacles_changed
ROUTE SCRIPT.chasers_moved TO s2.obstacles_changed
ROUTE SCRIPT.chasers_moved TO s4.obstacles_changed
ROUTE SCRIPT.chasers_moved TO s5.obstacles_changed

i