|
Hi
I’m trying to scale a Particle Flow system using a script operator. The particles scale depending on the camera z position. I haven’t a clue when it comes to the maths. What I’d like is a bezier-like transition, but my script is linear. How can I give it an ease out and ease in close to the two values?
Thanks
Mark
on ChannelsUsed pCont do (
pCont.useScale = true
)
on Init pCont do (
)
on Proceed pCont do (
scaleMultiplier = 0.0
count = pCont.NumParticles()
for i in 1 to count do
(
pCont.particleIndex = i
if $camDummy.pos.z < 50 then
(
if $camDummy.pos.z < 30 then
(
scaleMultiplier = 0.6
pCont.particleScale = scaleMultiplier
)
else
scaleMultiplier = 1*($camDummy.pos.z/50)
pCont.particleScale = scaleMultiplier
)
else pCont.particleScale = 1
)
)
on Release pCont do (
)
|
|
|
|
Yahoo UI API has some well-commented JavaScript code that does easing math. That should be easy enough to translate to MS.
It was near the top of a Google search for “animation mathematics ease"…
-Jeff
Max/Composite 2012 (subscription)
Win7-64pro, Intel i7-hex on SuperMicro mobo, 12 GB RAM
nVidia Quadro 5000, render farmette on BB2012
|
|
|
|
Thanks. That looks very useful.
Mark
|
|
|