Page 1 of 1

prototype de moteur 3D (tres tres simple) en fils de fer

Unread postPosted: 19 Nov 2015, 23:34
by pomf26
le programme marche bien sauf que je manque encore de connaissance en optimisations d'algorithme, voila le code:
Code: Select all
0→Xscl
0→Yscl
0→Xmin
20→Xmax
0→Ymin
20→Ymax
AxesOff
ClrDraw
0→A
2→B
4→C
6→D
8→E
10→F
10→G
12→H
14→I
16→J
18→K
20→L
0→Z

Lbl 0
getKey→X
Line(A,A,C,C
Line(C,C,C,J
Line(C,J,A,L
Line(L,A,I,D
Line(I,D,I,I
Line(I,I,L,L
Line(C,I,I,I
Line(C,D,I,D

If Z≥3 and X=24
Then
ClrDraw
0→A
6→D
14→I
20→L
0→Z
Goto 1
Else

If Z<3 and X=25
Then
ClrDraw
A-2→A
C-2→C
D-2→D
I+2→I
J+2→J
L+2→L
Z+1→Z
Goto 0
Else

If Z>0 and X=34
Then
ClrDraw
A+2→A
C+2→C
D+2→D
I-2→I
J-2→J
L-2→L
Z-1→Z
End

Goto 0

Lbl 1
getKey→X
Line(A,A,D,D
Line(D,D,D,I
Line(D,I,A,L
Line(L,A,I,D
Line(I,D,I,I
Line(I,I,L,L
Line(D,E,I,E
Line(D,H,I,H

If Z<4 and X=25
Then
ClrDraw
A-2→A
D-2→D
E-2→E
H+2→H
I+2→I
L+2→L
Z+1→Z
Goto 1
Else

If Z>0 and X=34
Then
ClrDraw
A+2→A
D+2→D
E+2→E
H-2→H
I-2→I
L-2→L
Z-1→Z
End

Goto 1

Re: prototype de moteur 3D (tres tres simple) en fils de fer

Unread postPosted: 19 Nov 2015, 23:53
by noelnadal
Pour éviter que certains perdent du temps, je précise que j'ai répondu sur le chat. ;)

Re: prototype de moteur 3D (tres tres simple) en fils de fer

Unread postPosted: 20 Nov 2015, 00:47
by Adriweb
Poste le code amélioré :)

Re: prototype de moteur 3D (tres tres simple) en fils de fer

Unread postPosted: 20 Nov 2015, 08:32
by pomf26
voici la v2:
Code: Select all
0→Xscl
0→Yscl
0→Xmin
20→Xmax
0→Ymin
20→Ymax
AxesOff
ClrDraw
DelVar A2→B
4→C
6→D
8→E
10→F
10→G
12→H
14→I
16→J
18→K
20→L
DelVar Z
Lbl 0
getKey→X
Line(A,A,C,C
Line(C,C,C,J
Line(C,J,A,L
Line(L,A,I,D
Line(I,D,I,I
Line(I,I,L,L
Line(C,I,I,I
Line(C,D,I,D
If Z≥3 and X=24
Then
ClrDraw
DelVar A6→D
14→I
20→L
DelVar Z
Goto 1
End
If Z<3 and X=25
Then
ClrDraw
A-2→A
C-2→C
D-2→D
I+2→I
J+2→J
L+2→L
Z+1→Z
End
If Z>0 and X=34
Then
ClrDraw
A+2→A
C+2→C
D+2→D
I-2→I
J-2→J
L-2→L
Z-1→Z
End
Goto 0
Lbl 1
getKey→X
Line(A,A,D,D
Line(D,D,D,I
Line(D,I,A,L
Line(L,A,I,D
Line(I,D,I,I
Line(I,I,L,L
Line(D,E,I,E
Line(D,H,I,H
If Z<4 and X=25
Then
ClrDraw
A-2→A
D-2→D
E-2→E
H+2→H
I+2→I
L+2→L
Z+1→Z
End
If Z>0 and X=34
Then
ClrDraw
A+2→A
D+2→D
E+2→E
H-2→H
I-2→I
L-2→L
Z-1→Z
End
Goto 1

Re: prototype de moteur 3D (tres tres simple) en fils de fer

Unread postPosted: 21 Nov 2015, 15:58
by Brainbraker
Un screenshot ?