Alle im Doku beschriebenen Objekt Formate kannst du als Mesh laden.
Und na klar kannst du da Kollisionen benutzen.. schau dir mal das Collision example an. Um ein sehr komplexes Mesh welches du zb. als level Grundlage erstellst mit einer schnellen Kollision zu versehen solltest du dieses wie oben beschrieben als "Octree" hinzufügen.
Wie Du das Machst.. siehe Irrwrapper Beispiel 04:
Code: Alles auswählen
;; ----------------------------------------------------------------------------
;; Irrlicht Wrapper For Imperative Languages - Purebasic Examples
;; IrrlichtWrapper and FreeBasic-Example by Frank Dodd (2006)
;; Improved IrrlichtWrapper and PureBasic-Example by Michael Taupitz (2006)
;; ----------------------------------------------------------------------------
;; Example 04 : 3D Models - Meshes And Nodes
;; This example loads an MD2 model And adds it As a node To the scene
;; ----------------------------------------------------------------------------
;; ////////////////////////////////////////////////////////////////////////////
;; Includes For extension libraries
XIncludeFile "IrrlichtWrapper.pbi"
;; ////////////////////////////////////////////////////////////////////////////
;; Init the DLL
InitIrrlichtWrapperDll()
;; Include the Irr3D-Requester
XIncludeFile "Irr3DRequester.pb"
;; ////////////////////////////////////////////////////////////////////////////
;; Global variables
; irrlicht objects
*MD2Mesh.irr_mesh
*MeshTexture.irr_texture
*SceneNode.irr_node
*OurCamera.irr_camera
;; ////////////////////////////////////////////////////////////////////////////
;; GDB debugger main() function
; -----------------------------------------------------------------------------
; To Start the Irrlicht-Device we use the Irr3DRequester, to make it more comfortable
; for the Users, and also easier to test different resolutions and devices.
If Irr3DRequester()
; set the window caption
IrrSetWindowCaption( "Example 04: 3D Models - Meshes and Nodes" )
; add credits for the model as a static text GUI object on the display
IrrGuiAddStaticText( "Welcome to Irrlicht", 4,0,200,16, #IRR_GUI_NO_BORDER, #IRR_GUI_NO_WRAP )
; load a mesh this acts as a blue print for the model
*MD2Mesh = IrrGetMesh( "..\media\sydney.md2" )
; load texture resources for texturing the scene nodes
*MeshTexture = IrrGetTexture( "..\media\sydney.bmp" )
; add the mesh to the scene as a new node, the node is an instance of the
; mesh object supplied here
*SceneNode = IrrAddMeshToScene( *MD2Mesh )
; apply a material to the node to give its surface color
IrrSetNodeMaterialTexture( *SceneNode, *MeshTexture, 0 )
; switch off lighting effects on this model, as there are no lights in this
; scene the model would otherwise render pule black
IrrSetNodeMaterialFlag( *SceneNode, #IRR_EMF_LIGHTING, #IRR_OFF )
; play an animation sequence embeded in the mesh. MD2 models have a group of
; preset animations for various poses and actions. this animation sequence is
; the character standing idle
IrrPlayNodeMD2Animation( *SceneNode, #IRR_EMAT_STAND )
; add a camera into the scene, the first co-ordinates represents the 3D
; location of our view point into the scene the second co-ordinates specify the
; target point that the camera is looking at
*OurCamera = IrrAddCamera( 50,0,0, 0,0,0 )
; -----------------------------------------------------------------------------
; while the irrlicht environment is still running
While IrrRunning()
; begin the scene, erasing the canvas with sky-blue before rendering
IrrBeginScene( 240, 255, 255 )
; draw the scene
IrrDrawScene()
; draw the GUI
IrrDrawGUI()
; end drawing the scene and render it
IrrEndScene()
Wend
; -----------------------------------------------------------------------------
; Stop the irrlicht engine and release resources
IrrStop()
EndIf
;; ////////////////////////////////////////////////////////////////////////////
;; Free the DLL
FreeIrrlichtWrapperDll()
ändere mal...
Code: Alles auswählen
*MD2Mesh = IrrGetMesh( "pfad\zu\3dsmesh" )
...
*MeshTexture = IrrGetTexture( "pfad\zu\textur\für\mesh" )
...
und zum Lightmappen und Szenen erstellen kannst du als Alternative zu Deled auch mal IrrEdit (
http://www.ambiera.com/irredit/ ) ausprobiern.
Nochwas irrlicht kann 4 Texturen pro Objekt laden, als Tip solltest du diese ned "verschwenden". Idealerweise benutzt du eine als "Diffusemap", "Lightmap", "Bumpmap", "Spec-Map" ... mit den 4 Typen kannst du Photorealistische Ergebnisse erziehlen .. aber zum Anfangen empfiel ich dir mal mit einer Textur pro Mesh zu arbeiten die du UV mappst ( Wings iss ganz gut dafür ).
Ausserdem achte drauf das deine verwendeten Texturen durch 8 teilbar sind .. typischerweise 128x128 , 256x256, 512x512 usw.
16 Bit texturen brauchen auch noch halb soviel Speicher ( den Grafikspeicher solltest du im Auge behalten ... Texturen brauchen jeweils die volle unkomprimierte Speichermenge im Grafikspeicher. Desto geschickter du mit Texturen etc umgehst desto schneller wird deine Szenery gerendert und speziell desto besser wird das ganze aussehen.
Hier ein altes Beispiel einer Kirche:
Und die UV gemappte Textur dazu:
Thalius