
en ayant la methode c'est plus simple

dit moi si cela marche chez toi

on peut changer la phrase du debut

ce peut etre une solution pour creer des niveaux
en utilisant un dessin, qui represente des immeuble ou bien des murs
il suffirai alors de creer le dessin a plat , au lieu de verticalement comme ici

Merci encore ta solution me reconcilie avec Dreamotion

; Init different modules
; Fichiers Include
; voir le dreamotion3d.pbi pour le details des commandes reconnu
Text$= "Dreamotion3d Votre Moteur 3D " ; < changez ce text : D
Dim tableau(1024,15)
Enumeration
#fenetre
#Police
#curseur
#image
EndEnumeration
Structure cube
index.l
x.f
Y.f
z.f
EndStructure
Dim cube.cube(1024*15)
If InitSprite () = 0 Or InitKeyboard () = 0 Or InitMouse () = 0
End
EndIf
SetCurrentDirectory ( "media/" )
FontID = LoadFont ( #Police , "arial" , 18, #PB_Font_Bold )
EcranX = GetSystemMetrics_ ( #SM_CXSCREEN ): ;=largeur de l'ecran
EcranY = GetSystemMetrics_ ( #SM_CYSCREEN ): ;=hauteur de l'ecran
WindowID = OpenWindow ( #fenetre , 0, 0,EcranX,EcranY, "hello" , #PB_Window_SystemMenu|#PB_Window_BorderLess |#PB_Window_ScreenCentered )
Result = OpenWindowedScreen ( WindowID ( #fenetre ) ,0,0, EcranX,EcranY, 1, 0,0)
CreateImage ( #image ,1024,768,32)
StartDrawing ( ImageOutput ( #image ))
DrawText (0, 0,Text$ , RGB (255,255,255), RGB (0,0,0))
For Y =0 To 15
For x=0 To 1024
tableau(x,Y)= Point (x,Y)
Next x
Next Y
StopDrawing ()
CloseWindow ( #fenetre )
IncludePath "D:\PureBasic\dobro\Exemple Perso\3Dreammotion\Samples\Include\"
IncludeFile "D:\PureBasic\dobro\Exemple Perso\3Dreammotion\Samples\include\d3dx9.pbi"
IncludeFile "D:\PureBasic\dobro\Exemple Perso\3Dreammotion\Samples\include\dreamotion3d.pbi"
; demarre le moteur 3D
DM_Graphics3D(1024,768, 32, #False , #False ) ; Initialize graphic windows
*Camera = DM_CreateCamera( #Null ) ; on cree une camera
For Y =0 To 15
For x=0 To 1024
If tableau(x,Y)<>0
; creer un Cube
nb=nb+1
cube(nb)\index=DM_CreateCube.l( #Null ) ; on peut creer un Cube
scalex.f=4: scaley.f=4: scalez.f=4
DM_ScaleEntity( cube(nb)\index, scalex.f, scaley.f, scalez.f) ;
posxe.f =x*10
posye.f=Y*10
posze.f=0
cube(nb)\x=posxe.f
cube(nb)\Y=posye.f
cube(nb)\z=posze.f
DM_PositionEntity( cube(nb)\index, cube(nb)\x, cube(nb)\Y, cube(nb)\z)
EndIf
Next x
Next Y
; **************** bouger la camera ********************
;- bouger camera
poz.f=500 ; avance/recule ; pour le terrain
posy.f=-100
DM_MoveEntity(*Camera, posx,posy,poz) ; on recule la camera
Rouge=0
Vert=10
Bleu=0
DM_CameraClsColor(*Camera, Rouge, Vert, Bleu) ; on choisi une couleur de fond
rotxc.f=-20 ; oui de la tete
rotyc.f=150 ; non de la tete
rotzc.f=180 ; droite gauche pour un avion
DM_TurnEntity(*Camera, rotxc.f, rotyc.f, rotzc.f)
; ****** Lumiere *****************
; cree une petite lumière, type POINT
;-creer une lumiere
light = DM_CreateLight(1, Null)
Red.w=255
Green.w=10
Blue.w=100
Alpha.w=2
DM_LightColor(light, Red.w, Green.w, Blue.w, Alpha.w) ; change la couleur de la lumiere
; *********************************
Repeat
ExamineKeyboard ()
ExamineMouse ()
ShowCursor_ (1)
If KeyboardReleased ( #PB_Key_Escape ) Or WindowEvent ()= #PB_Event_CloseWindow
Quit=1
ElseIf KeyboardPushed ( #PB_Key_Up )
poz=1
DM_MoveEntity(*Camera, 0,0,0.8 ) ; on recule/avance la camera
ElseIf KeyboardPushed ( #PB_Key_Down )
poz=-1
DM_MoveEntity(*Camera, 0,0,-0.8 ) ; on recule/avance la camera
ElseIf KeyboardPushed ( #PB_Key_Left )
;rotx.f=30 ; oui de la tete
rotyc.f= rotyc.f+0.8 ; non de la tete
;rotz.f=0; droite gauche pour un avion
DM_RotateEntity(*Camera, rotxc.f, rotyc.f, rotzc.f)
ElseIf KeyboardPushed ( #PB_Key_Right )
; rotx.f=30 ; oui de la tete
rotyc.f=rotyc.f-0.8 ; non de la tete
; rotz.f=0; droite gauche pour un avion
DM_RotateEntity(*Camera, rotxc.f, rotyc.f, rotzc.f)
EndIf
If MouseButton ( #PB_MouseButton_Left )
Quit=1
EndIf
DM_TurnEntity(*Camera, - MouseDeltaY ()/8,- MouseDeltaX ()/8,0)
translatex.f=-0.6
translatey.f=0
translatez.f=0
For nume=1 To nb
DM_TranslateEntity(cube(nume)\index, translatex, translatey, translatez, glob.b= #False )
Next nume
; Render c'es ce qui permet de voir le resultat !
DM_BeginScene()
DM_RenderWorld()
DM_EndScene()
; *************************************
Until Quit=1
DM_ClearGraphics()
End