#VRML V2.0 utf8 WorldInfo { title "VRML: Capture The Flag world scene" info [ "Author: Doug Miller, Bill Bohman, Quay Jones, Tom Miller, Don Brutzman" "Script: pdu generator from java" "Purpose: Example providing DIS ESPDU interface for VRML entities" "Revised: 14 April 2002" "Browser: CosmoPlayer" ] } # this externproto is the "function prototype" for the EspduTransform # proto defined in the EspduTransform ########################################################################### # To use EspduReadTransform, include the following EXTERNPROTO definition: EXTERNPROTO EspduTransform [ # DIS ESPDU fields - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - eventOut SFTime timestamp # DIS timestamp in VRML units field SFString marking # 0..11 character label for entity field SFTime readInterval # seconds between read updates field SFTime writeInterval # seconds between write updates # readInterval=0.0 means no reading, # writeInterval=0.0 means no writing field SFString networkMode # "standAlone" | "networkReader" | "networkWriter" field SFString address # multicast address or "localhost" field SFInt32 port # port number field SFInt32 siteID # EntityID triplet, first element field SFInt32 applicationID # EntityID triplet, second element field SFInt32 entityID # EntityID triplet, third element # Standard VRML Transform fields - - - - - - - - - - - - - - - - - - - - - - - - - exposedField MFNode children exposedField SFVec3f translation # default prior to DIS update exposedField SFRotation rotation # default prior to DIS update exposedField SFVec3f scale exposedField SFRotation scaleOrientation field SFVec3f bboxCenter field SFVec3f bboxSize exposedField SFVec3f center eventIn MFNode addChildren eventIn MFNode removeChildren # Automatic MulticastRelayClient if no multicast heard - - - - - - - - - - - - - - field SFString multicastRelayHost field SFInt32 multicastRelayPort field SFBool rtpHeaderExpected # whether RTP headers are prepended to DIS eventOut SFBool rtpHeaderHeard # Collision/Fire PDU heard, or no active ESPDUs heard - - - - - - - - - - - - - - eventOut SFBool active # have we had an update recently? eventOut SFBool collided # has a CollisionPDU reported a collision? eventOut SFTime collideTime # when were we collided with? eventOut SFBool detonated # has a DetonationPDU reported a detonation? eventOut SFTime detonateTime # when were we detonated? eventOut SFBool fired1 # have we shot a Fire (weapon) PDU (primary)? eventOut SFBool fired2 # have we shot a Fire (weapon) PDU (secondary)? eventOut SFTime firedTime # when did we shoot a Fire (weapon) PDU? eventOut SFVec3f munitionStartPoint eventOut SFVec3f munitionEndPoint # Articulated Parameter (user-defined payload) fields - - - - - - - - - - - - - - - - - - - - - - eventOut SFInt32 articulationParameterCount # articulated parameters available eventOut SFFloat articulationParameterValue0 # user-defined payload value eventOut SFFloat articulationParameterValue1 # user-defined payload value eventOut SFFloat articulationParameterValue2 # user-defined payload value eventOut SFFloat articulationParameterValue3 # user-defined payload value eventOut SFFloat articulationParameterValue4 # user-defined payload value eventOut SFFloat articulationParameterValue5 # user-defined payload value eventOut SFFloat articulationParameterValue6 # user-defined payload value eventOut SFFloat articulationParameterValue7 # user-defined payload value eventOut SFFloat articulationParameterValue8 # user-defined payload value eventOut SFFloat articulationParameterValue9 # user-defined payload value eventOut SFFloat articulationParameterValue10 # user-defined payload value eventOut SFFloat articulationParameterValue11 # user-defined payload value eventOut SFFloat articulationParameterValue12 # user-defined payload value # Trace fields - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - exposedField SFColor traceColor # color of VRML trace text exposedField SFVec3f traceOffset # VRML text position relative to entity field SFFloat traceFontSize # VRML text scale field SFBool traceJava # Java console tracing enabled? ] [#"EspduTransformPROTO.wrl#EspduTransform" # local or remote URLs for the EXTERNPROTO "../../mil/navy/nps/dis/EspduTransformPROTO.wrl#EspduTransform" "file:///C|/vrtp/mil/navy/nps/dis/EspduTransformPROTO.wrl#EspduTransform" # default PC installation "file:///D|/vrtp/mil/navy/nps/dis/EspduTransformPROTO.wrl#EspduTransform" # default PC installation "http://web.nps.navy.mil/~brutzman/vrtp/mil/navy/nps/dis/EspduTransformPROTO.wrl#EspduTransform" "http://www.web3D.org/WorkingGroups/vrtp/mil/navy/nps/dis/EspduTransformPROTO.wrl#EspduTransform" ] ########################################################################### # Viewpoint discovery/debugging in VRML Console window # by Leonard Daly # http://www.realism.com/vrml/example.html#Viewpoints # http://www.realism.com/vrml/Example/WhereAmI/WhereAmI_Proto.wrl PROTO WhereAmI [] { DEF Where ProximitySensor { size 1000000000 1000000000 1000000000 # hey it's a big old world out there! } DEF WhereDump Script { eventIn SFVec3f position eventIn SFRotation orientation url "javascript: function position (value) { print ('Position (X,Y,Z) = ' + value[0] + ', ' + value[1] + ', ' + value[2]); } function orientation (value) { print ('Orientation (X,Y,Z,R) = ' + value[0] + ', ' + value[1] + ', ' + value[2] + ', ' + value[3]); } " } ROUTE Where.position_changed TO WhereDump.position ROUTE Where.orientation_changed TO WhereDump.orientation } # ### Comment/uncomment the following WhereAmI node to disable/enable this feature ### # ### WhereAmI {} ########################################################################### # This part of the code starts the world definition # The world in which we fly: Group { children [ Background { skyColor [ 1 1 .5, 0.0 0.2 0.7, 0.0 0.5 1.0, 1.0 1.0 1.0] skyAngle [ .05 1.309, 1.571] groundColor [0.0 0.0 0.0, 0.42 0.227 0.208, 0.2 0.11 0.1] groundAngle [1.57, 1.571] } NavigationInfo { type [ "EXAMINE", "FLY", "ANY"] speed 50.0 # m/s visibilityLimit 50000.0 # meters (45 Km x 55 Km field) avatarSize [.1, 1.6, 0.75] # unfortunately, (visibilityLimit / avatarSize[0]) > 10,000 } Viewpoint { description "High Above Airfields (looking East to West)" # position -2455 4000 2075 #mls # orientation 1 0 0 -1.571 #mls # revised position/orientation determined by enabling WhereAmI PROTO above position -2500, 1500, 6000 orientation -.9996220469474792, -0.020204812288284302, -0.01863904483616352, .35458293557167053 } Viewpoint { description "Red Airfield" position -4830 -38 2075 #mls orientation 0 1 0 1.571 #mls } Viewpoint { description "Red Tower view" position -5200 -20.0 1800 #mls orientation 0.0 1.0 0.0 3.927 #mls } Viewpoint { description "Blue Airfield" position -80 -34 2075 #mls orientation 0 1 0 -1.571 } Viewpoint { description "Blue Tower view" position 190 -19.0 2190 #mls orientation 0.0 1.0 0.0 0.785 } Inline { url "Flags.wrl"} # Flags. First red, then blue. Viewpoint { description "CAVE zoom-in (30 degree field of view, 1500m high)" position -2500, 1500, 6000 orientation -.9996220469474792, -0.020204812288284302, -0.01863904483616352, .35458293557167053 fieldOfView .503 } # Terrain info Inline { url "FortIrwinTerrain.wrl" } Inline { url "AllHelicopters.wrl" } Inline { url "AllTanks.wrl" } ########################################################################### # Viewpoint # { # description "trees" # position 1800.0 2.0 2075.0 # } #Tree info Inline { url "Da_trees.wrl"} # **************Red airfield Transform { translation 0.0 0.1 2000.0 #mls children LOD { range [1000.0, 2000.0] level [ # high detail Inline {url "closeairfield2.wrl"} #low detail Inline {url "farairfield2.wrl"} # no detail WorldInfo {} ] } } # **************Blue airfield Transform { translation -5000.0 0.1 2000.0 # mls rotation 0 1 0 3.142 # mls children LOD { range [1000.0, 2000.0] level [ # high detail Inline {url "closeairfield.wrl"} # low detail Inline {url "farairfield.wrl"} # no detail WorldInfo {} ] } } ########################################################################### Inline { url [ "nancyTeamAddRoutes.wrl" ] } # pick your teammates Inline { url "RedNancy.wrl" } Inline { url "AntennaWorldFortIrwin.wrl" } ] }