|
14、在仓库中将“Position Object”操作符添加到新事件当中,然后选择Position Object对象,在其右侧的参数命令面板中单击By List按钮,在弹出的对话框中选择车体对象,然后勾选“Lock on Emitter(锁定发射器)”选项,这样该粒子就与汽车一起运动了,现在在整个动画过程中,只有一个锁定到汽车的粒子,如图1-14所示。

图1-14
15、返回到“Event 02”事件当中,从仓库中拖动“Script Operator(脚本操作器)”放在Event02事件的下方,然后使用“Script Operator”控件中的“编辑脚本”按钮编辑脚本,由于脚本操作符提供了默认的脚本,所以我们不需要重新输入脚本,只需要运用其中的自带的一段即可,在这个实例当中我们只保留以下内容即可,将其余的脚本都删除,如图1-15所示。
on ChannelsUsed pCont do ( pCont.useTime = true pCont.useSpeed = true pcont.useInteger = true )
on Init pCont do (
)
on Proceed pCont do ( count = pCont.NumParticles() timeEnd = pCont.getTimeEnd() $PFCarSpeedCheck.updateParticles $PFCarSpeedCheck timeEnd carSpeed = $PFCarSpeedCheck.particleSpeed for i in 1 to count do ( pCont.particleIndex = i if pcont.particleInteger != 1 do -- subtract the motion of the car only once ( pcont.particlespeed -= 0.8 * carSpeed -- leave 80 percent of the motion -- now to introduce a little variation in the particle speed to randomize things a little: pcont.particleSpeed *= 1 - (pcont.rand11() * 0.3) -- pcont.rand55() is a built in Particle Flow function that generates a random number between -0.5 and 0.5, -- I then turn that into a -0.3 to 0.3 multiplier, or 30% variation -- 这样可以对渲染采取更大的积分步长,并仍然避免喷出。 pcont.particleInteger = 1 -- 设置此项以便其在后面循环测试的叠代中会被忽略 ) ) )
on Release pCont do (
)

图1-15

文章页数:[1] [2] [3] [4] [5] [6] |