au3Irr2 Function Reference
_IrrWriteMeshWrite the first frame of the supplied animated mesh out to a file using the specified file format.
#Include <au3Irrlicht2.au3>
_IrrWriteMesh($h_Mesh, $i_FileFormat, $s_Filename)
Parameters
$h_Mesh | Handle to mesh object |
$i_FileFormat | Format to write the file as: $EMWT_IRR_MESH - Irrlicht Native mesh writer, for static .irrmesh files. $EMWT_COLLADA - COLLADA mesh writer for .dae and .xml files. $EMWT_STL - STL mesh writer for .stl files. |
$s_Filename | File name to save as. |
Return Value
Success: TrueFailure: False and set @error
@error 1 - AutoIt DllCall failed.
@error 2 - Could not get mesh writer object.
@error 3 - Could not open file.
Remarks
None
Related
_IrrCreateMesh, _IrrGetMesh
Example
#include "au3Irrlicht2.au3"
Global $hMD2Mesh
Global $hMeshTexture
Global $hSceneNode
Global $hCamera
Global $hIrrMesh
Global $sIrrMesh = "ZumlinStaticMesh.irrmesh"
_IrrStart()
$hMD2Mesh = _IrrGetMesh("./media/zumlin.md2")
$hMeshTexture = _IrrGetTexture("./media/zumlin.pcx")
$hSceneNode = _IrrAddMeshToScene($hMD2Mesh)
_IrrSetNodeMaterialTexture($hSceneNode, $hMeshTexture, 0)
_IrrSetNodeMaterialFlag($hSceneNode, $IRR_EMF_LIGHTING, $IRR_OFF)
_IrrSetNodePosition($hSceneNode, 0, 0, 20)
If _IrrWriteMesh($hMD2Mesh, $EMWT_IRR_MESH, $sIrrMesh) And FileExists($sIrrMesh) Then
$hIrrMesh = _IrrGetMesh($sIrrMesh)
$hSceneNode = _IrrAddMeshToScene($hIrrMesh)
_IrrSetNodeMaterialTexture($hSceneNode, $hMeshTexture, 0)
_IrrSetNodeMaterialFlag($hSceneNode, $IRR_EMF_LIGHTING, $IRR_OFF)
_IrrSetNodePosition($hSceneNode, 0, 0, -20)
FileDelete($sIrrMesh)
EndIf
$hCamera = _IrrAddCamera(50, 0, 0, 0, 0, 0)
While _IrrRunning()
_IrrBeginScene(240, 255, 255)
_IrrDrawScene()
_IrrEndScene()
WEnd
_IrrStop()