denisT

06-09-2011, 03:41 PM

well... the Party Of Math Lovers won. :)

So if you like to practice in math try to accomplish this task:

setCommandPanelTaskMode mode:#create

start = dummy name:"start" pos:[0,0,0] boxsize:[10,10,10]

out_start = in start dummy name:"out_start" pos:[33.33,0,0] boxsize:[2.5,2.5,2.5]

setTransformLockFlags out_start #{2..9} --#all

end = dummy name:"end" pos:[100,0,0] boxsize:[10,10,10]

in_end = in end dummy name:"in_end" pos:[66.66,0,0] boxsize:[2.5,2.5,2.5]

setTransformLockFlags in_end #{2..9} --#all

start.rotation.controller = Euler_XYZ()

end.rotation.controller = Euler_XYZ()

wire = splineShape name:"wire" adaptive:on wirecolor:yellow

addnewSpline wire

addKnot wire 1 #corner #curve start.pos

addKnot wire 1 #corner #curve end.pos

setKnotType wire 1 1 #bezierCorner

in coordsys world

(

setOutVec wire 1 1 out_start.pos

setInVec wire 1 2 in_end.pos

setKnotType wire 1 2 #bezierCorner

)

updateShape wire

animateVertex wire #all

wire.controller = Transform_Script script:"matrix3 1"

setTransformLockFlags wire #all

cc = wire[#Object__Editable_Spline][#Master].controller

ps1 = point3_script ()

ps1.addNode "start" start

ps1.setExpression "start.pos"

ps2 = point3_script ()

ps2.addNode "end" end

ps2.setExpression "end.pos"

cc[#Spline_1___Vertex_1].controller = ps1

cc[#Spline_1___Vertex_2].controller = ps2

ps3 = point3_script ()

ps3.addNode "start" out_start

ps3.setExpression "start.pos"

ps4 = point3_script ()

ps4.addNode "end" in_end

ps4.setExpression "end.pos"

cc[#Spline_1___OutVec_1].controller = ps3

cc[#Spline_1___InVec_2].controller = ps4

for k=1 to 9 do

(

factor = 10*k

ghost = point name:("ghost" + k as string) axistripod:on box:on cross:off size:10 wirecolor:red

setTransformLockFlags ghost #all

ghost.rotation.controller = rc = Euler_XYZ()

rc.x_rotation.controller = Float_List()

rc.x_rotation.controller.Bezier_Float.controller = start.rotation.controller.x_rotation.controller

rc.x_rotation.controller.Available.controller = end.rotation.controller.x_rotation.controller

rc.x_rotation.controller.weight[1] = 100 - factor

rc.x_rotation.controller.weight[2] = factor

ghost.position.controller = pc = path_constraint path:wire percent:factor loop:off constantVel:on follow:on bank:off

deletekeys pc.percent.controller #allkeys

)

I made this rig using MAX features (spline shape, controllers, constraints, etc.) to hide as well as possible any math behind. The goal is to do the same but using MATH formulas only and WHEN constructs.

Play with BIG boxes position and rotation, and SMALL boxes local X position. Get the logic and ... run the Math Adventure.

PS. I hope the rig that I made for this challenge will be interesting itself. It's some sort of a combined answer on questions that I saw on this forum.

[edit: bug in the rig fixed]

So if you like to practice in math try to accomplish this task:

setCommandPanelTaskMode mode:#create

start = dummy name:"start" pos:[0,0,0] boxsize:[10,10,10]

out_start = in start dummy name:"out_start" pos:[33.33,0,0] boxsize:[2.5,2.5,2.5]

setTransformLockFlags out_start #{2..9} --#all

end = dummy name:"end" pos:[100,0,0] boxsize:[10,10,10]

in_end = in end dummy name:"in_end" pos:[66.66,0,0] boxsize:[2.5,2.5,2.5]

setTransformLockFlags in_end #{2..9} --#all

start.rotation.controller = Euler_XYZ()

end.rotation.controller = Euler_XYZ()

wire = splineShape name:"wire" adaptive:on wirecolor:yellow

addnewSpline wire

addKnot wire 1 #corner #curve start.pos

addKnot wire 1 #corner #curve end.pos

setKnotType wire 1 1 #bezierCorner

in coordsys world

(

setOutVec wire 1 1 out_start.pos

setInVec wire 1 2 in_end.pos

setKnotType wire 1 2 #bezierCorner

)

updateShape wire

animateVertex wire #all

wire.controller = Transform_Script script:"matrix3 1"

setTransformLockFlags wire #all

cc = wire[#Object__Editable_Spline][#Master].controller

ps1 = point3_script ()

ps1.addNode "start" start

ps1.setExpression "start.pos"

ps2 = point3_script ()

ps2.addNode "end" end

ps2.setExpression "end.pos"

cc[#Spline_1___Vertex_1].controller = ps1

cc[#Spline_1___Vertex_2].controller = ps2

ps3 = point3_script ()

ps3.addNode "start" out_start

ps3.setExpression "start.pos"

ps4 = point3_script ()

ps4.addNode "end" in_end

ps4.setExpression "end.pos"

cc[#Spline_1___OutVec_1].controller = ps3

cc[#Spline_1___InVec_2].controller = ps4

for k=1 to 9 do

(

factor = 10*k

ghost = point name:("ghost" + k as string) axistripod:on box:on cross:off size:10 wirecolor:red

setTransformLockFlags ghost #all

ghost.rotation.controller = rc = Euler_XYZ()

rc.x_rotation.controller = Float_List()

rc.x_rotation.controller.Bezier_Float.controller = start.rotation.controller.x_rotation.controller

rc.x_rotation.controller.Available.controller = end.rotation.controller.x_rotation.controller

rc.x_rotation.controller.weight[1] = 100 - factor

rc.x_rotation.controller.weight[2] = factor

ghost.position.controller = pc = path_constraint path:wire percent:factor loop:off constantVel:on follow:on bank:off

deletekeys pc.percent.controller #allkeys

)

I made this rig using MAX features (spline shape, controllers, constraints, etc.) to hide as well as possible any math behind. The goal is to do the same but using MATH formulas only and WHEN constructs.

Play with BIG boxes position and rotation, and SMALL boxes local X position. Get the logic and ... run the Math Adventure.

PS. I hope the rig that I made for this challenge will be interesting itself. It's some sort of a combined answer on questions that I saw on this forum.

[edit: bug in the rig fixed]