The SEDRIS Data Representation Model
APPENDIX A - Classes Image Mapping Function |
---|
An instance of this DRM class specifies how the given <Image> is to be mapped onto a given textured object, including the mapping method, the projection, and how <Texture Coordinate> instances (if present) are to be treated if they fall outside the image space bounded by (0, 0), (1, 1).
An <Image> is mapped to a <Polygon>. The <Polygon> has <Texture Coordinate> instances at three or more of its <Vertex> components, the <Image> is mapped the <Polygon> using the <Texture Coordinate> instances. Each <Texture Coordinate> instance represents the location within the <Image> instance that lies on top of the <Vertex> instance corresponding to the given <Texture Coordinate> instance.
Consider a <Polygon> instance with two <Image> instances mapped to it. One <Image> could be the <Image> displayed for most cases. The second <Image>, if image_detail_mapping is SE_TRUE, would then be the imagery that is added to polygon when the eyepoint is so close to the polygon that the main image texels are no longer useful for texturing the polygon.
The <Texture Coordinate> instances on the attribute geometry always have the highest precedence. Next, if the attribute geometry has <Tack Point> instances, three conditions could occur.
If there is only one <Tack Point>, the <Tack Point> is used to locate the imagery, and the scaling and rotation information from the <Image Mapping Function> is used.
If two <Tack Point> instances are defined, the location and rotation of the imagery is taken from the <Tack Point> instances, but the scaling information is derived from the <Image Mapping Function>.
If there are three or more <Tack Point> instances, the position, rotation information is derived from the first three <Tack Point> instances. Since <Tack Point> components are unordered, the complete set of supplied <Tack Point> components shall define an orthogonal image projection. This is to insure that no matter which three <Tack Point> components are used, the same projection is derived for the imagery.
If the <Polygon> does not have <Texture Coordinate> or <Tack Point> components, then any <Image Anchor> components of the <Image Mapping Function> define the location of the image on the attribute geometry. If none of the previous conditions are met, then the <Image Anchor>s in the <Image> are used. If there are no <Texture Coordinate>s, no <Tack Point>s, no <Image Anchor>s in the <Image Mapping Function> and no anchor points in the <Image>, then the image mapping is undefined. It should be noted that the final two cases can be used to create non-orthogonal projections.
Since all texture mappings that are a result of texture coordinate mapping at the polygon level are defined to be orthogonal projections, a non-orthogonal projection cannot be created with <Texture Coordinate> instances.
To create a non-orthogonal projection, the <Image Anchor> points shall be used. These points are defined in the currently scoped "world" SRF, and therefore are not required to be in the plane of the <Polygon> instance. There is no method to create a non-orthogonal projection in the local SRF of the <Model>.
Rather than using <Texture Coordinate> instances to tie the <Image Mapping Function> instance to the textured object, use an <Image Anchor> instance. For a spherical projection, the <Image Anchor> instance's <Location> components are interpreted as follows:
The <Image Mapping Function> for this case specifies an <Image Anchor>, while the object to be textured does not specify <Texture Coordinate> instances. For details of how the <Image Anchor> specifies the cylindrical projection, see <Image Anchor>.
The rotation and scale of the image mapping can be derived from the <Location> instances representing the 3 corners of the <Image> instance, i.e., the <Location> components of the <Image Anchor> instance.
1.0 = 100% Primary colour, No Blend contribution
0.0 = no Primary contribution, %100 Blend Colour
An <Image Mapping Function> instance applies only to the front side of a <Primitive Geometry>. In the wall example, 2 <Polygon> instances would be needed, one with brick texture on its front side, facing the outside of the building, and the other with wallpaper, facing the inside of the building.
Any other representation would be lost in a rendering system that used back-face culling.
Note that <Presentation Domain> is optional only when the aggregating object(s) have one and only one <Image Mapping Function> component. If multiple <Image Mapping Function> instances are present, each shall have a distinct <Presentation Domain> component.
The image_mapping_method field specifies how to combine the referenced texture map with any <Colour> instances on the textured object.
The image_wrap_s field specifies whether to clamp or repeat the given <Image> instance in s.
The image_wrap_t field specifies whether to clamp or repeat the given <Image> instance in t.
The image_projection_type field specifies the type of projection to be used when applying the given <Image> instance to textured objects. 1) If planar projection is specified, the following cases may apply: - The object may have <Texture Coordinate> or <Tack Point> instances, in which case the <<Image Mapping Functions and Texture Coordinates>> constraint will apply. - The <Image Mapping Function> instance may have an <Image Anchor> instance. - The <Image> instance may have an <Image Anchor> instance. 2) If cylindrical or spherical projection is specified, the object shall not have <Texture Coordinate> or <Tack Point> instances. Instead, either the <Image Mapping Function> instance or its <Image> instance shall have an <Image Anchor> instance.
The intensity_level field specifies the percent contribution of the given <Image Mapping Function> instance to the total effect on the textured object. For an <Image> instance with a colour coordinate component specified by its signature, multiply first, second, and third colour coordinate values within the <Image> instance's texels by this value.
The value of the gain field is to be added to each colour data value from the texel data of the given <Image> instance to obtain the displayed image.
The image_detail_mapping field specifies whether the given <Image Mapping Function> instance is used to describe mapping of a "detail" image on the textured object.
|