This component defines nodes to control the camera,
and some effects closely related to the camera.
NavigationInfo controls the camera behavior.
the initial camera position and rotation, and may be used to animate
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.
For demos and tests of these features,
navigation subdirectory inside our VRML/X3D demo models.
view3dscene displays a nice menu allowing you to jump to any defined viewpoint, showing viewpoints' descriptions. Animating viewpoint's position and orientation (directly or by animating it's parent transformation) also works perfectly.
TODO: fields not implemented yet:
centerOfRotation already exists in the engine
so it should be easy to finish it (copy X3D
But we may have to treat centerOfRotation = 0,0,0
as special value meaning "middle of the box", otherwise many models will
have weird navigation because they lack correct centerOfRotation value
(and the default is just zero).
Suggestions and reports how does this work in other VRML/X3D browsers are welcome.
retainUserOffsets is probably easy, but someone
has to actually understand the X3D specification about them,
and explain how they are related to each other (and to
Suggestions and testcases and reports how do they work in other
VRML/X3D browsers are welcome.
avatarSize is honoured fully:
avatarSize item is the camera radius.
If you use view3dscene,
--camera-radius command-line option overrides
avatarSize item is the preferred height
above the ground.
is the tallest object over which you can climb.
If this is missing (or it has value <= 0) then there's no such limit, and you can climb as long as you can move forward. So you can climb the stairs with steps almost as high as your own height minus the camera radius. Simplifying (ignoring other effects, like head bobbing), you can say that avatarSize is by default like avatarSize - avatarSize).
See TWalkCamera.ClimbHeight API docs for more details about this.
speed field is supported, 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).
typefield is supported. Navigation types fully supported are:
NONE. Inside the engine, the navigation paradigm is actually a little more flexible. You can fine-tune the rotations and gravity behavior by view3dscene Navigation -> Walk and Fly Settings menu.
As an extension, we also support new navigation mode
This is similar to the Examine mode, with controls comfortable
for viewing models that have a sense of floor/ground in the XZ plane,
and vertical axis in +Y. Implementation is not finished yet.
The presence of navigation type
ANY is ignored by
We always show controls to change navigation settings, hiding them
feels harmful to user.
Nice transitions between viewpoints are supported,
and (since view3dscene 3.13.0) making
See demo model navigation/transition_multiple_viewpoints.x3dv showing how to use it to make an animated transition between a couple of viewpoints.
and changing their exposed fields by events, of course works.
NavigationInfo node is present in the scene:
speedare calculated based on scene's bounding box sizes, to a values that will hopefully "feel right". We try to calculate them intelligently, because simply using
NavigationInfodefaults results in bad experience in many scenes.
headlightbehaves like true,
[EXAMINE, ANY], this follows
visibilityLimit may be ignored if shadow
volumes are allowed (We use frustum with z-far in infinity then.)
Note: We do not have any automatic LOD calculation implemented now,
which means that your supplied
range, and only
range, controls which LOD is chosen.
This means that
forceTransitions value is simply ignored,
range is empty, we simply always use the first
(highest-detail) version. This is Ok, spec allows this.
Most things work: grouping (
children property, in particular),
allows to control collision detection by honoring
collide in VRML 97) and
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.
You can use them to create submenus in "Viewpoints" menu in
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.isActive to the
Except this workaround will not work too, because changing
displayed field after the scene loading
doesn't change the menu for now.
TODO: retainUserOffsets is ignored.
Copyright Michalis Kamburelis and other Castle Game Engine developers.
Thank you to Paweł Wojciechowicz from Cat-astrophe Games for various graphics.
This documentation is also open-source and you can even redistribute it on open-source terms.