home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Maximum 3D 3
/
m3d-p3.iso
/
3DS_MAX
/
3DSMAX.2_0
/
SCRIPTS
/
TEARYBOX.MS
< prev
next >
Wrap
Text File
|
1997-10-19
|
1KB
|
50 lines
--Created by:Ravi Karra [ravi.karra@ktx.com]
resetMaxFile #noPrompt
--size of the enclosing cube for random creation of the dummy
range = 800
--num of objects to be placed
num = 20
--Create a box and a dummy
b = box length:100 width:100 height:20
d = dummy pos:(random [-range,-range,-range] [range,range,range])
fn linearInterp valueIni valueFin range cur =
(
valueIni + (valueFin - valueIni)*cur/range
)
fn createObjects source target objNum =
(
--Create a ray originating from dummy in the direction of box
ry = ray target.pos (source.pos - target.pos)
--Intersect the ray with the box
ir = intersectRay source ry
--Create equally spaced objects on the ray
rad = (distance source target)/(2*objNum)
for i = 1 to objNum do
(
obj = teapot radius:rad pos:((linearInterp ir.pos target.pos objNum (i-1)))
obj.dir = ir.dir
)
)
createObjects b d num
for s in $tea* do s.parent = d
d.pivot = b.pos
animate on for t in 0 to 100 do at time t
(
at time 100
(
rotate d 360 [0,0,1]
)
)
max zoomext sel all
max time play