Function _IrrSetNodeMaterialTexture

au3Irr2

au3Irr2 Function Reference

_IrrSetNodeMaterialTexture

Applys a texture to a node in the scene.

#Include <au3Irrlicht2.au3>
_IrrSetNodeMaterialTexture($h_Node, $h_Texture, $i_Index)

 

Parameters

$h_Node Handle of a node in the scene
$h_Texture Handle of a texture object
$i_Index Material index number of the material layer, usually 0 or 1.

 

Return Value

Success: True
Failure: False

 

Remarks

How the texture is applied across the surface of the node will depend on the texturing coordinates in each of the vectors of the mesh and how they are plotted across the surface of the texture.
Some nodes can have several textures applied to them to create special material effects.

 

Related

_IrrSetNodeMaterialFlag, _IrrSetNodeMaterialType

 

Example


#include "au3Irrlicht2.au3"

_IrrStart()

local $camera = _IrrAddCamera(2,2,2, 0,0,0 )

local $mesh = _IrrGetMesh( ".\media\capsuleX.obj" )
local $sceneNode = _IrrAddMeshToScene( $mesh )

local $texture = _IrrGetTexture(".\media\default_texture.png")
_IrrSetNodeMaterialTexture( $sceneNode, $texture, 0)
_IrrSetNodeMaterialFlag( $sceneNode, $IRR_EMF_LIGHTING, $IRR_OFF )

WHILE _IrrRunning()
    _IrrBeginScene(50, 50, 50)
    _IrrDrawScene()
    _IrrEndScene()
WEND

_IrrStop()