c'est bon je viens de trouver !!! c'etait juste un probleme de camera voici le bon code :
Code : Tout sélectionner
#PlayerSpeed = 50
#Speed=50
; Includes
IncludeFile "Screen3DRequester.pb"
DefType.f KeyX, KeyY, MouseX, MouseY
; Eumeration des constantes
Enumeration
#Entity
#Mesh
#Material
EndEnumeration
If InitEngine3D() ; Initialisation du moteur 3d
; Initialisation
InitKeyboard()
InitMouse()
InitSprite()
If Screen3DRequester()
Base$ = OpenFileRequester("Select .pk3 file", "Pak0.pk3", "*.pk3|*.pk3", 0)
If Base$ = "" : End : EndIf
Add3DArchive(Base$, #PB_3DArchive_Zip)
Add3DArchive("textures\" , #PB_3DArchive_FileSystem)
Add3DArchive("b.zip", #PB_3DArchive_Zip) ; Ajoute le .zip comme un répertoire possible
Add3DArchive("bouche\" , #PB_3DArchive_FileSystem)
Add3DArchive("Data\" , #PB_3DArchive_FileSystem)
; Chargement du bsp
If LoadWorld("b.bsp")
Restore Entete
Read NbPoints
Read NbNormales
Read Nbtriangles
CreateMesh(0)
SetMeshData(0,#PB_Mesh_Vertices , ?Points , NbPoints)
SetMeshData(0,#PB_Mesh_Triangles , ?Triangles , Nbtriangles)
SetMeshData(0,#PB_Mesh_UVCoordinates, ?Textures , NbPoints)
SetMeshData(0,#PB_Mesh_Normals , ?Normales , NbNormales)
;- Textures
;Indispensable pour l'image en jpg
UseJPEGImageDecoder()
LoadImage(0,"savant.jpg")
;/je recopie l'image dans la texture pour l'inverser , ça serait plus simple en enregistrant l'image inversée :)
;/Il suffirait alors de faire un simple LoadTexture(0,"Savant.jpg")
CreateTexture(0,ImageWidth(),ImageHeight())
StartDrawing(TextureOutput(0))
DrawImage(UseImage(0),0,0)
StopDrawing()
CreateMaterial(1, TextureID(0))
CreateEntity(0, MeshID(0), MaterialID(1), 100, 0, 0)
RotateEntity(0, 0, 90, 0)
MoveEntity(0,-300,100,35)
CreateLight(0, RGB(255,255,255), 100.0, 0, 0)
CreateLight(1, RGB(255,255,255), -100.0, 0, 0)
;CreateCamera(0, 0, 0, 100, 100)
;CameraLocate(0,0,50,200)
;CameraLookAt(0,EntityX(0),EntityY(0),EntityZ(0))
CreateCamera(0, 0, 0, 100, 100)
;Fog(RGB(237,69,27), 1, 100, 1000)
RotateCamera(0, -90, 0, 0)
MoveCamera(0, -50 , 50,500)
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, 0)
MoveCamera(0, KeyX, 0, KeyY)
RenderWorld()
FlipBuffers()
Until KeyboardPushed(#PB_Key_Escape) Or Quit = 1
Else
MessageRequester("Error", "Can't load the level", 0)
EndIf
EndIf
EndIf
XIncludeFile "savant.mesh"
; ExecutableFormat=Windows
; CursorPosition=64
; FirstLine=26
; Executable=C:\Ogre\Ogre_Windowed.exe
; EOF