Si ce que tu cherches à faire c'est juste d'afficher une courbe en 3D, c'est vraiment simple !
Il te suffit d'afficher les points en ne tenant compte que des composantes (x,y) par exemple.
Si tu veux faire des rotations, tu fais des changements de repère (rotation / translation / etc ) avec tes points.
Par contre, avec la vrai 3D, il me semble que tu peux arriver à ton résultat avec la bibliothèque Spline !
@Dobro : arrête de remplir les posts avec des codes que t'as pondu qui font des kilomètres de long. On sait que t'es pas un novice, et ça n'a rien a faire ici
Répondre simplement, rapidement, et gentiment ! Point.
(Surtout va pas te fâcher, tu réponds souvent bien, c'est pour ça que là, je me permet de relever ce que je trouve qui ne va pas.)
un code exemple qui affiche de manière "plate" des sphères. (les touches du pavé numérique pour faire les rotations)
Les coordonnées de chaque sphères sont calculées en triplés (x,y,z), puis les points sont affichés en faisant quelques opérations de rotation.
J'avais un fait un code qui représentait une fonction de deux variables f(x,y), mais le code n'est plus à jour avec la version de purebasic et prendrais trop de temps à adapter pour ici
Code : Tout sélectionner
; tr = 40
; mo = 20
tr = 10
mo = 10
l = 50
dimension = tr * mo - 1
dimension_t = mo - 1
Procedure.d Convert1(degre.d, radian.d) ; Convertti un nombre en degré en radian ou si degre = 0, le contraire
If degre = 0
ProcedureReturn ((180 * radian) / #PI)
EndIf
ProcedureReturn ((#PI * degre) / 180)
EndProcedure
Procedure FillTriangle(x1, y1, x2, y2, x3, y3, color)
For boucle = 0 To 1
If x1 > x2 : x = x2 : x2 = x1 : x1 = x : y = y2 : y2 = y1 : y1 = y : EndIf
If x2 > x3 : x = x3 : x3 = x2 : x2 = x : y = y3 : y3 = y2 : y2 = y : EndIf
Next
If x1 = x2
Else
a.d = (y2 - y1) / (x2 - x1)
b.d = y2 - a * x2
a1.d = (y1 - y3) / (x1 - x3)
b1.d = y3 - a1 * x3
For x = x1 To x2
LineXY(x, a * x + b, x, a1 * x + b1, color)
Next
EndIf
If x2 = x3
Else
a.d = (y2 - y3) / (x2 - x3)
b.d = y2 - a * x2
a1.d = (y1 - y3) / (x1 - x3)
b1.d = y1 - a1 * x1
For x = x2 To x3
LineXY(x, a * x + b, x, a1 * x + b1, color)
Next
EndIf
EndProcedure
Structure FACE
x1.d
y1.d
z1.d
x2.d
y2.d
z2.d
x3.d
y3.d
z3.d
x4.d
y4.d
z4.d
z_min.d
color.l
EndStructure
Structure List
dimension.l
adresse.l
x.d
y.d
z.d
EndStructure
Procedure Cube(*objet.FACE, centre_x, centre_y, centre_z, cote); le tableau objet devrait faire 5 en taille, pour ne pas generer des erreurs
Dim obj_cube.FACE(5)
cote / 2
;{ calcul des faces
obj_cube(0)\x1 = centre_x - cote
obj_cube(0)\x2 = centre_x - cote
obj_cube(0)\x3 = centre_x + cote
obj_cube(0)\x4 = centre_x + cote
obj_cube(0)\y1 = centre_y + cote
obj_cube(0)\y2 = centre_y - cote
obj_cube(0)\y3 = centre_y - cote
obj_cube(0)\y4 = centre_y + cote
obj_cube(0)\z1 = centre_z + cote
obj_cube(0)\z2 = centre_z + cote
obj_cube(0)\z3 = centre_z + cote
obj_cube(0)\z4 = centre_z + cote
obj_cube(0)\z_min = centre_z + cote
obj_cube(0)\color = RGB(255, 0, 0)
obj_cube(1)\x1 = centre_x - cote
obj_cube(1)\x2 = centre_x - cote
obj_cube(1)\x3 = centre_x + cote
obj_cube(1)\x4 = centre_x + cote
obj_cube(1)\y1 = centre_y + cote
obj_cube(1)\y2 = centre_y + cote
obj_cube(1)\y3 = centre_y + cote
obj_cube(1)\y4 = centre_y + cote
obj_cube(1)\z1 = centre_z + cote
obj_cube(1)\z2 = centre_z - cote
obj_cube(1)\z3 = centre_z - cote
obj_cube(1)\z4 = centre_z + cote
obj_cube(1)\z_min = centre_z - cote
obj_cube(1)\color = RGB(255, 255, 0)
obj_cube(2)\x1 = centre_x - cote
obj_cube(2)\x2 = centre_x - cote
obj_cube(2)\x3 = centre_x + cote
obj_cube(2)\x4 = centre_x + cote
obj_cube(2)\y1 = centre_y + cote
obj_cube(2)\y2 = centre_y - cote
obj_cube(2)\y3 = centre_y - cote
obj_cube(2)\y4 = centre_y + cote
obj_cube(2)\z1 = centre_z - cote
obj_cube(2)\z2 = centre_z - cote
obj_cube(2)\z3 = centre_z - cote
obj_cube(2)\z4 = centre_z - cote
obj_cube(2)\z_min = centre_z - cote
obj_cube(2)\color = RGB(255, 0, 255)
obj_cube(3)\x1 = centre_x - cote
obj_cube(3)\x2 = centre_x - cote
obj_cube(3)\x3 = centre_x + cote
obj_cube(3)\x4 = centre_x + cote
obj_cube(3)\y1 = centre_y - cote
obj_cube(3)\y2 = centre_y - cote
obj_cube(3)\y3 = centre_y - cote
obj_cube(3)\y4 = centre_y - cote
obj_cube(3)\z1 = centre_z + cote
obj_cube(3)\z2 = centre_z - cote
obj_cube(3)\z3 = centre_z - cote
obj_cube(3)\z4 = centre_z + cote
obj_cube(3)\z_min = centre_z - cote
obj_cube(3)\color = RGB(0, 255, 255)
obj_cube(4)\x1 = centre_x - cote
obj_cube(4)\x2 = centre_x - cote
obj_cube(4)\x3 = centre_x - cote
obj_cube(4)\x4 = centre_x - cote
obj_cube(4)\y1 = centre_y + cote
obj_cube(4)\y2 = centre_y + cote
obj_cube(4)\y3 = centre_y - cote
obj_cube(4)\y4 = centre_y - cote
obj_cube(4)\z1 = centre_z + cote
obj_cube(4)\z2 = centre_z - cote
obj_cube(4)\z3 = centre_z - cote
obj_cube(4)\z4 = centre_z + cote
obj_cube(4)\z_min = centre_z - cote
obj_cube(4)\color = RGB(0, 255, 0)
obj_cube(5)\x1 = centre_x + cote
obj_cube(5)\x2 = centre_x + cote
obj_cube(5)\x3 = centre_x + cote
obj_cube(5)\x4 = centre_x + cote
obj_cube(5)\y1 = centre_y + cote
obj_cube(5)\y2 = centre_y + cote
obj_cube(5)\y3 = centre_y - cote
obj_cube(5)\y4 = centre_y - cote
obj_cube(5)\z1 = centre_z + cote
obj_cube(5)\z2 = centre_z - cote
obj_cube(5)\z3 = centre_z - cote
obj_cube(5)\z4 = centre_z + cote
obj_cube(5)\z_min = centre_z - cote
obj_cube(5)\color = RGB(0, 0, 255)
;}
; copie du tableau passer en parametre
CopyMemory(obj_cube(), *objet, SizeOf(FACE) * 6)
EndProcedure
Procedure Sphere(*objet.FACE, centre_x.d, centre_y.d, centre_z.d, rayon.d, tranche, morceau, color)
Dim Obj_S.FACE(tranche * morceau - 1)
epais.d = rayon * 2 / tranche
ang.d = 2 * #PI / morceau
c = 0
For a = 1 To tranche
dist.d = Abs((a - 1) * epais - rayon)
dist = rayon * rayon - dist * dist
If dist < 0 : dist = 0 : EndIf
ray_pla_1.d = Sqr(dist)
dist.d = Abs(a * epais - rayon)
dist = rayon * rayon - dist * dist
If dist < 0 : dist = 0 : EndIf
ray_pla.d = Sqr(dist)
For b = 1 To morceau
Obj_S(c)\x1 = ray_pla * Cos(ang * (b - 1)) + centre_x
Obj_S(c)\x2 = ray_pla_1 * Cos(ang * (b - 1)) + centre_x
Obj_S(c)\x3 = ray_pla_1 * Cos(b * ang) + centre_x
Obj_S(c)\x4 = ray_pla * Cos(b * ang) + centre_x
Obj_S(c)\y1 = a * epais - rayon + centre_y
Obj_S(c)\y2 = (a - 1) * epais - rayon + centre_y
Obj_S(c)\y3 = (a - 1) * epais - rayon + centre_y
Obj_S(c)\y4 = a * epais - rayon + centre_y
Obj_S(c)\z1 = ray_pla * Sin(ang * (b - 1)) + centre_z
Obj_S(c)\z2 = ray_pla_1 * Sin(ang * (b - 1)) + centre_z
Obj_S(c)\z3 = ray_pla_1 * Sin(b * ang) + centre_z
Obj_S(c)\z4 = ray_pla * Sin(b * ang) + centre_z
; Obj_S(c)\color = RGB(255 * b / morceau, 0, 255 * a / tranche)
Obj_S(c)\color = color
c + 1
Next
Next
CopyMemory(obj_S(), *objet, SizeOf(FACE) * tranche * morceau)
Dim Obj_S.FACE(0)
EndProcedure
Procedure Tube(*objet.FACE, x1.d, y1.d, z1.d, x2.d, y2.d, z2.d, rayon.d, morceau.l, color.l)
Dim Obj_T.FACE(morceau - 1)
a.d = x2 - x1
b.d = y2 - y1
c.d = z2 - z1
dist.d = Sqr(a * a + b * b + c * c)
a = rayon * a / dist
b = rayon * b / dist
c = rayon * c / dist
distab.d = Sqr(a * a + b * b)
If distab
alpha.d = ACos(a / distab)
If b < 0
alpha = - alpha
EndIf
Else
alpha.d = 0
EndIf
If rayon
phi.d = ACos(distab / rayon)
If c < 0
phi = -phi
EndIf
Else
phi.d = 0
EndIf
ang.d = 2 * #PI / morceau
cos_alpha.d = Cos(alpha)
sin_alpha.d = Sin(alpha)
cos_phi.d = Cos(phi)
sin_phi.d = Sin(phi)
For curs = 0 To morceau - 1
Obj_T(curs)\x1 = rayon * (-Sin(curs * ang) * sin_phi * cos_alpha - Cos(curs * ang) * sin_alpha) + x1
Obj_T(curs)\x2 = rayon * (-Sin(curs * ang + ang) * sin_phi * cos_alpha - Cos(curs * ang + ang) * sin_alpha) + x1
Obj_T(curs)\x3 = rayon * (-Sin(curs * ang + ang) * sin_phi * cos_alpha - Cos(curs * ang + ang) * sin_alpha) + x2
Obj_T(curs)\x4 = rayon * (-Sin(curs * ang) * sin_phi * cos_alpha - Cos(curs * ang) * sin_alpha) + x2
Obj_T(curs)\y1 = rayon * (-Sin(curs * ang) * sin_phi * sin_alpha + Cos(curs * ang) * cos_alpha) + y1
Obj_T(curs)\y2 = rayon * (-Sin(curs * ang + ang) * sin_phi * sin_alpha + Cos(curs * ang + ang) * cos_alpha) + y1
Obj_T(curs)\y3 = rayon * (-Sin(curs * ang + ang) * sin_phi * sin_alpha + Cos(curs * ang + ang) * cos_alpha) + y2
Obj_T(curs)\y4 = rayon * (-Sin(curs * ang) * sin_phi * sin_alpha + Cos(curs * ang) * cos_alpha) + y2
Obj_T(curs)\z1 = rayon * (Sin(curs * ang) * cos_phi) + z1
Obj_T(curs)\z2 = rayon * (Sin(curs * ang + ang) * cos_phi) + z1
Obj_T(curs)\z3 = rayon * (Sin(curs * ang + ang) * cos_phi) + z2
Obj_T(curs)\z4 = rayon * (Sin(curs * ang) * cos_phi) + z2
Obj_T(curs)\color = color
Next
CopyMemory(Obj_T(), *objet, SizeOf(FACE) * morceau)
Dim Obj_T.FACE(0)
EndProcedure
Procedure Tore(*objet.FACE, centre_x, centre_y, centre_z, rayon_tore, dist_centre_cercle, tranche, morceau)
Dim Obj_T.FACE(tranche * morceau - 1)
ang1.d = 2 * #PI / tranche
ang.d = 2 * #PI / morceau
CopyMemory(obj_T(), *objet, SizeOf(FACE) * tranche * morceau)
Dim Obj_T.FACE(0)
EndProcedure
Procedure Display_3D(*objet.FACE, dimension, x_center.l, y_center.l, rotX.d, rotY.d, rotZ.d, Effect_rotation.l, zoom.d, zooZ.d, facteur_perspective.d, mode.l)
; rotX.d ; angle en degré de rotation sur l'axe X
; rotY.d ; angle en degré de rotation sur l'axe Y
; rotZ.d ; angle en degré de rotation sur l'axe Z
; Effect_rotation.l ; 1 pour effectuer la rotation ou la 1ere fois, 0 sinon (juste pour affichage)
; zoom.d ; facteur de zoom apppliquer a toute les axes
; zooZ.d ; facteur de zoom apppliquer a l'axe Z
; facteur_perspective.d ; facteur de 'perspective' , 0 pour pas de perspective
If Effect_rotation = 1
; copie du tableau passé en parametre
Dim Obj.FACE(dimension)
CopyMemory(*objet, Obj(), SizeOf(FACE) * (dimension + 1))
; convertion des angles en radian
rotx = Convert1(rotx, 0)
roty = Convert1(roty, 0)
rotz = Convert1(rotz, 0)
angle.d = 0
;{ rotation
For curs = 0 To dimension
For point = 1 To 4
If point = 1
X.d = Obj(curs)\x1
Y.d = Obj(curs)\y1
Z.d = Obj(curs)\z1
ElseIf point = 2
X.d = Obj(curs)\x2
Y.d = Obj(curs)\y2
Z.d = Obj(curs)\z2
ElseIf point = 3
X.d = Obj(curs)\x3
Y.d = Obj(curs)\y3
Z.d = Obj(curs)\z3
ElseIf point = 4
X.d = Obj(curs)\x4
Y.d = Obj(curs)\y4
Z.d = Obj(curs)\z4
EndIf
X * zoom
Y * zoom
Z * zoom * zooZ
If rotz ; rotation autour de z
dist.d = Sqr(X * X + Y * Y)
If dist
angle = ACos(X / dist)
If Y < 0
angle = - angle
EndIf
angle + rotz
X = dist * Cos(angle)
Y = dist * Sin(angle)
EndIf
EndIf
If roty ; rotation autour de y
dist.d = Sqr(Z * Z + X * X)
If dist
angle = ACos(Z / dist)
If X < 0
angle = - angle
EndIf
angle + roty
Z = dist * Cos(angle)
X = dist * Sin(angle)
EndIf
EndIf
If rotx ; rotation autour de x
dist.d = Sqr(Y * Y + Z * Z)
If dist
angle = ACos(Y / dist)
If Z < 0
angle = - angle
EndIf
angle + rotx
Y = dist * Cos(angle)
Z = dist * Sin(angle)
EndIf
EndIf
If point = 1
Obj(curs)\x1 = X.d
Obj(curs)\y1 = Y.d
Obj(curs)\z1 = Z.d
Obj(curs)\z_min = Z
ElseIf point = 2
Obj(curs)\x2 = X.d
Obj(curs)\y2 = Y.d
Obj(curs)\z2 = Z.d
ElseIf point = 3
Obj(curs)\x3 = X.d
Obj(curs)\y3 = Y.d
Obj(curs)\z3 = Z.d
ElseIf point = 4
Obj(curs)\x4 = X.d
Obj(curs)\y4 = Y.d
Obj(curs)\z4 = Z.d
EndIf
If Z < Obj(curs)\z_min : Obj(curs)\z_min = Z : EndIf
Next
Next
;}
SortStructuredArray(Obj(), 0, OffsetOf(FACE\z_min), #PB_Double)
EndIf
;{ affichage des lignes
For curs = 0 To dimension
coef_1.d = Pow(2.718281828459, -facteur_perspective * Obj(curs)\z1)
coef_2.d = Pow(2.718281828459, -facteur_perspective * Obj(curs)\z2)
coef_3.d = Pow(2.718281828459, -facteur_perspective * Obj(curs)\z3)
coef_4.d = Pow(2.718281828459, -facteur_perspective * Obj(curs)\z4)
x1.d = Obj(curs)\x1 * coef_1 + x_center
x2.d = Obj(curs)\x2 * coef_2 + x_center
x3.d = Obj(curs)\x3 * coef_3 + x_center
x4.d = Obj(curs)\x4 * coef_4 + x_center
y1.d = Obj(curs)\y1 * coef_1 + y_center
y2.d = Obj(curs)\y2 * coef_2 + y_center
y3.d = Obj(curs)\y3 * coef_3 + y_center
y4.d = Obj(curs)\y4 * coef_4 + y_center
x = (x1 + x2 + x3 + x4) / 4
y = (y1 + y2 + y3 + y4) / 4
LineXY(x1, y1, x2, y2, Obj(curs)\color)
LineXY(x2, y2, x3, y3, Obj(curs)\color)
LineXY(x3, y3, x4, y4, Obj(curs)\color)
LineXY(x4, y4, x1, y1, Obj(curs)\color)
If mode = 1
; FillArea(x, y, Obj(curs)\color, Obj(curs)\color)
FillTriangle(x1, y1, x2, y2, x3, y3, Obj(curs)\color)
FillTriangle(x1, y1, x3, y3, x4, y4, Obj(curs)\color)
EndIf
If mode = 2
DrawText(x1, y1, "1", Obj(curs)\color)
DrawText(x2, y2, "2", Obj(curs)\color)
DrawText(x3, y3, "3", Obj(curs)\color)
DrawText(x4, y4, "4", Obj(curs)\color)
EndIf
Next
;}
EndProcedure
Procedure Display_All_3D(*listobjet, nb_objet, x_center.l, y_center.l, rotX.d, rotY.d, rotZ.d, Effect_rotation.l, zoom.d, zooZ.d, facteur_perspective.d, mode.l)
Dim Obj_all.List(nb_objet - 1)
CopyMemory(*listobjet, Obj_all(), SizeOf(List) * (nb_objet))
; convertion des angles en radian
rotx1 = Convert1(rotx, 0)
roty1 = Convert1(roty, 0)
rotz1 = Convert1(rotz, 0)
angle.d = 0
;{ rotation
For curs = 0 To nb_objet - 1
X.d = Obj_all(curs)\x
Y.d = Obj_all(curs)\y
Z.d = Obj_all(curs)\z
X * zoom
Y * zoom
Z * zoom * zooZ
If rotz ; rotation autour de z
dist.d = Sqr(X * X + Y * Y)
If dist
angle = ACos(X / dist)
If Y < 0
angle = - angle
EndIf
angle + rotz1
X = dist * Cos(angle)
Y = dist * Sin(angle)
EndIf
EndIf
If roty ; rotation autour de y
dist.d = Sqr(Z * Z + X * X)
If dist
angle = ACos(Z / dist)
If X < 0
angle = - angle
EndIf
angle + roty1
Z = dist * Cos(angle)
X = dist * Sin(angle)
EndIf
EndIf
If rotx ; rotation autour de x
dist.d = Sqr(Y * Y + Z * Z)
If dist
angle = ACos(Y / dist)
If Z < 0
angle = - angle
EndIf
angle + rotx1
Y = dist * Cos(angle)
Z = dist * Sin(angle)
EndIf
EndIf
Obj_all(curs)\x = X.d
Obj_all(curs)\y = Y.d
Obj_all(curs)\z = Z.d
Next
;}
SortStructuredArray(Obj_all(), 0, OffsetOf(List\z) , #PB_Double)
For curs = 0 To nb_objet - 1
Display_3D(obj_all(curs)\adresse, obj_all(curs)\dimension, x_center.l, y_center.l, rotX.d, rotY.d, rotZ.d, Effect_rotation.l, zoom.d, zooZ.d, facteur_perspective.d, mode.l)
Next
EndProcedure
; ##########################################################################################
; ##########################################################################################
#Screen_W = 600
#Screen_H = 500
OpenWindow(0, 0, 0, #Screen_W, #Screen_H, "", #PB_Window_ScreenCentered | #PB_Window_MinimizeGadget)
If InitSprite() = 0 Or InitMouse() = 0 Or InitKeyboard() = 0 : End : EndIf
OpenWindowedScreen(WindowID(0), 0, 0, #Screen_W, #Screen_H, 0, 0, 0)
KeyboardMode(1)
nb_objet = 8
Macro def
Dim aa.FACE(dimension)
Dim ab.FACE(dimension)
Dim ac.FACE(dimension)
Dim ad.FACE(dimension)
Dim ae.FACE(dimension)
Dim af.FACE(dimension)
Dim ag.FACE(dimension)
Dim ah.FACE(dimension)
;{ definition des spheres
Sphere(aa(), 0, 0, 0, 10, tr, mo, #White)
Sphere(ab(), 20, 0, 0, 10, tr, mo, #Green)
Sphere(ac(), 40, 0, 0, 10, tr, mo, #Green)
Sphere(ad(), 60, 0, 0, 10, tr, mo, #Green)
Sphere(ae(), 0, 20, 0, 10, tr, mo, #Green)
Sphere(af(), 20, 20, 0, 10, tr, mo, #Green)
Sphere(ag(), 40, 20, 0, 10, tr, mo, #Green)
Sphere(ah(), 60, 20, 0, 10, tr, mo, #Green)
Dim List.List(nb_objet - 1)
;{ list
a = 0
List(a)\adresse = @aa()
List(a)\dimension = dimension
List(a)\x = 0
List(a)\y = 0
List(a)\z = 0
a + 1
List(a)\adresse = @ab()
List(a)\dimension = dimension
List(a)\x = 20
List(a)\y = 0
List(a)\z = 0
a + 1
List(a)\adresse = @ac()
List(a)\dimension = dimension
List(a)\x = 40
List(a)\y = 0
List(a)\z = 0
a + 1
List(a)\adresse = @ad()
List(a)\dimension = dimension
List(a)\x = 60
List(a)\y = 0
List(a)\z = 0
a + 1
List(a)\adresse = @ae()
List(a)\dimension = dimension
List(a)\x = 0
List(a)\y = 20
List(a)\z = 0
a + 1
List(a)\adresse = @af()
List(a)\dimension = dimension
List(a)\x = 20
List(a)\y = 20
List(a)\z = 0
a + 1
List(a)\adresse = @ag()
List(a)\dimension = dimension
List(a)\x = 40
List(a)\y = 20
List(a)\z = 0
a + 1
List(a)\adresse = @ah()
List(a)\dimension = dimension
List(a)\x = 60
List(a)\y = 20
List(a)\z = 0
;}
EndMacro
def
vit = 10
zoom.d = 3
zoom_z.d = 1
fact.d = -0.004
rot_x.d = 45
rot_y.d = 45
rot_z.d = 135
Repeat
event = WindowEvent()
ExamineKeyboard()
If KeyboardPushed(#PB_Key_Pad7) : rot_x - vit : EndIf
If KeyboardPushed(#PB_Key_Pad8) : rot_x + vit : EndIf
If KeyboardPushed(#PB_Key_Pad4) : rot_y - vit : EndIf
If KeyboardPushed(#PB_Key_Pad5) : rot_y + vit : EndIf
If KeyboardPushed(#PB_Key_Pad1) : rot_z - vit : EndIf
If KeyboardPushed(#PB_Key_Pad2) : rot_z + vit : EndIf
If KeyboardPushed(#PB_Key_Pad9) : zoom * 1.5 : EndIf
If KeyboardPushed(#PB_Key_Pad3) : zoom / 1.5 : EndIf
If KeyboardPushed(#PB_Key_PageUp) : fact + 0.002 : EndIf
If KeyboardPushed(#PB_Key_PageDown) : fact - 0.002 : EndIf
If KeyboardPushed(#PB_Key_F1) : mode = 0 : EndIf
If KeyboardPushed(#PB_Key_F2) : mode = 1 : EndIf
If KeyboardPushed(#PB_Key_F3) : mode = 2 : EndIf
;{ changement des parametres des spheres
If KeyboardPushed(#PB_Key_A) Or KeyboardPushed(#PB_Key_Z) Or KeyboardPushed(#PB_Key_Q) Or KeyboardPushed(#PB_Key_S)
If KeyboardPushed(#PB_Key_A) : tr + 1 : EndIf
If KeyboardPushed(#PB_Key_Z) And tr > 2 : tr - 1 : EndIf
If KeyboardPushed(#PB_Key_Q) : mo + 1 : EndIf
If KeyboardPushed(#PB_Key_S) And mo > 2 : mo - 1 : EndIf
dimension = tr * mo
dimension_t = mo - 1
def
EndIf
;}
Delay(10)
ClearScreen(0)
If StartDrawing(ScreenOutput())
Display_All_3D(@list(), nb_objet, #Screen_W / 2, #Screen_H / 2, rot_x, rot_y, rot_z, 1, zoom, 1, fact, mode)
DrawText(0, 0, Str(rot_x), #White, 0)
DrawText(0, 20, Str(rot_y), #White, 0)
DrawText(0, 40, Str(rot_z), #White, 0)
StopDrawing()
EndIf
FlipBuffers()
Until event = #PB_Event_CloseWindow Or KeyboardPushed(#PB_Key_Escape)
End