[img]http://dl.iteye.com/upload/attachment/480976/ab61c670-7462-353a-8234-e2947c9652e9.png[/img]
1、基本原理:三角形相似原理
d/(d+z) = x1/x
d/(d+z) = y1/y
2、(x1, y1)为二维坐标系,(x, y)为三维坐标系,d/(d+z)为换算比率
3、二维坐标系转flash坐标系
x_flash = stageWidth/2 + x1
y_flash = stageHeight/2 + y1
4、物体宽高比例(透明度类似)
scaleX = scaleY = d/(d+z)*100
alpha = d/(d+z)*100
5、层深计算(as2.0为例)
swapDepth(10000-z) 或 swapDepth(-z)
6、镜头运动
镜头坐标(x, y, z) = 目标坐标(x, y, z) - 镜头坐标(x, y, z)