XD ja lol ^^
du musst natürlich beim image die Farbtiefe schon einstelen.. also beim pb-image (24 bit z.b.)
(dann gehts zumindest bei mir
hier code:
Bei mir funktioniert nur 24 bit ..(also createimage (23,23,24!!!) ^^

(Evtl nochmal einrücken etc.. aber muss noch ewigst english-lernen usw.. wir haben wieder ne fieße Test-phase und ich komm nirgens vorwärts o_O..
hoffe, es klappt auch bei dir, der Befehl
Code: Alles auswählen
;; ----------------------------------------------------------------------------
;; Irrlicht Wrapper For Imperative Languages - Purebasic Examples
;; IrrlichtWrapper and FreeBasic-Example by Frank Dodd (2006)
;; Improved IrrlichtWrapper - Michael Taupitz (2007)
;; PureBasic-Examples by Michael Taupitz (neotoma) & Marius Eckardt (Thalius)
;; ----------------------------------------------------------------------------
;; Example 04 : 3D Models - Meshes And Nodes
;; This example loads an MD2 model And adds it As a node To the scene
;; ----------------------------------------------------------------------------
EnableExplicit
DisableExplicit
;; Include the Irr3D-Requester.. wenn nicht geht: Xincludefile "irr3dRequester.pb" ; hernehmen und in nen ordner mit'm irr3drequester verschieben.
XIncludeFile #PB_Compiler_Home + "Examples\IrrlichtWrapper\Irr3DRequester.pb"
;; ////////////////////////////////////////////////////////////////////////////
;; Global variables
; irrlicht objects
Define *MD2Mesh.irr_mesh ;Pointer to the Mesh
Define *MeshTexture.irr_texture ;Pointer to the Texture
Define *SceneNode.irr_node ;Pointer to the SceneNode
Define *OurCamera.irr_camera ;Pointer to the Camera
; -----------------------------------------------------------------------------
; 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" )
IrrGuiAddStaticText( "Welcome to Irrlicht", 4,0,200,16, #IRR_GUI_NO_BORDER, #IRR_GUI_NO_WRAP )
*SceneNode = IrrAddCubeSceneNode(10)
IrrSetNodeMaterialFlag( *SceneNode, #IRR_EMF_LIGHTING, #IRR_OFF )
*OurCamera = IrrAddCameraMaya ( 0 , 180 , 200 , 200 ); 50,0,0, 0,0,0 )
CreateImage( 0 , 512 , 512 ,24) ; TEXTUR per PB erstellen
For x = 1 To 10 ; damit man mehr linien sieht ;)
If StartDrawing ( ImageOutput(0))
Line ( Random(512 ),Random(512 ),Random(512 ),Random(512 ),RGB(Random(255),Random(255),Random(255)))
Line ( Random(512 ),Random(512 ),Random(512 ),Random(512 ),RGB(Random(255),Random(255),Random(255)))
StopDrawing()
EndIf
Next
texture = IrrPBImage2Texture ( 0 , "wall.bmp" , 0)
IrrSetNodeMaterialTexture ( *SceneNode , texture ,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()
If getasynckeystate_(#VK_SPACE)
If StartDrawing ( ImageOutput(0))
Line ( Random(512 ),Random(512 ),Random(512 ),Random(512 ),RGB(Random(255),Random(255),Random(255)))
Line ( Random(512 ),Random(512 ),Random(512 ),Random(512 ),RGB(Random(255),Random(255),Random(255)))
StopDrawing()
EndIf
If texture ; droppen... k.a., was das enau macht ^^. hauptsache raus damit!!
IrrDropPointer( texture )
EndIf
texture = IrrPBImage2Texture ( 0 , "wall.bmp" , 0)
IrrSetNodeMaterialTexture ( *SceneNode , texture ,0 )
EndIf
; end drawing the scene and render it
IrrEndScene()
Wend
; -----------------------------------------------------------------------------
; Stop the irrlicht engine and release resources
IrrStop()
EndIf
End
mfg Max (Draufwalker

)
ps: als Beweis dasses bei mir hinhaut:
DOWNLOAD Exe
[EDIT]
habe gerade festgestellt, dass die texturen nicht gelöscht werden -> Vram = bumm.
mit löschen des nodes würden die (soweit ich weiß) allerdings auch rausgehaun werden... evtl mal thalius fragen, ob er ne "freetexture" einbaut, bei dem man nicht das node löschen muss.....
für gewöhnlich werden ja nodes ab gewisser entfernung sowieso removed (sollte man selbst einbauen.. LOD)
aber kk. muss jetz wieder weitermachen. hoffe, geholfen zu haben

immerhin weißte jetz, wie man ne textur selber erstellt

)
[/BlockEditEnde]