Tu as juste cela a retenir :
ISO_X = X-Y
ISO_Y = (X+Y)/2
c'est la formule de projection.
Code : Tout sélectionner
; on defini les 4 cotés de notre carré
X1 = 10
Y1 = 10
X2 = 90
Y2 = 10
X3 = 90
Y3 = 90
X4 = 10
Y4 = 90
OpenWindow(0,0,0,640,480,"")
TextGadget(#PB_Any,5,5,100,30,"Non isométrique")
TextGadget(#PB_Any,200,5,100,30,"Isométrique")
Repeat
event = WindowEvent()
StartDrawing(WindowOutput(0))
DecalageX = 20 ; Pour ne pas chevauché sur le texte , on décale
DecalageY = 30
LineXY(X1+DecalageX,Y1+DecalageY,X2+DecalageX,Y2+DecalageY,$0)
LineXY(X2+DecalageX,Y2+DecalageY,X3+DecalageX,Y3+DecalageY,$0)
LineXY(X3+DecalageX,Y3+DecalageY,X4+DecalageX,Y4+DecalageY,$0)
LineXY(X4+DecalageX,Y4+DecalageY,X1+DecalageX,Y1+DecalageY,$0)
DecalageX = 250 ; Pour ne pas chevauché sur le texte , on décale
DecalageY = 30
iso_X1 = X1 - Y1
iso_Y1 = (X1 + Y1)/2
iso_X2 = X2 - Y2
iso_Y2 = (X2 + Y2)/2
iso_X3 = X3 - Y3
iso_Y3 = (X3 + Y3)/2
iso_X4 = X4 - Y4
iso_Y4 = (X4 + Y4)/2
LineXY(iso_X1+DecalageX,iso_Y1+DecalageY,iso_X2+DecalageX,iso_Y2+DecalageY,$0)
LineXY(iso_X2+DecalageX,iso_Y2+DecalageY,iso_X3+DecalageX,iso_Y3+DecalageY,$0)
LineXY(iso_X3+DecalageX,iso_Y3+DecalageY,iso_X4+DecalageX,iso_Y4+DecalageY,$0)
LineXY(iso_X4+DecalageX,iso_Y4+DecalageY,iso_X1+DecalageX,iso_Y1+DecalageY,$0)
StopDrawing()
Until event = #PB_Event_CloseWindow