videep
03-18-2012, 06:24 PM
So what I am trying to do here is:
I have a spline, I want to place 10 objects on it and want it to see another spline.
so here is the code:
spline1 = $Line01
spline2 = $Line02
cl = curveLength spline1
num = 10
numParts = (cl/10)
for i = 1 to num do
(
r = instance $Rectangle01
pathParam = ((numParts*i)/cl)
if pathParam <= 1 then
(
r.pos = lengthInterp spline1 1 pathParam
nearestPathp = nearestPathParam spline1 1 r.pos
dir = pathInterp spline2 1 nearestPathp
r.dir = normalize(dir-r.pos)
)
)
But even if the lines are STAIGHT, there is a rotation angle in the rectangles that I am placing in Z AXIS.
Should the rectangles Z rotation not be ZERO in case the lines Are STRAIGHT?
Please let me know if its a max's bug or a problem in my script above.
Attaching images.
I have a spline, I want to place 10 objects on it and want it to see another spline.
so here is the code:
spline1 = $Line01
spline2 = $Line02
cl = curveLength spline1
num = 10
numParts = (cl/10)
for i = 1 to num do
(
r = instance $Rectangle01
pathParam = ((numParts*i)/cl)
if pathParam <= 1 then
(
r.pos = lengthInterp spline1 1 pathParam
nearestPathp = nearestPathParam spline1 1 r.pos
dir = pathInterp spline2 1 nearestPathp
r.dir = normalize(dir-r.pos)
)
)
But even if the lines are STAIGHT, there is a rotation angle in the rectangles that I am placing in Z AXIS.
Should the rectangles Z rotation not be ZERO in case the lines Are STRAIGHT?
Please let me know if its a max's bug or a problem in my script above.
Attaching images.
