home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Maximum 3D 3
/
m3d-p3.iso
/
3DS_MAX
/
3DSMAX.2_0
/
SCRIPTS
/
CHECKF.MS
< prev
next >
Wrap
Text File
|
1997-10-19
|
3KB
|
102 lines
--=============== Creates a pattern of boxes --==================
-- Created by: Ravi Karra [ravi.karra@ktx.com]
resetMaxFile #noPrompt
a = #()
L = 20; W = 30; H =1.0; -- Length, Width & Heigth of the boards
curX = curZ = 0;
numBoards = 10
angI = 45 -- Initial angle between the horizontal plane and the diagonal
angF = 0; -- Final angle between the horizontal plane and the diagonal
angC ; -- This is the difference in angles (angF - angI)
for i = 1 to numBoards do
(
local b
if (mod i 2)== 0 then --Creates the horizontal boards
(
curZ += W/2 - H/2
a[i] = box length:L width:W height:H pos:[curX,0, curZ]
-- a[i+1].pivot = [curX-W/2,0, curZ-w/2]
)
else --Creates the vertical boards
(
curX += W/2 - H/2
a[i] = box length:L width:H height:W pos:[curX,0, curZ]
a[i].pivot = [curX,0, curZ+w/2]
)
)
angF = 15; --Setting the final angle
angC = angF - angI
del = (sqrt(2) * cos(angF)-1)*W/2
--if angF > angI then del = (-del));
delX = del * cos(angI)
delZ = del * sin(angI)
fac =sqrt(2)
animate on
(
at time 0
at time 50 (
for j in 1 to numBoards do
(
if (mod j 2)== 0 then
(
if j < (numBoards/2) then
(
mov = (numBoards/2 - j)/2 + 1
chnX = fac*(-delX * mov)
chnZ = fac*(-delZ * mov)
move a[j] [ chnX , 0, chnZ]
move a[j-1] [chnX , 0, chnZ ]
--format "j: %\tmov: %\tchnX %\tchnZ: %\n" j mov chnX chnZ
)
if j > (numBoards/2 + 1) then
(
mov = (j - numBoards/2 )/2
chnX = fac*(delX * mov)
chnZ = fac*(delZ * mov)
move a[j] [chnX, 0, chnZ]
move a[j-1] [chnX, 0, chnZ]
--format "j: %\tmov: %\tchnX %\tchnZ: %\n" j mov chnX chnZ
)
rotate a[j] angC [0,1,0]
)
else
rotate a[j] -angC [0,1,0]
--print a[j].pos
)
)
at time 100 (
for j in 1 to numBoards do
(
if (mod j 2)== 0 then
(
if j < (numBoards/2) then
(
mov = (numBoards/2 - j)/2 + 1
chnX = fac*(delX * mov)
chnZ = fac*(delZ * mov)
move a[j] [ chnX , 0, chnZ]
move a[j-1] [chnX , 0, chnZ ]
--format "j: %\tmov: %\tchnX %\tchnZ: %\n" j mov chnX chnZ
)
if j > (numBoards/2 + 1) then
(
mov = (j-numBoards/2 )/2
chnX = fac*(-delX * mov)
chnZ = fac*(-delZ * mov)
move a[j] [chnX, 0, chnZ]
move a[j-1] [chnX, 0, chnZ]
--format "j: %\tmov: %\tchnX %\tchnZ: %\n" j mov chnX chnZ
)
rotate a[j] -angC [0,1,0]
)
else
rotate a[j] angC [0,1,0]
)
)
)
max tool zoomextents all
max time play