主题:  求助:物体的平滑移动!

cxzheng123

职务:普通成员
等级:1
金币:0.0
发贴:8
#12005/10/19 18:27:56
为了得到物体移动的慢镜头,我在节奏通道中将影片速度设置很低。但这时候得到物体移动的慢动作是一跳一跳的,请教大虾们怎么让这个移动看起来流畅?程序怎么写啊!!多谢多谢了先。。。

Shockwave 动画



cxzheng123

职务:普通成员
等级:1
金币:0.0
发贴:8
#22005/10/24 9:19:29
做了个小例子,通过控制loc的变换来控制物体的移动,可以通过调节Speed的值来控制移动速度。有点问题:
1:由于取整误差,使终点位置偏离了希望的位置;
2:如果我要实现物体在终点停顿3秒再向下一个目标移动,怎么在这帧里写程序?
多谢各位大虾了。。。。。

Shockwave 动画



cxzheng123

职务:普通成员
等级:1
金币:0.0
发贴:8
#32005/10/24 16:51:26
汗死了,这个论坛没人么。。。
直接把程序贴出来了,大侠们给我看看(通过调节Speed值调节移动速度;移动起点与终点坐标分别为(126,86),(497,377)):
global py,Speed
on exitFrame me
Speed=5
py=abs((377-86).float / (497-126).float)
if sprite(1).locH < 497 then
set the loc of sprite 1 to point ( (the loch of sprite 1)+Speed , (the locv of sprite 1)+integer(Speed*py))
end if
go the frame
end



草原风

职务:版主
等级:5
金币:13.0
发贴:3489
#42005/10/27 8:00:59
cxzheng123在上个帖子中说
引用:
做了个小例子,通过控制loc的变换来控制物体的移动,可以通过调节Speed的值来控制移动速度。有点问题:
1:由于取整误差,使终点位置偏离了希望的位置;
2:如果我要实现物体在终点停顿3秒再向下一个目标移动,怎么在这帧里写程序?
多谢各位大虾了。。。。。



1、取整误差可以在最后修正:
global py,Speed
on exitFrame me
Speed=5
py=abs((377-86).float / (497-126).float)
if sprite(1).locH < 497 then
if sprite(1).loch+speed<497 then
set the loc of sprite 1 to point ( (the loch of sprite 1)+Speed , (the locv of sprite 1)+integer(Speed*py))
else
set the loc of sprite 1 to point(497,(the locv of sprite 1)+integer(speed*py))
end if
end if
go the frame
end

编辑历史:[此帖最近一次被 草原风 编辑过(编辑时间:2005-10-27 08:07:03)]