public class SoVRMLImageTexture extends SoVRMLTexture
SoVRMLImageTexture
node defines a texture map by specifying an image file and general parameters for mapping to geometry. Texture maps are defined in a 2D coordinate system, (s,t), that ranges from 0.0 to 1.0 in both directions. The bottom edge of the image corresponds to the S-axis of the texture map, and left edge of the image corresponds to the T-axis of the texture map. The lower-left pixel of the image corresponds to s=0, t=0, and the top-right pixel of the image corresponds to s=1, t=1.
<font color="#0000FF">NOTE:</font> This class does not exist in Open Inventor 10.0 and later.
Texture images may be one component (grayscale), two component (grayscale plus transparency), three component (full RGB color), or four-component (full RGB color plus transparency).
The repeatS and repeatT fields specify how the texture wraps in the S and T directions. If repeatS is true (the default), the texture map is repeated outside the 0-to-1 texture coordinate range in the S direction so that it fills the shape. If repeatS is false, the texture coordinates are clamped in the S direction to lie within the 0-to-1 range. The repeatT field is analogous to the repeatS field.
If the texture image's width or height is not a power of 2, or the image's width or height is greater than the maximum supported by OpenGL, then the image will be automatically scaled up or down to the next power of 2 or the maximum texture size. For maximum speed, point-sampling is used to do the scale; if you want more accurate resampling, pre-filter images to a power of 2 smaller than the maximum texture size (use the OpenGL glGetIntegerv(GL_MAX_TEXTURE_SIZE...) call to determine maximum texture for a specific OpenGL implementation).
The quality of the texturing is affected by the textureQuality field of the SoComplexity
node. The textureQuality field affects what kind of filtering is done to the texture when it must be minified or magnified. The mapping of a particular texture quality value to a particular OpenGL filtering technique is implementation dependent, and varies based on the texturing performance. If mipmap filtering is required, mipmaps are automatically created using the simple box filter.
Open Inventor can read GIF, JPEG, PNG, RGB (native Silicon Graphics format), TIFF, and BMP texture files.
Performance Note: Automatic scaling of texture images to a power of 2 is a very convenient feature for prototyping, but it does take additional time the first time the texture node is traversed for rendering. For large images, or a large number of images, this can make the application seem slow while starting up or loading a new data file. Avoid this effect by either pre-scaling the image or by storing it as a sub-image in a "power of 2" image (then provide explicit texture coordinates such that only the sub-image is used).
This section describes the expected behavior of the node in a conforming VRML97 browser application. In some cases, the application is responsible for implementing portions of the expected behavior. Open Inventor viewer classes and IVF classes implement some of the application behaviors.
This section may reference portions of the VRML97 specification that are not present in this help file. The complete VRML97 spec is available at
The SoVRMLImageTexture
node defines a texture map by specifying an image file and general parameters for mapping to geometry. Texture maps are defined in a 2D coordinate system, (s,t), that ranges from 0.0 to 1.0 in both directions. The bottom edge of the image corresponds to the S-axis of the texture map, and left edge of the image corresponds to the T-axis of the texture map. The lower-left pixel of the image corresponds to s=0, t=0, and the top-right pixel of the image corresponds to s=1, t=1.
The texture is read from the URL specified by the url
field. To turn off texturing, set the url
field to have no values ([]). Browsers are required to support the JPEG and PNG image file formats, and in addition, may support any other image formats. Support for the GIF format including transparent backgrounds is also recommended. See the section "Concepts - URLS
and URNs" for details on the url
field.
Texture images may be one component (grayscale), two component (grayscale plus transparency), three component (full RGB color), or four-component (full RGB color plus transparency). An ideal VRML implementation will use the texture image to modify the diffuse color and transparency of an object's material (specified in an SoVRMLMaterial
node), then perform any lighting calculations using the rest of the object's material properties with the modified diffuse color to produce the final image. The texture image modifies the diffuse color and transparency depending on how many components are in the image, as follows:
1. Diffuse color is multiplied by the grayscale values in the texture image.
2. Diffuse color is multiplied by the grayscale values in the texture image; material transparency is multiplied by transparency values in texture image.
3. RGB colors in the texture image replace the material's diffuse color.
4. RGB colors in the texture image replace the material's diffuse color; transparency values in the texture image replace the material's transparency.
See "Concepts - Lighting Model" for details on lighting equations and the interaction between textures, materials, and geometries.
Browsers may approximate this ideal behavior to increase performance. One common optimization is to calculate lighting only at each vertex and combining the texture image with the color computed from lighting (performing the texturing after lighting). Another common optimization is to perform no lighting calculations at all when texturing is enabled, displaying only the colors of the texture image.
The repeatS and repeatT fields specify how the texture wraps in the S and T directions. If repeatS is true (the default), the texture map is repeated outside the 0-to-1 texture coordinate range in the S direction so that it fills the shape. If repeatS is false, the texture coordinates are clamped in the S direction to lie within the 0-to-1 range. The repeatT field is analogous to the repeatS field.
File format/default:
VRMLImageTexture {
url | [] |
repeatS | true |
repeatT | true |
metadata | NULL |
Action behavior:
SoGLRenderAction
, SoCallbackAction
Sets: SoTextureImageElement
SoMFString | set_url |
SoSFNode | set_metadata |
SoMFString | url_changed |
SoSFNode | metadata_changed |
Modifier and Type | Class and Description |
---|---|
static class |
SoVRMLImageTexture.FileTypes
Deprecated.
FileType.
|
static class |
SoVRMLImageTexture.TextureImage
Deprecated.
|
Inventor.ConstructorCommand
Modifier and Type | Field and Description |
---|---|
static int |
BMP
Deprecated.
Use
SoVRMLImageTexture.FileTypes.BMP instead. |
static int |
DDS
Deprecated.
Use
SoVRMLImageTexture.FileTypes.DDS instead. |
static int |
GIF
Deprecated.
Use
SoVRMLImageTexture.FileTypes.GIF instead. |
static int |
HDRI
Deprecated.
Use
SoVRMLImageTexture.FileTypes.HDRI instead. |
static int |
JPEG
Deprecated.
Use
SoVRMLImageTexture.FileTypes.JPEG instead. |
static int |
JPEG2000
Deprecated.
Use
SoVRMLImageTexture.FileTypes.JPEG2000 instead. |
static int |
NUM_FILETYPES
Deprecated.
Use
SoVRMLImageTexture.FileTypes.NUM_FILETYPES instead. |
static int |
PGX
Deprecated.
Use
SoVRMLImageTexture.FileTypes.PGX instead. |
static int |
PNG
Deprecated.
Use
SoVRMLImageTexture.FileTypes.PNG instead. |
static int |
PNM
Deprecated.
Use
SoVRMLImageTexture.FileTypes.PNM instead. |
static int |
RAS
Deprecated.
Use
SoVRMLImageTexture.FileTypes.RAS instead. |
static int |
RGB
Deprecated.
Use
SoVRMLImageTexture.FileTypes.RGB instead. |
static int |
SGI
Deprecated.
Use
SoVRMLImageTexture.FileTypes.SGI instead. |
static int |
TIFF
Deprecated.
Use
SoVRMLImageTexture.FileTypes.TIFF instead. |
static int |
UNKNOWN
Deprecated.
Use
SoVRMLImageTexture.FileTypes.UNKNOWN instead. |
SoMFFilePathString |
url
Deprecated.
Filename (or URL) from which to read the texture image.
|
repeatS, repeatT
metadata
VERBOSE_LEVEL, ZeroHandle
Constructor and Description |
---|
SoVRMLImageTexture()
Deprecated.
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
allowPrequalifyFile(boolean name_30920)
Deprecated.
Sets the prequalify file flag.
|
SoVRMLImageTexture.FileTypes |
getBitmapFileType()
Deprecated.
|
SoVRMLImageTexture.TextureImage |
getImage()
Deprecated.
Query the image.
|
void |
setBitmapFileType(SoVRMLImageTexture.FileTypes in_type)
Deprecated.
|
affectsState, callback, copy, copy, distribute, doAction, getAlternateRep, getBoundingBox, getByName, getMatrix, getPrimitiveCount, getRenderUnitID, GLRender, GLRenderBelowPath, GLRenderInPath, GLRenderOffPath, grabEventsCleanup, grabEventsSetup, handleEvent, isBoundingBoxIgnoring, isOverride, pick, rayPick, search, setOverride, touch, write
copyFieldValues, copyFieldValues, enableNotify, fieldsAreEqual, get, getAllFields, getEventIn, getEventOut, getField, getFieldName, hasDefaultValues, isNotifyEnabled, set, setToDefaults
dispose, getEXTERNPROTO, getName, getPROTO, isDisposable, isSynchronizable, setName, setSynchronizable
getAddress, getNativeResourceHandle, startInternalThreads, stopInternalThreads
@Deprecated public static final int UNKNOWN
SoVRMLImageTexture.FileTypes.UNKNOWN
instead.@Deprecated public static final int RGB
SoVRMLImageTexture.FileTypes.RGB
instead.@Deprecated public static final int SGI
SoVRMLImageTexture.FileTypes.SGI
instead.@Deprecated public static final int TIFF
SoVRMLImageTexture.FileTypes.TIFF
instead.@Deprecated public static final int GIF
SoVRMLImageTexture.FileTypes.GIF
instead.@Deprecated public static final int JPEG
SoVRMLImageTexture.FileTypes.JPEG
instead.@Deprecated public static final int BMP
SoVRMLImageTexture.FileTypes.BMP
instead.@Deprecated public static final int PNG
SoVRMLImageTexture.FileTypes.PNG
instead.@Deprecated public static final int JPEG2000
SoVRMLImageTexture.FileTypes.JPEG2000
instead.@Deprecated public static final int PGX
SoVRMLImageTexture.FileTypes.PGX
instead.@Deprecated public static final int PNM
SoVRMLImageTexture.FileTypes.PNM
instead.@Deprecated public static final int RAS
SoVRMLImageTexture.FileTypes.RAS
instead.@Deprecated public static final int DDS
SoVRMLImageTexture.FileTypes.DDS
instead.@Deprecated public static final int HDRI
SoVRMLImageTexture.FileTypes.HDRI
instead.@Deprecated public static final int NUM_FILETYPES
SoVRMLImageTexture.FileTypes.NUM_FILETYPES
instead.public final SoMFFilePathString url
public SoVRMLImageTexture.FileTypes getBitmapFileType()
public SoVRMLImageTexture.TextureImage getImage()
public void setBitmapFileType(SoVRMLImageTexture.FileTypes in_type)
public void allowPrequalifyFile(boolean name_30920)
Generated on January 23, 2025, Copyright © Thermo Fisher Scientific. All rights reserved. http://www.openinventor.com