#VRML V2.0 utf8
# X3D-to-VRML-97 XSL translation autogenerated by X3dToVrml97.xslt
# https://www.web3d.org/x3d/content/X3dToVrml97.xslt
# Generated using XSLT processor: Saxonica
# [X3D] VRML V3.3 utf8
# PROFILE Immersive
# [X3D] version=3.3
# [X3D] noNamespaceSchemaLocation=https://www.web3d.org/specifications/x3d-3.3.xsd
# [head]
# META "title" "CameraExamples.x3d"
# META "description" "Camera, CameraShot and CameraMove examples that demonstrate storyboard capabilities and precise camera operation. This is a developmental effort for potential X3D Specification improvement."
# META "documentation" "Two demos are found in the scene, click the \"red text\" on left or right to start. (a) SimpleShotsTest shows Zoom in/out, Pan left/right, Boom up/down, Tilt left/right, with each is defined by a CameraShot collecting a series of CameraMovements. (b) AimPointTest gradually slews the camera view to look at the sliding cube, then follows it around before returning to original viewpoint."
# META "creator" "Don Brutzman and Jeff Weekley"
# META "created" "18 June 2009"
# META "modified" "20 January 2020"
# META "TODO" "Schematron rules, backed up by initialize() checks"
# META "reference" "BeyondViewpointCameraNodesWeb3D2009.pdf"
# META "MovingImage" "CameraExamplesDemo.mp4"
# META "reference" "https://www.web3d.org/x3d/specifications/ISO-IEC-FDIS-19775-1.2-X3D-AbstractSpecification/Part01/components/navigation.html"
# META "subject" "Camera nodes for Viewpoint navigation control"
# META "reference" "CameraPrototypes.x3d"
# META "reference" "CameraExamplesConsoleLog.txt"
# META "reference" "http://sourceforge.net/p/x3d/code/HEAD/tree/www.web3d.org/x3d/content/examples/Basic/development/CameraExamples.avi"
# META "reference" "https://www.web3d.org/x3d/content/examples/Basic/UniversalMediaMaterials/gridBack.x3d"
# META "identifier" "https://www.web3d.org/x3d/content/examples/Basic/development/CameraExamples.x3d"
# META "reference" "http://sourceforge.net/p/x3d/code/HEAD/tree/www.web3d.org/x3d/content/examples/Basic/development/CameraExamples.x3d"
# META "generator" "X3D-Edit 3.3, https://savage.nps.edu/X3D-Edit"
# META "license" "../license.html"
EXTERNPROTO BooleanFilter [
# [appinfo] Selectively pass only true or false events.
eventIn SFBool set_boolean # [appinfo] set_boolean is the input value to be filtered.
eventOut SFBool inputTrue # [appinfo] inputTrue only passes a true value, when set_boolean input is true.
eventOut SFBool inputFalse # [appinfo] inputFalse only passes a false value, when set_boolean is false.
eventOut SFBool inputNegate # [appinfo] inputNegate provides opposite value by negating set_boolean input.
][
# "EventUtilityPrototypes.wrl#BooleanFilter"
"https://www.web3d.org/x3d/content/examples/Basic/development/EventUtilityPrototypes.wrl#BooleanFilter"
# "EventUtilityPrototypes.x3d#BooleanFilter"
"https://www.web3d.org/x3d/content/examples/Basic/development/EventUtilityPrototypes.x3d#BooleanFilter"
]
EXTERNPROTO BooleanToggle [
# [appinfo] Negate or reset prior boolean state, output result.
eventIn SFBool set_boolean # [appinfo] If set_boolean input is true, toggle state.
eventIn SFBool set_toggle
field SFBool toggle # [appinfo] Persistent state value that gets toggled or reset.
eventOut SFBool toggle_changed
][
# "EventUtilityPrototypes.wrl#BooleanToggle"
"https://www.web3d.org/x3d/content/examples/Basic/development/EventUtilityPrototypes.wrl#BooleanToggle"
# "EventUtilityPrototypes.x3d#BooleanToggle"
"https://www.web3d.org/x3d/content/examples/Basic/development/EventUtilityPrototypes.x3d#BooleanToggle"
]
# [Scene] ========== ========== ==========
# =============== Camera ==============
WorldInfo {
title "CameraExamples.x3d"
}
EXTERNPROTO Camera [
# [appinfo] Camera node provides direct control of scene view to enable cinematic camera animation shot by shot and move by move along with still digital-photography settings for offline rendering of camera images
exposedField SFString description # [appinfo] Text description to be displayed for this Camera
exposedField SFVec3f position # [appinfo] Camera position in local transformation frame, which is default prior to first CameraShot initialPosition getting activated
exposedField SFRotation orientation # [appinfo] Camera rotation in local transformation frame, which is default prior to first CameraShot initialPosition getting activated
exposedField SFFloat fieldOfView # [appinfo] pi/4
eventIn SFFloat set_fraction # [appinfo] input fraction drives interpolators
eventIn SFBool set_bind # [appinfo] input event binds or unbinds this Camera
eventOut SFTime bindTime # [appinfo] output event indicates when this Camera is bound
eventOut SFBool isBound # [appinfo] output event indicates whether this Camera is bound or unbound
exposedField SFFloat nearClipPlane # [appinfo] Vector distance to near clipping plane corresponds to NavigationInfo.avatarSize[0]
exposedField SFFloat farClipPlane # [appinfo] Vector distance to far clipping plane corresponds to NavigationInfo.visibilityLimit
exposedField MFNode shots # [appinfo] Array of CameraShot nodes which in turn contain CameraMovement nodes
exposedField SFBool headlight # [appinfo] Whether camera headlight is on or off
exposedField SFColor headlightColor # [appinfo] Camera headlight color
exposedField SFFloat headlightIntensity # [appinfo] Camera headlight intensity
exposedField SFColor filterColor # [appinfo] Camera filter color that modifies virtual lens capture
exposedField SFFloat filterTransparency # [appinfo] Camera filter transparency that modifies virtual lens capture
exposedField SFVec3f upVector # [appinfo] upVector changes modify camera orientation (and possibly vice versa)
exposedField SFFloat fStop # [appinfo] Focal length divided effective aperture diameter indicating width of focal plane
exposedField SFFloat focusDistance # [appinfo] Distance to focal plane of sharpest focus
eventOut SFBool isActive # [appinfo] Mark start/stop with true/false output respectively useful to trigger external animations
eventOut SFTime totalDuration # [appinfo] Total duration of contained enabled CameraShot (and thus CameraMovement) move durations
exposedField SFNode offlineRender # [appinfo] OfflineRender node
field SFBool traceEnabled # [appinfo] enable console output to trace script computations and prototype progress
# Viewpoint-related fields, NavigationInfo-related fields and Camera-unique fields
][
"CameraPrototypes.x3d#Camera" "https://www.web3d.org/x3d/content/examples/Basic/development/CameraPrototypes.x3d#Camera" "CameraPrototypes.wrl#Camera" "https://www.web3d.org/x3d/content/examples/Basic/development/CameraPrototypes.wrl#Camera"
] ### here1
# =============== CameraShot ==============
EXTERNPROTO CameraShot [
# [appinfo] CameraShot collects a specific set of CameraMovement animations that make up an individual shot
exposedField SFString description # [appinfo] Text description to be displayed for this CameraShot
exposedField SFBool enabled # [appinfo] Whether this CameraShot can be activated
exposedField MFNode moves # [appinfo] Set of CameraMovement nodes
# initializing CameraMovement nodes are inserted here by scene author using ProtoInstance
exposedField SFVec3f initialPosition # [appinfo] Setup to reinitialize camera position for this shot
exposedField SFRotation initialOrientation # [appinfo] Setup to reinitialize camera rotation for this shot
exposedField SFVec3f initialAimPoint # [appinfo] Setup to reinitialize aimpoint (relative location for camera direction) for this shot
exposedField SFFloat initialFieldOfView # [appinfo] pi/4
exposedField SFFloat initialFStop # [appinfo] Focal length divided effective aperture diameter indicating width of focal plane
exposedField SFFloat initialFocusDistance # [appinfo] Distance to focal plane of sharpest focus
eventOut SFTime shotDuration # [appinfo] Subtotal duration of contained CameraMovement move durations
eventOut SFBool isActive # [appinfo] Mark start/stop with true/false output respectively useful to trigger external animations
field SFBool traceEnabled # [appinfo] enable console output to trace script computations and prototype progress
][
"CameraPrototypes.x3d#CameraShot" "https://www.web3d.org/x3d/content/examples/Basic/development/CameraPrototypes.x3d#CameraShot" "CameraPrototypes.wrl#CameraShot" "https://www.web3d.org/x3d/content/examples/Basic/development/CameraPrototypes.wrl#CameraShot"
] ### here1
# =============== CameraMovement ==============
EXTERNPROTO CameraMovement [
# [appinfo] CameraMovement defines a single camera movement animation
exposedField SFString description # [appinfo] Text description to be displayed for this CameraMovement
exposedField SFBool enabled # [appinfo] Whether this CameraMovement can be activated
exposedField SFFloat duration # [appinfo] Duration in seconds for this move
exposedField SFVec3f goalPosition # [appinfo] Goal camera position for this move
exposedField SFRotation goalOrientation # [appinfo] Goal camera rotation for this move
exposedField SFBool tracking # [appinfo] Whether or not camera direction is tracking towards the aimPoint
exposedField SFVec3f goalAimPoint # [appinfo] Goal aimPoint for this move, ignored if tracking=false
exposedField SFFloat goalFieldOfView # [appinfo] Goal fieldOfView for this move
exposedField SFFloat goalFStop # [appinfo] Focal length divided effective aperture diameter indicating width of focal plane
exposedField SFFloat goalFocusDistance # [appinfo] Distance to focal plane of sharpest focus
eventOut SFBool isActive # [appinfo] Mark start/stop with true/false output respectively useful to trigger external animations
field SFBool traceEnabled # [appinfo] enable console output to trace script computations and prototype progress
][
"CameraPrototypes.x3d#CameraMovement" "https://www.web3d.org/x3d/content/examples/Basic/development/CameraPrototypes.x3d#CameraMovement" "CameraPrototypes.wrl#CameraMovement" "https://www.web3d.org/x3d/content/examples/Basic/development/CameraPrototypes.wrl#CameraMovement"
] ### here1
# =============== OfflineRender ==============
EXTERNPROTO OfflineRender [
# [appinfo] OfflineRender defines a parameters for offline rendering of Camera animation output to a movie file (or possibly a still shot)
exposedField SFString description # [appinfo] Text description to be displayed for this OfflineRender
exposedField SFBool enabled # [appinfo] Whether this OfflineRender can be activated
exposedField SFFloat frameRate # [appinfo] Frames per second recorded for this rendering
exposedField SFVec2f frameSize # [appinfo] Size of frame in number of pixels width and height
exposedField SFFloat pixelAspectRatio # [appinfo] Relative dimensions of pixel height/width typically 1.33 or 1
eventIn SFTime set_startTime # [appinfo] Begin render operation
eventOut SFFloat progress # [appinfo] Progress performing render operation (0..1)
eventOut SFTime renderCompleteTime # [appinfo] Render operation complete
field MFString movieFormat # [appinfo] Format of rendered output movie (mpeg mp4 etc.), use first supported format
field MFString imageFormat # [appinfo] Format of rendered output images (png jpeg gif tiff etc.) use first supported format
field SFBool traceEnabled # [appinfo] enable console output to trace script computations and prototype progress
# TODO non-photorealistic rendering (NPR) parameters
][
"CameraPrototypes.x3d#OfflineRender" "https://www.web3d.org/x3d/content/examples/Basic/development/CameraPrototypes.x3d#OfflineRender" "CameraPrototypes.wrl#OfflineRender" "https://www.web3d.org/x3d/content/examples/Basic/development/CameraPrototypes.wrl#OfflineRender"
] ### here1
# =============== Lights, camera, action! ==============
DirectionalLight {
direction 0 -1 0
# global TRUE
intensity 0.8
}
NavigationInfo {
type [ "EXAMINE" "FLY" "ANY" ]
}
Viewpoint {
description "Camera test scene entry view"
position 0 2 12
}
Viewpoint {
description "Camera test scene from above"
orientation 1 0 0 -1.57079
position 0 150 0
}
# Keep prototype instances in same file while developing, then move later
# We will create examples matching those in the paper
# =============== Camera.SimpleShotsTest ==============
DEF Camera.SimpleShotsTest Camera {
description "SimpleShotsTest for camera Zoom Dolly Pan Boom and Tilt"
headlight TRUE
position -4 4 10
shots [
DEF Zoom CameraShot {
description "Simple shot of Camera Zoom"
initialPosition -50 1 -10
initialOrientation 0 1 0 0
moves [
CameraMovement {
description "Camera Zoom In"
duration 3
goalPosition -50 1 -15
goalOrientation 0 1 0 0
}
CameraMovement {
description "Camera Zoom Out"
duration 3
goalPosition -50 1 -10
goalOrientation 0 1 0 0
}
CameraMovement {
description "Camera Pause"
duration 1
goalPosition -50 1 -10
goalOrientation 0 1 0 0
}
]
}
DEF Dolly CameraShot {
description "Simple shot of Camera Dolly"
initialPosition -40 1 -10
initialOrientation 0 1 0 0
moves [
DEF DollyMove1 CameraMovement {
description "Camera Dolly from Right to Left"
duration 3
goalPosition -45 1 -10
goalOrientation 0 1 0 0
}
CameraMovement {
description "Camera Dolly from Left to Right"
duration 3
goalPosition -40 1 -10
goalOrientation 0 1 0 0
}
CameraMovement {
description "Camera Pause"
duration 1
goalPosition -40 1 -10
goalOrientation 0 1 0 0
}
]
}
DEF Pan CameraShot {
description "Simple shot of Camera Pan left right and back to center"
initialPosition -30 1 -10
initialOrientation 0 1 0 0
moves [
DEF PanLeft CameraMovement {
description "Pan Left"
duration 2
goalPosition -30 1 -10
goalOrientation 0 1 0 0.4
}
DEF PanRight CameraMovement {
description "Pan Right"
duration 3
goalPosition -30 1 -10
goalOrientation 0 1 0 -0.4
}
CameraMovement {
description "Camera Pan back to Center"
duration 2
goalPosition -30 1 -10
goalOrientation 0 1 0 0
}
CameraMovement {
description "Camera Pause"
duration 2
goalPosition -30 1 -10
goalOrientation 0 1 0 0
}
]
}
DEF CameraBoom CameraShot {
description "Camera Boom"
initialPosition -20 1 -10
initialOrientation 0 1 0 0
moves [
DEF CameraBoomUp CameraMovement {
description "Camera Boom Up"
duration 3
goalPosition -20 5 -10
goalOrientation 0 1 0 0
}
DEF BoomDown CameraMovement {
description "Camera Boom Down"
duration 3
goalPosition -20 1 -10
goalOrientation 0 1 0 0
}
DEF BoomPause CameraMovement {
description "Camera Pause"
duration 2
goalPosition -20 1 -10
goalOrientation 0 1 0 0
}
]
}
DEF CameraTilt CameraShot {
description "Camera Tilt"
initialPosition -10 1 -10
initialOrientation 0 0 1 0
traceEnabled TRUE
moves [
CameraMovement {
description "Camera Tilt Pause"
duration 1
goalPosition -10 1 -10
goalOrientation 0 0 1 0
}
DEF TiltDown CameraMovement {
description "Camera Tilt Left"
duration 3
goalPosition -10 1 -10
goalOrientation 0 0 1 0.785
}
DEF TiltPause CameraMovement {
description "Camera Tilt Pause"
duration 1
goalPosition -10 1 -10
goalOrientation 0 0 1 0.785
}
CameraMovement {
description "Camera Tilt Right"
duration 3
goalPosition -10 1 -10
goalOrientation 0 0 1 -0.785
}
CameraMovement {
description "Camera Tilt Pause"
duration 1
goalPosition -10 1 -10
goalOrientation 0 0 1 -0.785
}
DEF TiltReset CameraMovement {
description "Camera Tilt Reset"
duration 1
goalPosition -10 1 -10
goalOrientation 0 0 1 0
}
DEF TiltUp CameraMovement {
description "Return to home"
duration 2
goalPosition 0 2 12
goalOrientation 0 0 1 0
}
]
}
]
}
DEF AnimationGroup.SimpleShots Group {
children [
DEF CameraTimer.SimpleShots TimeSensor {
}
# initialize clock to match totalDuration of combined Shot Moves
# TimeSensor animates the CameraClock since that maintains the computed PositionInterpolator and OrientationInterpolator
DEF Trigger.SimpleShots Transform {
translation -4 4 0
children [
DEF TextTouchActive.SimpleShotsFilter BooleanFilter {
}
DEF TextTouch.SimpleShots TouchSensor {
# description "touch to animate Camera SimpleShotsTest"
}
Shape {
geometry Text {
string [ "Click to animate" "SimpleShotsTest" ]
fontStyle FontStyle {
justify [ "MIDDLE" "MIDDLE" ]
}
}
appearance Appearance {
material DEF ArtDeco5 Material {
ambientIntensity 0.24
diffuseColor 0.945455 0.318988 0.321717
shininess 0.01
specularColor 0.072727 0.021705 0.010732
# Universal Media Library: ArtDeco 5
}
}
}
# Simplify intersection test for user selecting text
DEF TransparentBox Shape {
appearance Appearance {
material Material {
transparency 1
}
}
geometry Box {
size 6 2 0.0001
}
}
]
ROUTE TextTouchActive.SimpleShotsFilter.inputTrue TO Camera.SimpleShotsTest.set_bind
ROUTE TextTouch.SimpleShots.isActive TO TextTouchActive.SimpleShotsFilter.set_boolean
ROUTE TextTouch.SimpleShots.touchTime TO CameraTimer.SimpleShots.startTime
}
]
ROUTE Camera.SimpleShotsTest.totalDuration TO CameraTimer.SimpleShots.cycleInterval
ROUTE CameraTimer.SimpleShots.fraction_changed TO Camera.SimpleShotsTest.set_fraction
}
DEF SimpleShotsTargets Group {
children [
DEF TargetBoxZoom Transform {
translation -50 1 -20
children [
Shape {
geometry Box {
}
appearance Appearance {
material Material {
}
texture ImageTexture {
url [ "images/CameraMoveZoom.png" "https://www.web3d.org/x3d/content/examples/Basic/development/images/CameraMoveZoom.png" ]
}
}
}
Transform {
translation 0 2 0
children [
Shape {
geometry Text {
string [ "Zoom in, out" ]
fontStyle FontStyle {
justify [ "MIDDLE" "MIDDLE" ]
}
}
appearance Appearance {
material Material {
}
}
}
]
}
]
}
DEF TargetBoxDolly Transform {
translation -40 1 -20
children [
Shape {
geometry Box {
}
appearance Appearance {
material Material {
}
texture ImageTexture {
url [ "images/CameraMoveDolly.png" "https://www.web3d.org/x3d/content/examples/Basic/development/images/CameraMoveDolly.png" ]
}
}
}
Transform {
translation 0 2 0
children [
Shape {
geometry Text {
string [ "Dolly left, right" ]
fontStyle FontStyle {
justify [ "MIDDLE" "MIDDLE" ]
}
}
appearance Appearance {
material Material {
}
}
}
]
}
]
}
DEF TargetBoxPan Transform {
translation -30 1 -20
children [
Shape {
geometry Box {
}
appearance Appearance {
material Material {
}
texture ImageTexture {
url [ "images/CameraMovePan.png" "https://www.web3d.org/x3d/content/examples/Basic/development/images/CameraMovePan.png" ]
}
}
}
Transform {
translation 0 2 0
children [
Shape {
geometry Text {
string [ "Pan left, right" ]
fontStyle FontStyle {
justify [ "MIDDLE" "MIDDLE" ]
}
}
appearance Appearance {
material Material {
}
}
}
]
}
]
}
DEF TargetBoxBoom Transform {
translation -20 1 -20
children [
Shape {
geometry Box {
}
appearance Appearance {
material Material {
}
texture ImageTexture {
url [ "images/CameraMoveBoom.png" "https://www.web3d.org/x3d/content/examples/Basic/development/images/CameraMoveBoom.png" ]
}
}
}
Transform {
translation 0 2 0
children [
Shape {
geometry Text {
string [ "Boom up, down" ]
fontStyle FontStyle {
justify [ "MIDDLE" "MIDDLE" ]
}
}
appearance Appearance {
material Material {
}
}
}
]
}
]
}
DEF TargetBoxTilt Transform {
translation -10 1 -20
children [
Shape {
geometry Box {
}
appearance Appearance {
material Material {
}
texture ImageTexture {
url [ "images/CameraMoveTilt.png" "https://www.web3d.org/x3d/content/examples/Basic/development/images/CameraMoveTilt.png" ]
}
}
}
Transform {
translation 0 2 0
children [
Shape {
geometry Text {
string [ "Tilt left, right" ]
fontStyle FontStyle {
justify [ "MIDDLE" "MIDDLE" ]
}
}
appearance Appearance {
material Material {
}
}
}
]
}
]
}
]
}
# =============== Camera.AimPointTest ==============
DEF Camera.AimPointTest Camera {
description "AimPointTest for moving camera tracking moving target"
position 4 4 10
shots [
DEF Shot5 CameraShot {
description "#3 Tracking shot"
initialPosition 6 6 10
initialOrientation 0 1 0 0
moves [
DEF MoveAimPoint3.1 CameraMovement {
# goalAimPoint modified by ROUTE to match moving Box
description "AimPoint 3.1 moving BoxPath"
tracking TRUE
duration 8
goalPosition 6 6 10
}
DEF MoveAimPoint3.2 CameraMovement {
# goalAimPoint modified by ROUTE to match moving Box
description "AimPoint 3.2 pan right while tracking"
tracking TRUE
duration 8
goalPosition 40 6 12
}
DEF MoveAimPoint3.3 CameraMovement {
# goalAimPoint modified by ROUTE to match moving Box
description "AimPoint 3.3 boom up while tracking"
tracking TRUE
duration 3
goalPosition 40 20 13
}
DEF MoveAimPoint3.4 CameraMovement {
# can test tracking or not using these values
description "AimPoint 3.4 restore camera back to home"
tracking TRUE
duration 5
goalPosition 4 4 10
goalAimPoint 4 4 0
goalOrientation 0 1 0 0
}
]
}
]
}
DEF AnimationGroup.AimPointTest Group {
children [
DEF CameraTimer.AimPointTest TimeSensor {
}
# initialize clock to match totalDuration of combined Shot Moves
# TimeSensor animates the CameraClock since that maintains the computed PositionInterpolator and OrientationInterpolator
DEF Trigger.AimPointTest Transform {
translation 4 4 0
children [
DEF TextTouchActive.AimPointFilter BooleanFilter {
}
DEF TextTouch.AimPointTest TouchSensor {
# description "touch to animate Camera AimPointTest"
}
Shape {
geometry Text {
string [ "Click to animate" "AimPointTest" ]
fontStyle FontStyle {
justify [ "MIDDLE" "MIDDLE" ]
}
}
appearance Appearance {
material USE ArtDeco5
}
}
USE TransparentBox
]
ROUTE TextTouchActive.AimPointFilter.inputTrue TO Camera.AimPointTest.set_bind
ROUTE TextTouch.AimPointTest.isActive TO TextTouchActive.AimPointFilter.set_boolean
ROUTE TextTouch.AimPointTest.touchTime TO CameraTimer.AimPointTest.startTime
}
]
ROUTE Camera.AimPointTest.totalDuration TO CameraTimer.AimPointTest.cycleInterval
ROUTE CameraTimer.AimPointTest.fraction_changed TO Camera.AimPointTest.set_fraction
}
# TODO build a test once implemented
OfflineRender {
}
# =============== animate a camera shape to visualize view changes ==============
DEF CameraShapeTransform Transform {
translation 0 0.5 0
children [
# move CameraShape using active Camera
DEF CameraOffsetTransform Transform {
translation 0 0 0.25
children [
DEF CameraShapeTouched TouchSensor {
}
DEF CameraShape Inline {
url [ "CameraShape.x3d" "https://www.web3d.org/x3d/content/examples/Basic/development/CameraShape.x3d" ]
}
DEF SightLine Shape {
geometry IndexedLineSet {
coordIndex [ 0 1 ]
coord Coordinate {
point [ 0 0 0 0 0 -100 ]
}
}
appearance Appearance {
material Material {
emissiveColor 0.8 0.8 0.4
}
}
}
]
}
# Display frustum to show camera view within the scene, toggled by user selecting CameraShape
EXTERNPROTO ViewFrustum [
# [appinfo] Display view frustum associated with a given pair of Viewpoint NavigationInfo nodes
field SFNode ViewpointNode # [appinfo] required: insert Viewpoint DEF or USE node for view of interest
field SFNode NavigationInfoNode # [appinfo] required: insert NavigationInfo DEF or USE node of interest
exposedField SFBool visible # [appinfo] whether or not frustum geometry is rendered
exposedField SFColor lineColor # [appinfo] RGB color of ViewFrustum outline, default value 0.9 0.9 0.9
exposedField SFColor frustumColor # [appinfo] RGB color of ViewFrustum hull geometry, default value 0.8 0.8 0.8
exposedField SFFloat transparency # [appinfo] transparency of ViewFrustum hull geometry, default value 0.5
exposedField SFFloat aspectRatio # [appinfo] assumed ratio height/width, default value 0.75
field SFBool trace # [appinfo] debug support, default false
][
"../../X3dForWebAuthors/Chapter14Prototypes/ViewFrustumPrototype.x3d#ViewFrustum" "https://www.web3d.org/x3d/content/examples/X3dForWebAuthors/Chapter14Prototypes/ViewFrustumPrototype.x3d#ViewFrustum" "../../X3dForWebAuthors/Chapter14Prototypes/ViewFrustumPrototype.wrl#ViewFrustum" "https://www.web3d.org/x3d/content/examples/X3dForWebAuthors/Chapter14Prototypes/ViewFrustumPrototype.wrl#ViewFrustum"
] ### here1
DEF ViewFrustumNode ViewFrustum {
ViewpointNode [
DEF FrustumViewpoint Viewpoint {
description "viewpoint for ViewFrustum"
position 0 0 0
}
]
NavigationInfoNode [
DEF TestNavigationInfo NavigationInfo {
# transitionType [ "ANIMATE" ]
visibilityLimit 100
}
]
visible FALSE
lineColor 0.9 0.9 0.9
frustumColor 0.8 0.8 0.8
transparency 0.95
}
DEF ViewFrustumToggle BooleanToggle {
}
]
ROUTE Camera.SimpleShotsTest.position_changed TO CameraShapeTransform.translation
ROUTE Camera.SimpleShotsTest.orientation_changed TO CameraShapeTransform.rotation
ROUTE Camera.AimPointTest.position TO CameraShapeTransform.translation
ROUTE Camera.AimPointTest.orientation_changed TO CameraShapeTransform.rotation
ROUTE CameraShapeTouched.isActive TO ViewFrustumToggle.set_boolean
ROUTE ViewFrustumToggle.toggle TO ViewFrustumNode.set_visible
}
# =============== add checkerboard, axes and other things to look at while animating ==============
Background {
skyColor [ 0.282353 0.380392 0.470588 ]
}
Transform {
rotation 1 0 0 -1.57079
scale 10 10 10
children [
Shape {
appearance Appearance {
material Material {
ambientIntensity 0.01
diffuseColor 1.0 1.0 1.0
shininess 0.05
}
}
geometry IndexedFaceSet {
colorIndex [ 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 ]
colorPerVertex FALSE
coordIndex [ 0 8 9 1 -1 1 9 10 2 -1 2 10 11 3 -1 3 11 12 4 -1 4 12 13 5 -1 5 13 14 6 -1 6 14 15 7 -1 8 16 17 9 -1 9 17 18 10 -1 10 18 19 11 -1 11 19 20 12 -1 12 20 21 13 -1 13 21 22 14 -1 14 22 23 15 -1 16 24 25 17 -1 17 25 26 18 -1 18 26 27 19 -1 19 27 28 20 -1 20 28 29 21 -1 21 29 30 22 -1 22 30 31 23 -1 24 32 33 25 -1 25 33 34 26 -1 26 34 35 27 -1 27 35 36 28 -1 28 36 37 29 -1 29 37 38 30 -1 30 38 39 31 -1 32 40 41 33 -1 33 41 42 34 -1 34 42 43 35 -1 35 43 44 36 -1 36 44 45 37 -1 37 45 46 38 -1 38 46 47 39 -1 40 48 49 41 -1 41 49 50 42 -1 42 50 51 43 -1 43 51 52 44 -1 44 52 53 45 -1 45 53 54 46 -1 46 54 55 47 -1 48 56 57 49 -1 49 57 58 50 -1 50 58 59 51 -1 51 59 60 52 -1 52 60 61 53 -1 53 61 62 54 -1 54 62 63 55 -1 ]
normalPerVertex FALSE
solid FALSE
coord Coordinate {
point [ -5.25 5.25 0.0 -3.75 5.25 0.0 -2.25 5.25 0.0 -0.75 5.25 0.0 0.75 5.25 0.0 2.25 5.25 0.0 3.75 5.25 0.0 5.25 5.25 0.0 -5.25 3.75 0.0 -3.75 3.75 0.0 -2.25 3.75 0.0 -0.75 3.75 0.0 0.75 3.75 0.0 2.25 3.75 0.0 3.75 3.75 0.0 5.25 3.75 0.0 -5.25 2.25 0.0 -3.75 2.25 0.0 -2.25 2.25 0.0 -0.75 2.25 0.0 0.75 2.25 0.0 2.25 2.25 0.0 3.75 2.25 0.0 5.25 2.25 0.0 -5.25 0.75 0.0 -3.75 0.75 0.0 -2.25 0.75 0.0 -0.75 0.75 0.0 0.75 0.75 0.0 2.25 0.75 0.0 3.75 0.75 0.0 5.25 0.75 0.0 -5.25 -0.75 0.0 -3.75 -0.75 0.0 -2.25 -0.75 0.0 -0.75 -0.75 0.0 0.75 -0.75 0.0 2.25 -0.75 0.0 3.75 -0.75 0.0 5.25 -0.75 0.0 -5.25 -2.25 0.0 -3.75 -2.25 0.0 -2.25 -2.25 0.0 -0.75 -2.25 0.0 0.75 -2.25 0.0 2.25 -2.25 0.0 3.75 -2.25 0.0 5.25 -2.25 0.0 -5.25 -3.75 0.0 -3.75 -3.75 0.0 -2.25 -3.75 0.0 -0.75 -3.75 0.0 0.75 -3.75 0.0 2.25 -3.75 0.0 3.75 -3.75 0.0 5.25 -3.75 0.0 -5.25 -5.25 0.0 -3.75 -5.25 0.0 -2.25 -5.25 0.0 -0.75 -5.25 0.0 0.75 -5.25 0.0 2.25 -5.25 0.0 3.75 -5.25 0.0 5.25 -5.25 0.0 ]
}
color Color {
color [ 0.435294 0.741176 0 0 0.560784 0.580392 ]
}
}
}
]
}
Transform {
scale 3 3 3
translation 0 0.25 0
children [
DEF CoordinateAxes Inline {
url [ "../../X3dForWebAuthors/Chapter03Grouping/CoordinateAxes.x3d" "../../Savage/Tools/Authoring/CoordinateAxes.x3d" "https://www.web3d.org/x3d/content/examples/X3dForWebAuthors/Chapter03Grouping/CoordinateAxes.x3d" "https://savage.nps.edu/Savage/Tools/Authoring/CoordinateAxes.x3d" "../../X3dForWebAuthors/Chapter03Grouping/CoordinateAxes.wrl" "../../Savage/Tools/Authoring/CoordinateAxes.wrl" "https://www.web3d.org/x3d/content/examples/X3dForWebAuthors/Chapter03Grouping/CoordinateAxes.wrl" "https://savage.nps.edu/Savage/Tools/Authoring/CoordinateAxes.wrl" ]
}
]
}
DEF MovingBoxTransform Transform {
children [
DEF BoxPath PositionInterpolator {
key [ 0 0.25 0.5 0.75 1 ]
keyValue [ -5 1 5 45 1 5 45 1 -45 -5 1 -45 -5 1 5 ]
}
DEF BoxTimer TimeSensor {
cycleInterval 10
loop TRUE
}
Shape {
geometry Box {
}
appearance Appearance {
material Material {
}
texture ImageTexture {
url [ "../earth-topo.png" "https://www.web3d.org/x3d/content/examples/Basic/earth-topo.png" ]
}
}
}
]
ROUTE BoxPath.value_changed TO MovingBoxTransform.translation
ROUTE BoxPath.value_changed TO MoveAimPoint3.1.goalAimPoint
ROUTE BoxPath.value_changed TO MoveAimPoint3.2.goalAimPoint
ROUTE BoxPath.value_changed TO MoveAimPoint3.3.goalAimPoint
ROUTE BoxTimer.fraction_changed TO BoxPath.set_fraction
}
# ================ CrossHair visualization for center of screen ================
EXTERNPROTO CrossHair [
# [appinfo] CrossHair prototype provides a heads-up display (HUD) crosshair at the view center, which is useful for assessing NavigationInfo lookAt point
field SFBool enabled # [appinfo] whether CrissHair orititype is enabled or not
eventIn SFBool set_enabled # [appinfo] control whether enabled/disabled
exposedField SFColor markerColor # [appinfo] color of CrossHair marker
exposedField SFVec3f scale # [appinfo] size of CrossHair in meters
exposedField SFVec3f positionOffsetFromCamera # [appinfo] distance in front of HUD viewpoint
][
"../../Savage/Tools/HeadsUpDisplays/CrossHairPrototype.x3d#CrossHair" "https://savage.nps.edu/Savage/Tools/HeadsUpDisplays/CrossHairPrototype.x3d#CrossHair" "../../Savage/Tools/HeadsUpDisplays/CrossHairPrototype.wrl#CrossHair" "https://savage.nps.edu/Savage/Tools/HeadsUpDisplays/CrossHairPrototype.wrl#CrossHair"
] ### here1
DEF CrossHairInstance CrossHair {
enabled TRUE
markerColor 1 0.5 0
scale 1 1 1
positionOffsetFromCamera 0 0 -6
}
# turn on CrossHairInstance when animated camera viewpoints are bound
ROUTE Camera.SimpleShotsTest.isBound TO CrossHairInstance.set_enabled
ROUTE Camera.AimPointTest.isBound TO CrossHairInstance.set_enabled
# turn off CrossHairInstance when animated camera viewpoints are unbound
# =============== TODO Launch Prototype Example ==============
Anchor {
description "launch CameraExample scene"
parameter [ "target=_blank" ]
url [ "CameraExample.x3d" "https://www.web3d.org/x3d/content/examples/Basic/development/CameraExample.x3d" "CameraExample.wrl" "https://www.web3d.org/x3d/content/examples/Basic/development/CameraExample.wrl" ]
children [
Transform {
translation 0 -3 0
children [
Shape {
geometry Text {
string [ "CameraPrototype" "defines a prototype" "" "Click on this text to see" "CameraExample scene" ]
fontStyle FontStyle {
justify [ "MIDDLE" "MIDDLE" ]
size 0.5
}
}
appearance Appearance {
material Material {
diffuseColor 1 1 0.2
}
}
}
]
}
]
}