Assigning a texture to a scene object
A scene object that descends from TGLSceneObject (eg a sphere, cube, plane) has a material property and the material property specifies the texture that the GLScene object will use. To assign a texture from the material library set the materialLibrary in the material property to a GLMaterialLibrary. Then in the GLScene objects material property set the LibMaterialName to name of the material in the TGLMaterialLibrary. This to can be done design time. It is possible to set the material property on a scene object directly without using the material library. This has the disadvantage of the texture only being availabe to the scene object and not having properties available to TGLLibMaterial (eg texture offsetting, scaling, shading and applying a secondary texture).
Refer to the article loading a texture on how to load a texture.
skinhat
Comments (0)
You don't have permission to comment on this page.