◆ 网页平面多媒体培训、认证考试免费咨询热线:400-700-5807 进入网络咨询平台 ◆
(7) 在Script窗口输入以下drawsides函数中的Lingo控制语句,如图8-25所示。
on drawsides
list=[]
repeat with i = 1 to count(allcorners)
temp=plotPoint(allcorners[i])
add list,temp
end repeat
quadlist=[:]
repeat with i =1 to count(Rlist)
thisRect=Rlist[i]
q=[list[thisRect[1]][2],list[thisRect[2]][2],list[thisRect[3]][2],list[thisRect[4]][2]]
z=[list[thisRect[1]][1],list[thisRect[2]][1],list[thisRect[3]][1],list[thisRect[4]][1]]
addprop quadlist,z,q
end repeat
sort quadlist
repeat with i =1 to count(Rlist)
sprite(i).quad=quadlist[i]
end repeat
end

图8-25 drawsides句柄
(8) 在Script窗口输入以下plotPoint函数中的Lingo控制语句,如图8-26所示。
on plotPoint objectInfo
x= getAt(objectInfo,1)
y=getAt(objectInfo,2)
z= getAt(objectInfo,3)
radius=sqrt(x*x+y*y)
if x=0.0 then angle = atan(the maxinteger)
else angle = atan(float(y)/x)
if y<0 then angle =angle+pi()
set angle =angle +gRotate
realX=radius*cos(angle)
realZ=radius*sin(angle)
realY=z
radus=sqrt(realY*realY+realZ*realZ)
if realZ = 0 then angle =atan(the maxInteger)
else angle=(atan(realY/realZ))
if realZ<0 then angle =angle +pi()
angle = angle -Planeangle
screenX=realX
screenY=radius*sin(angle)
screenZ=radius*cos(angle)
return [screenZ,point(screenX,screenY)+pCenter]
end

图8-26 plotPoint句柄
(9) 在Score窗口的Script通道中,双击第1帧。在弹出的Script窗口中,加入以下的Lingo控制语句,如图8-27所示。
on exitFrame me
framescript
go to the frame
end
(10) 至此,立体画面动画的制作完成了,播放效果如图8-28所示。

图8-27 第1帧的Lingo脚本 图8-28 立体画面播放效果 上一页 [1] [2]
 【责编:runlz】 |