Kambi VRML game engine
← Users Developers →
 
Intro and News
 
view3dscene
 
The Castle
 
All Programs
 
Forum
 
Engine
 
VRML/X3D
 
Other
 

Navigation component

This component defines nodes to control the camera, and some effects closely related to the camera. NavigationInfo controls the camera behavior. Viewpoint and OrthoViewpoint define the initial camera position and rotation, and may be used to animate the camera. LOD allows to implement level-of-detail, where different versions of 3D scene are displayed depending on the camera distance. Collision allows to use a simpler geometry for collision purposes, or even to turn the collisions off (like a fake walls hiding secret rooms in games). Billboard may be used to create sprites, as it aligns geometry (flat or not) with respect to the camera.

See also X3D specification of Navigation component.

Supported nodes:

  • Viewpoint

    Note: view3dscene displays also nice menu allowing you to jump to any defined viewpoint, displaying viewpoints descriptions. Extensive tests of various viewpoint properties, including fieldOfView, are inside my VRML test suite in vrml_2/viewpoint_*.wrl files.

    Animating viewpoint's position and orientation (directly or by it's transformations) works perfectly.

  • OrthoViewpoint

    TODO: Although it's handled, some fields are ignored for now: jump, retainUserOffsets, centerOfRotation.

  • NavigationInfo

    Nice transitions between viewpoints are supported, honouring transitionType and transitionTime fields. TODO: transitionComplete event is not generated for now.

    Binding different NavigationInfo nodes, and changing their exposed fields by events, (just like for X3DViewpointNodes) of course works.

    Various details about how we handle NavigationInfo node in view3dscene:

    • Note that --camera-radius command-line option overrides whatever was specified by avatarSize[0].
    • avatarSize[2] (tallest object over which you can move) is ignored for now. Camera radius decides what you can climb.
    • speed is honored as appropriate, it sets the speed in meters/second. Speed = 0.0 is also correctly honored (user will not be able to move in Walk/Fly modes, only to rotate).
    • type of navigation: EXAMINE, WALK, FLY, NONE are fully supported. They map to appropriate view3dscene internal navigation settings:
      • EXAMINE in VRML — internal Examine style,
      • WALK in VRML — internal Walk style with gravity and moving versus gravity up vector,
      • FLY in VRML — internal Walk style without gravity, and moving versus current up vector,
      • NONE in VRML — internal Walk style without gravity, and with "disable normal navigation".
    • The presence of navigation type ANY is not important (view3dscene always shows controls to change navigation settings).

    When no NavigationInfo node is present in the scene, we try to intelligently guess related properties. (We try to guess "intelligently" because simply assuming that "no NavigationInfo node" is equivalent to "presence of default NavigationInfo" is not good for most scenes).

    • avatarSize[0] and avatarSize[1] are guessed based on scene's bounding box sizes.
    • headlight is set to true.
    • type is set to "EXAMINE" (this follows the spec, as [EXAMINE, ANY] is the default NavigationInfo.type value).
    • speed is calculated to something that should "feel sensible" based on scene's bounding box sizes.

    TODO: visibilityLimit may be ignored if shadow volumes are allowed (We use frustum with z-far in infinity then.)

  • LOD

    Note: We do not have any automatic LOD calculation implemented now, which means that your supplied range, and only your supplied range, controls which LOD is chosen. This means that forceTransitions value is simply ignored, and when range is empty, we simply always use the first (highest-detail) version. This is Ok, spec allows this.

  • Billboard

    Works fully.

  • Collision

    Most things work: grouping (children property, in particular), allows to control collision detection by honoring enabled (named collide in VRML 97) and proxy fields.

    bboxCenter/Size is currently simply ignored, our engine always calculates and updates the bounding boxes where needed.

    TODO: collideTime and isActive out events are not implemented yet.

  • ViewpointGroup

    You can use them to create submenus in "Viewpoints" menu in view3dscene: description and children work. Also, you can use this to hide some viewpoints from the menu: displayed field works.

    TODO: size/center is not honored yet. Group is displayed regardless of camera position. A possible workarond could be to use a ProximitySensor node, routing ProximitySensor.isActive to the displayed field... Except this workaround will not work too, because changing of the displayed field after the scene loading doesn't change the menu for now.

    TODO: retainUserOffsets is ignored.