ScriptSpot

Forum topic · Scripts Wanted

position bias

By JokerMartini · 2011-05-05

Downloads
Description

I figured I would post this and get some other heads on the idea of getting position BIAS in max.

I've come across several sites that had some explanations and formulas for it.
here is the most common one I found.

BIAS = ∑nt=1 | Dt - Ft | / n

Id liked to get this translated into 3ds max. It's a common thing I've come across on several forums with unanswered solutions.


mybox = box length:5 width:5 height:5 wirecolor:black --new box

objCount = 10

for i = 1 to objCount do
(
box_copy = copy mybox
box_copy.pos = [(i*objCount), 0, 0]
box_copy.wirecolor = [i*objCount,0,0]
)

Comments (1)

This is what I have so far.

JokerMartini · 2011-05-09

This is what I’ve got so far. If you open the max file I’ve attached and selected the little pile of spheres and run the script it will work.

Aside from that the script is not stream line enough. If you change the sphere count it does not work properly. Hoping to get some other opinions or help.
Thanks


startPos = $Sphere013.pos
endPos = $Sphere009.pos
selObjs = (selection.count)
clearlistener()
for i=1 to (selObjs) do
(
userPerc = 66.6666666666
PerVal = userPerc*.01
PerChange = (PerVal/selCount)*(i+1)
print PerVal
print PerChange
Part1 = (endPos-startPos)
Part2 = (i as float)/(selObjs+1)*PerChange
PosPerct = (startPos + (Part1*Part2))
print PosPerct

Obj = Selection[i]
Obj.pos = PosPerct
)

Attachments