Wollte mal fragen ob schon einer mal mit PB4Beta Milkshape-Modelle mit dem OgreExporter in Purebasic zur Animation gebracht hat. Alles bei mit funktioniert. Modell steht,dieTexturen stehen. Nur die Animation wenn ich diese über den Exporter wandle und in Purebasic einfüge, bekomme ich eine Fehlermeldung bei RenderWorld mit Invalid Memory Access . Mach ich was falsch?
Code: Alles auswählen
IncludeFile "Screen3DRequester.pb"
Define.f KeyX, KeyY, MouseX, MouseY
#RobotMesh = 0
#RobotTexture = 0
#Robot = 0
If InitEngine3D()
Add3DArchive("Data2\" , #PB_3DArchive_FileSystem)
Add3DArchive("Data2\Skybox.zip", #PB_3DArchive_Zip)
InitSprite()
InitKeyboard()
InitMouse()
If Screen3DRequester()
LoadMesh (#RobotMesh , "Figur.mesh")
;LoadTexture(#RobotTexture, "panzer.jpg")
Parse3DScripts()
;CreateMaterial(0, TextureID(#RobotTexture))
CreateEntity(#Robot, MeshID(#RobotMesh), #PB_Material_None)
;EntityMaterial(#Robot, MaterialID(0))
;AnimateEntity(#Robot, "Walk")
;DisableMaterialLighting(0, 1)
;MaterialAmbientColor(0, RGB(100, 100, 100))
;MaterialSpecularColor(0, RGB(255, 255, 255))
;ScrollMaterial(0, 0.15, 0, 1)
CreateLight(0, RGB(255,255,255), 100.0, 100.0, 100.0)
LightSpecularColor(0, RGB(255, 255, 255))
;SkyBox("Stevecube.jpg")
CreateCamera(0, 0, 0, 100, 100)
CameraLocate(0,0,0,100)
CameraBackColor(0, RGB(0, 0, 255))
Repeat
Screen3DEvents()
ClearScreen(RGB(0, 0, 255))
If ExamineKeyboard()
If KeyboardPushed(#PB_Key_Left)
KeyX = KeyX-1
ElseIf KeyboardPushed(#PB_Key_Right)
KeyX = KeyX+1
;Else
; KeyX = 0
EndIf
If KeyboardPushed(#PB_Key_Up)
KeyY = -1
ElseIf KeyboardPushed(#PB_Key_Down)
KeyY = 1
Else
KeyY = 0
EndIf
If KeyboardPushed(#PB_Key_PageUp)
RollZ = 3
Else
RollZ = 0
EndIf
If KeyboardPushed(#PB_Key_Add)
Frame.f+0.005
EndIf
EndIf
If ExamineMouse()
MouseX = -MouseDeltaX()/10
MouseY = -MouseDeltaY()/10
EndIf
RotateEntity(#Robot, KeyX, 0, 0)
RotateCamera(0, MouseX, MouseY, RollZ)
MoveCamera (0, 0, 0, KeyY)
RenderWorld()
Screen3DStats()
FlipBuffers()
Until KeyboardPushed(#PB_Key_Escape) Or Quit = 1
EndIf
Else
MessageRequester("Error", "The 3D Engine can't be initialized",0)
EndIf
End