Comme je n'avais pas ton fichier pour la texture, j'en ai créé une .
Et j'ai orienté la camera vers ton entity
CameraLookAt(0,EntityX(0),EntityY(0),EntityZ(0))
Et maintenant ,tout fonctionne .
C'est toi qui a fait le modèle ? il est super.
Code : Tout sélectionner
IncludeFile "Screen3DRequester.pb"
#Speed=5
DefType.f KeyX, KeyY, MouseX, MouseY
If InitEngine3D()
Add3DArchive("Data\" , #PB_3DArchive_FileSystem)
Add3DArchive("Data\camp.zip", #PB_3DArchive_Zip)
Add3DArchive("Data\savant.zip", #PB_3DArchive_Zip)
Add3DArchive("savant.zip", #PB_3DArchive_Zip)
InitSprite()
InitKeyboard()
InitMouse()
If Screen3DRequester()
If LoadMesh(0,"savant2.max.mesh")=0
End
EndIf
CreateTexture(0,64,64)
StartDrawing(TextureOutput(0))
Box(0,0,64,64,RGB(255,0,0))
StopDrawing()
CreateMaterial(1, TextureID(0))
CreateEntity(0, MeshID(0), MaterialID(1), 300, 0, 300)
CreateLight(0, RGB(0,0,255), 100.0, 0, 0)
CreateLight(1, RGB(255,0,0), -100.0, 0, 0)
CreateCamera(0, 0, 0, 100, 100)
CameraLocate(0,0,0,100)
CameraLookAt(0,EntityX(0),EntityY(0),EntityZ(0))
Repeat
Screen3DEvents()
If ExamineKeyboard()
If KeyboardPushed(#PB_Key_Left)
KeyX = -1
ElseIf KeyboardPushed(#PB_Key_Right)
KeyX = 1
Else
KeyX = 0
EndIf
If KeyboardPushed(#PB_Key_Up)
KeyY = -#Speed
ElseIf KeyboardPushed(#PB_Key_Down)
KeyY = #Speed
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(0,0.5,0,0)
RotateCamera(0, MouseX, MouseY, RollZ)
MoveCamera (0, KeyX, 0, KeyY)
RenderWorld()
FlipBuffers()
Until KeyboardPushed(#PB_Key_Escape) Or Quit = 1
EndIf
Else
MessageRequester("Error", "The 3D Engine can't be initialized",0)
EndIf
End
; ExecutableFormat=Windows
; DisableDebugger
; EOF