(1) 启动Director 8.5。执行Modify→Movie→Properties命令,在弹出的舞台属性检查器对话框中将电影舞台的大小设置为450×450,将背景颜色设置为黑色,如图8-19所示。

图8-19 设置舞台的属性
(2) 按Ctrl+R组合键,导入6张图片到Cast窗口中,如图8-20所示。

图8-20 导入图片
(3) 将Cast演员逐一拖动到舞台上,生成6个精灵,如图8-21所示。

图8-21 生成精灵
(4) 在工作窗口单击工具栏上的Script按钮
,在弹出的Script窗口中,设置Lingo语句如下,如图8-22所示。
:global allcorners
global pCenter
global Rlist
global gRotate
global Planeangle
on startMovie
initbox
end
(5) 在initbox函数中,设置以下Lingo语句,如图8-23所示。
on initbox
allcorners=[[–60,–60,–60],[60,–60,–60],[60,60,–60],[–60,60,–60],[–60,–60,60],
,,[60,–60,60],[60,60,60],[–60,60,60]]
pCenter=point(200,175)
Rlist=[[1,2,3,4],[1,2,6,5],[3,4,8,7],[2,3,7,6],[1,4,8,5],[5,6,7,8]]
end

图8-23 Initbox句柄
(6) 设置framescript句柄,输入Lingo控制语句如下,如图8-24所示。
on framescript
gRotate=gRotate-(float(the mouseH-320)/30)*pi()/100
Planeangle=-(float(the mouseV-240)/30)*pi()/20
drawsides
end

图8-24 framescript句柄
(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 立体画面播放效果
Tags:Director制作立体画面动画特效,Director学习教程,director-jiaocheng
上篇«director8中行为库的应用
下篇»Director中图像替换动画特效制作
