In the x3d scene space, X3D provides the point of view node viewpoint in order to enable the viewer to conveniently control the position and angle of observation. At the same time, in order to be able to browse in different ways, X3D provides the Navigationinfo navigation node.
Here is a description of the use of these two nodes.
One, Viewpoint node
The Viewpoint node indicates the position of observation and the direction of view in a x3d scene space, the main properties of which are as follows:
properties |
meaning |
default value |
use instructions |
description |
text description of the viewpoint |
-- |
|
position |
viewpoint position |
0 0 |
Space location of the specified observer |
View direction |
0 0 1 0 |
|
fieldofview |
zoom angle |
0.785398 |
unit is radians, value range 0~ 3.14159, small angle is equivalent to long shot, large angle is equivalent to wide-angle lens. |
jump |
true |
|
Rotation center position |
0 0 0 |
|
The simple sample code is as follows:
Description: The above code is used to view the cylinder in different directions. The most difficult thing to understand in code is the position and perspective of the viewpoint. By default, our human eye is in the +z direction, when the point of view position in the rear of the cylinder, that is, "back" view, our eyes are still in the direction of the direction of the eye, must be observed from the outside to see the cylinder, so we will rotate the angle around the y axis 180 degrees. Similarly, you can understand the settings for the top and left viewpoints.
The results are shown in the following figure.