|
!'ボクセル表現(VOXEL)
RANDOMIZE
DIM A(3,3),B(4,3)
MAT READ A
DATA .5,0,0
DATA 0,.5,0
DATA 0,0,.5
MAT READ B
DATA 0,0,0
DATA 60,0,0
DATA 30,60,0
DATA 30,30,60
LET X=1 !'初期値
LET Y=1
LET Z=1
LET N=10000
FILE GETSAVENAME F$,"dxfファイル|*.dxf"
IF F$="" THEN STOP
IF POS(UCASE$(F$),".DXF")=0 THEN LET F$=F$ & ".dxf"
OPEN #1:NAME F$
ERASE #1
PRINT #1:"0"
PRINT #1:"SECTION"
PRINT #1:"2"
PRINT #1:"ENTITIES"
FOR I=1 TO N
LET K=INT(RND*4+1)
LET XX=X*A(1,1)+Y*A(1,2)+Z*A(1,3)+B(K,1)
LET YY=X*A(2,1)+Y*A(2,2)+Z*A(2,3)+B(K,2)
LET ZZ=X*A(3,1)+Y*A(3,2)+Z*A(3,3)+B(K,3)
LET X=XX
LET Y=YY
LET Z=ZZ
CALL CUBE(#1,X,Y,Z,1)
NEXT I
PRINT #1:"0"
PRINT #1:"ENDSEC"
PRINT #1:"0"
PRINT #1:"EOF"
CLOSE #1
END
以下省略
EXTERNAL SUB CUBE(#1,X,Y,Z,L)
END SUB
|
|