OpenGL Library for Delphi,
maintained by Eric Grange,
based on Mike Lischke's GLScene.

 

Reference Manual - TGLTextureMappingMode


Specifies how a texture is mapped to a GLScene object. For example it is possible to have a teapot reflect a texture so as a teapot is moved the reflection changes similar to a real reflection. TGLTextureMappingMode is the class for the property mappingmode of TGLTexture.


TGLTextureMappingMode is the enumerated type:

TGLTextureMappingMode = (tmmUser, tmmObjectLinear, tmmEyeLinear, tmmSphere,tmmCubeMapReflection, tmmCubeMapNormal,tmmCubeMapLight0,tmmCubeMapCamera);

tmmUser: the user specifies how a texture is mapped onto an object. In GLScene this mapping is done for you. For example you dont have to map parts of a texture onto the vertices of a plane yourself. tmmUser is the default mapping mode.

The other mapping modes are automatic and dont require the user map the texture though the TGLTexture property mappingscoordinates and mappingtcoordinates gives some control.

tmmObjectLinear: The texture is projected onto the object. For example:

image

(Picture from Rosalee Wolfes site)

image


The texture is fixed to the object so if the object moves the texture will stay fixed to the object. The object is mapped with whatever section of the texture it is passing over. The way the texture is projected onto the object is specified by mappingscoordinates and mappingtcoordinates.


tmmEyeLinear: the texture is fixed in space. As you move the object through space the texture will change. For example as the teapot below is moved away the texture moves:

image

image


Note that if the imageclass isn't a 'Cubemap Image' then the behaviour seems similar to tmmObjectLinear. Mappingscoordinates and mappingtcoordinates specifies the orientation of the texture in space. The longer the axis vector the smaller the texture appears.

tmmSphere : wraps a single 2d texture as a sphere producing a reflective looking surface. As the object is moved the reflection moves like in real life. Problem of producing two singularities (ie the poles on a globe).

image

image


(Picture from Rosalee Wolfes site)
The rest of the mapping modes use cube mapping. Refer to the article about cube mapping for more information.

tmmCubeMapReflection: is similar to tmmSphere in that as an object is moved the reflection moves like in real life. But instead of a single 2D texture wrapped around like a sphere (like tmmSphere) 6 textures are places around the object as a cube map.

image

image


tmmCubeMapNormal:Similar to tmmCubeMapReflection except that the cube map is fixed to the objects surface rather than staying static in space therefore doesn't appear as a reflection.

image

image


Unit: GLTexture


  Attachment Size Date Added
    
There are no comments on this page. [Add comment]
Valid XHTML 1.0 Transitional :: Valid CSS :: Powered by Wikka Wakka Wiki 1.1.6.2
Page was generated in 0.1010 seconds