Getting DISTANCE from objects array
Why it's dosent work ???
---------------------------------------------------
varCamera=cameras[1]
varElenments=geometry as array
varIniDist=#()
-- varTape=undefined
ter=undefined
for i = 1 to varElenments.count do
(
pName="Tape"+"_"+varElenments[i].name as string
varTape=tape pos: varCamera.pos target:(targetObject pos:varElenments[i].pos) name:pName
-- ishidden:on
append varIniDist varTape
)
for i = 1 to varElenments.count do
(
ter=distance varIniDist[i].pos varCamera.pos
distance CarrentCam.pos CarrentObj.pos
print ter
)
Comments
.
I don't know what are you trying to achieve, but to get the distance from camera to object you can use this:
In your code CarrentCam and CarrentObj are not defined, so you get an error.
By the way, put the code in
...code here...
.Tools and Scripts for Autodesk 3dsMax
.....
Sorry, yesterday I overdone....
Thank you for your attention.....