|
hello, i’m new in max scripting of 3ds max, i use 3ds max at school from 1 year ago.
today when i was making the suspension rig of my robot foot i got stuck.
the suspensions works well, but the rotate of some pieces don’t work
i can explain:
the foot is composed by a core, with some suspensions and 3 pieces, one front right, one front left, and one little back.
the front pieces can turn, that’s the bad…
here is my code (optional don’t read if you do not want)
maxtime=1f
slidertime=0f
T=0f
rotazione=0
rotazione2=0
tollerance=0,15
animate on(
do(
slidertime=T
--parte dietro
$piede_R01.pos=$piederef_R01.pos--ref extension
if $piede_R01.pos.z<=0 then(
$piede_R01.pos.z=0
)
--parte destra
$piede_DX01.pos=$piederef_DX01.pos--ref extension
if $piede_DX01.pos.z<=0 then(
$piede_DX01.pos.z=0
)
do( flag=0
poss=$piede_DX01.pos.z - $piede_DX02.pos.z
if poss<=tollerance then (
if poss>=-tollerance then (
rotate $Ft_DX_01 (angleaxis 1 [1,0,0])
flag=1
))
) while (flag == 1)
do(
flag=0
if $piede_DX02.pos.z<0 then (
rotate $Ft_DX_01 (angleaxis -1 [1,0,0])
flag=1
--rotazione=rotazione+1
)
) while (flag == 1)
--parte sinistra
$piede_SX01.pos.z=$piederef_SX01.pos.z--ref extension
if $piede_SX01.pos.z<=0 then(
$piede_SX01.pos.z=0
)
do( flag=0
poss=$piede_SX01.pos.z - $piede_SX02.pos.z
if poss<tollerance and poss >-tollerance then (
rotate $Ft_SX_01 (angleaxis 1 [1,0,0])
flag=1
)
) while (flag == 1)
do(
flag=0
if $piede_SX02.pos.z<0 then (
rotate $Ft_SX_01 (angleaxis -1 [1,0,0])
--rotazione2=rotazione2+1
flag=1
)
) while (flag == 1)
T=T+1
)while (T<=maxtime)
)
Evaluating all in the listener i’ve got
1f
0f
0f
0
0
0 -- Error occurred in anonymous codeblock; filename: C:\Users\utente\Documents\3dsMax\scenes\controller piede 2°.ms; position: 73; line: 6 -- Syntax error: at ),, expected <factor>
-- In line: tollerance=0,1
what is it? why
i made this too:
casualn=0,15
and evaluating here is the answer
-- Error occurred in anonymous codeblock; filename: C:\Users\utente\Documents\3dsMax\scenes\controller piede 2°.ms; position: 73; line: 6 -- Syntax error: at ),, expected <factor>
-- In line: tollerance=0,1
what i’m doing wrong…
i’ve checked all the brackets, i tryed float = (variable=0,15)
nothing…
tank you
cpu: Intel i7 920 heatsink: CoolerMaster V8
graphic: ATI Sapphire HD5770 VaporX edition
ram: Corsair Dominator 1600mhz DDR3 6Gb (3x2)
mb: asus P67 SE cs: CoolerMaster HAF922 + cooler master 700w modular
Win 7 64bit, Directx 11
| Attachment
|
|
| Attachment
|
|
|