Extensible 3D (X3D)
Part 1: Architecture and base components
42 Texture projection component
The name of this component is "TextureProjection". This name shall be used when referring to this component in the COMPONENT statement (see 7.2.5.4 Component statement).
This component provides additional texturing extensions to the basic capabilities defined in X3D. Generally, 2D and 3D texture projection has been used to enhance the quality of an image generated with a camera or to speed up the generation of an image with respect to a given scene including several geometric models. However, there are some constraints for projecting the region and shape of textures over objects. As an extension of texture projection, the texture image can be projected onto a 3D scene within the projection volume which is constructed from projection parameters such as a projection point, a projection direction and a projection aspect ratio. Figure 42.1 shows an example screen shot by applying texture projection to a 3D virtual scene.
This texture projection is essential for enhanced rendering effects in a 3D scene such as rendering of projected images, visualization of a terrain surface in GIS applications, and medical visualization.
The texture projection allows a texture image to be projected onto a 3D virtual scene inside the projection volume visible from a specific position called a projection point. The projection volume is determined by projection parameters depending on two types: parallel and perspective projections. In a parallel projection, the parallel volume is a parallelepiped. In a perspective projection, the projection volume is a rectangular frustum.
The parallel projection can be distinguished into orthographic and oblique according to the defined projection direction. If all the projection lines are orthogonal to the projection plane, the projection is called an orthographic projection. All the projection lines in oblique projection intersect the projection plane at an oblique angle. In order to describe the types of parallel projection, the projection point and projection direction are given as a point and a vector, respectively. The projection volume in parallel projection can be defined as a parallelepiped.
The perspective projection can be defined as a field of view angle from a projection point, an aspect ratio based on width and height, plus near and far planes. In texture projection generally, a single texture as well as several texture images can be projected onto a scene in a 3D virtual world. Furthermore, multiple texture projections can be performed over a common scene with specific objectives such as photogrammetry or reconstruction of endoscope images. As shown in Figure 42.2, assume that several images are provided, each of which is taken with a different camera. Construction of a terrain surface from those images can be performed by displaying overlapping images obtained after applying several projected textures to the surface model.
Figure 42.3 describes an example for reconstructing endoscope images over a cylinder by applying texture projection. In a similar manner, each image is captured from an endoscope with perspective view information inside a human body.
Figure 42.3 — Application of perspective texture projection for reconstructing an endoscope 3D model.
Node types specifying images for texture projection may supply data with a number of color components between one and four. The valid types and interpretations of 3D textures are identical to that for 2D textures. The definition of texture formats is defined in 18.2.1 Texture map formats.
X3DTextureProjectorNode : X3DLightNode { SFFloat [in,out] ambientIntensity 0 [0,1] SFColor [in,out] color 1 1 1 [0,1] SFString [in,out] description "" SFVec3f [in,out] direction 0 0 1 (-∞,∞) SFFloat [in,out] farDistance -1 -1 or (0,∞) SFBool [in,out] global TRUE SFFloat [in,out] intensity 1 [0,∞) SFVec3f [in,out] location 0 0 0 (-∞,∞) SFNode [in,out] metadata NULL [X3DMetadataObject] SFFloat [in,out] nearDistance -1 -1 or (0,∞) SFBool [in,out] on TRUE SFBool [in,out] shadows FALSE SFFloat [in,out] shadowIntensity 1 [0,1] SFNode [in,out] texture NULL [X3DTexture2DNode] SFFloat [out] aspectRatio (0,∞) }
This abstract node type is the base type for all node types that specify texture projection.
The aspectRatio field is the ratio of image width and height that is projected.
The description field of this node tells the name of the projector, and makes the division of different projectors possible.
The direction is the way the projector is heading, and this implies projection direction.
Each texture projection type defines a global field that determines whether the texture projection is global or scoped. Global texture projection performs the texture projections for all objects that fall within their volume of texture projection influence. Scoped texture projection only performs the texture projections for objects that are in the same transformation hierarchy as the texture projection; i.e., only the children and descendants of its enclosing parent group are illuminated.
The location shows the position of the projector, and this implies projection point.
The nearDistance and farDistance are the minimum and maximum distance traveled, respectively, for a projected texture that is shown on the screen. A default value of -1 for nearDistance or farDistance means that the field has no effect on currently active projection boundaries.
The on field specifies whether the texture projection is performed or not. If on is TRUE, the texture projection is performed for geometry objects in the scene. If on is FALSE, the texture projection is not performed for any geometry in the scene.
The ambientIntensity, color, global, global, intensity, on, shadows, shadowIntensity, and texture fields are defined in X3DLightingNode.
See 18 Texturing component for a general description of the X3DTexture2DNode abstract type and interpretation of rendering for 2D images.
TextureProjector : X3DTextureProjectorNode { SFFloat [in,out] ambientIntensity 0 [0,1] SFColor [in,out] color 1 1 1 [0,1] SFString [in,out] description "" SFVec3f [in,out] direction 0 0 1 (-∞,∞) SFFloat [in,out] farDistance -1 -1 or (0,∞) SFFloat [in,out] fieldOfView π/4 (0,π) SFBool [in,out] global TRUE SFFloat [in,out] intensity 1 [0,∞) SFVec3f [in,out] location 0 0 0 (-∞,∞) SFNode [in,out] metadata NULL [X3DMetadataObject] SFFloat [in,out] nearDistance -1 -1 or (0,∞) SFBool [in,out] on TRUE SFBool [in,out] shadows FALSE SFFloat [in,out] shadowIntensity 1 [0,1] SFNode [in,out] texture NULL [X3DTexture2DNode] SFVec3f [in,out] upVector 0 0 1 SFFloat [out] aspectRatio (0,∞) }
TextureProjector is a light that projects a texture into the scene, applying the projected texture to any geometry that intersects the perspective projection volume.
Perspective texture projection is shown in Figure 42.5.
The aspectRatio is the aspect ratio of the width and length which refers to perspective projection spect ratio.
The description field of this node tells the name of the perspective projector, and makes the division of different perspective projectors possible.
The direction is the way the perspective projector is heading, and this implies to perspective projection direction.
The fieldOfView is the extent of the observable texture that is seen on the perspective display at any given moment. This value may change depending on the aspect ratio of the rendering resolution. The default value of this field is π/4.
The location shows the position of the perspective projector, and this implies perspective projection point.
The nearDistance and farDistance is the minimum and maximum distance that is shown on the screen, respectively.
The upVector describes the roll of the camera by saying which point is "up" in the camera's orientation. The default value of this field is (0 0 1).
EXAMPLE: TextureProjector
TextureProjector { description "Project a red delicious texture" direction -1 0 -1 farDistance 10 fieldOfView 0.26 global TRUE location 3 3 3 nearDistance 1 on TRUE upVector 0 1 0 texture ImageTexture { url [ "image/Red_Delicious.jpg" ] } }
TextureProjectorParallel : X3DTextureProjectorNode { SFFloat [in,out] ambientIntensity 0 [0,1] SFColor [in,out] color 1 1 1 [0,1] SFString [in,out] description "" SFVec3f [in,out] direction 0 0 1 (-∞,∞) SFFloat [in,out] farDistance -1 -1 or (0,∞) SFVec4f [in,out] fieldOfView -1 -1 1 1 (-∞,∞) SFBool [in,out] global TRUE SFFloat [in,out] intensity 1 [0,∞) SFVec3f [in,out] location 0 0 0 (-∞,∞) SFNode [in,out] metadata NULL [X3DMetadataObject] SFFloat [in,out] nearDistance -1 -1 or (0,∞) SFBool [in,out] on TRUE SFBool [in,out] shadows FALSE SFFloat [in,out] shadowsIntensity 1 [0,1] SFNode [in,out] texture NULL [X3DTexture2DNode] SFFloat [out] aspectRatio (0,∞) }
TextureProjectorParallel is a light that projects a texture into the scene, applying the projected texture to any geometry that intersects the parallel projection volume.
Parallel texture projection is shown in Figure 42.4.
The description field of this node tells the name of the perspective projector, and makes the division of different perspective projectors possible.
The location shows the position of the perspective projector, and this implies perspective projection point.
The direction is the way the perspective projector is heading, and this implies to perspective projection direction.
The fieldOfView is the extent of the observable texture that is seen on the parallel display at any given moment. This value may change depending on the aspect ratio of the rendering resolution. The default value of this field is (-1 -1 1 1).
The aspectRatio is the aspect ratio of the width and length which refers to perspective projection spect ratio.
The nearDistance and farDistance is the minimum and maximum distance that is shown on the screen, respectively.
global, on and texture fields are the same as illustrated in the Abstract node.
The Texture projection component defines levels of support as specified in Table 42.2.
Table 42.2 — Texture projection component support levels
Level | Prerequisites | Nodes/Features | Support |
---|---|---|---|
1 | Core 1 Grouping 1 Shape 1 Rendering 1 Texturing 1 |
||
X3DTextureProjectorNode | n/a | ||
TextureProjector | All fields fully supported. | ||
2 | Core 1 Grouping 1 Shape 1 Rendering 1 Texturing 1 |
||
TextureProjectorParallel | All fields fully supported. |