home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Maximum 3D 3
/
m3d-p3.iso
/
3DS_MAX
/
3DSMAX.2_0
/
SCRIPTS
/
CONEPTRN.MS
< prev
next >
Wrap
Text File
|
1997-10-19
|
1KB
|
38 lines
-- Created by: Ravi Karra [ravi.karra@ktx.com]
-- This script creates and moves a set of spheres on a helical path
-- Each sphere accelerates with different magnitudes as they move
resetMaxFile #noPrompt
r1 = 0 --Base radius of helical path
r2 = 50.0 --Radius at the top
H = 100.0 --Height of the helix
r = 2.0 --Radius of sphere
tr = 5.0 --Turns
n = 100 --Num of objects
doMats = false --Make this true to assign random materials to the objects
posO = [0, 0, 0] --Starting position of the objects
b = #()
n_mats = currentMaterialLibrary.count
for i = 1 to n do
(
b[i] = sphere radius:r pos:posO mapcoords:true
if (doMats) then b[i].mat = currentMaterialLibrary[random 1 n_mats]
)
hlx = helix radius1:r1 radius2:(2*r2) height:(2*H) turns:(2*tr) direction:1
progressStart "Creating the Objects"
animate on for t in 0 to 100 do at time t
(
if (getProgressCancel())==true then exit
progressUpdate t
for i = 1 to n do
(
local fac = (1 + i*1.0/n)
local ang = t * 3.6*tr*fac
local rX = r1+((r2 - r1)*t*fac/100) --R at any point X
b[i].position = posO + [rX * cos(ang), rX * sin(ang), H*t*fac/100 ]
)
)
progressEnd ()
max zoomext sel all
max time play