Hi there. I'm a noob to 3DS Max, and have hit a wall with this. I'm using external position data (csv) to animate objects in 3D space. I've managed to get objects moving ok, but I cannot figure out how to rotate them to face in the direction of travel. I've seen some other problem pages about this, but couldn't get their scripts working.
Very grateful for any assistance. I include my code below for an idea of where I stand.
Robin
------------------
resetMaxFile #noPrompt
(
--Read in the movement data
local theFile = openFile "p:\\data.csv"
global data = #()
global points = #()
while not eof theFile do (
t = [(readValue theFile as integer), (readValue theFile as integer)]
append data t
p = Point3 (readValue theFile as float) (readValue theFile as float) (readValue theFile as float)
append points p
)
close theFile
)
(
--Setup objects
for i = 1 to 50 do
(
Box lengthsegs:1 widthsegs:1 heightsegs:1 length:5 width:5 height:5 mapcoords:on pos:[points[i][1], points[i][2], points[i][3]] isSelected:on
$Box001.name = ((i as integer) as string)
)
)
--Animate objects
animate on
(
k = 1
for t in 1 to 100 do
(
at time (t)
(
for i in 1 to 50 do
(
execute ("select $" + (data[k][2] as integer) as string)
$.pos = points[k]
k = k+1
if k > 5000 do
(
k = 1
)
)
)
)
)
By geotheory · 2012-06-08
barigazy · 2012-06-09