主题:  我看不懂用quad属性建立3D立方体的例子。

laraboy

职务:普通成员
等级:1
金币:0.0
发贴:15
#12002/1/21 17:05:15
谁能帮我解释一下,是director8.0开发使用手册P297页得源程序。好复杂哟!!!
回复:
这里:

-- add to rotation based on mouse location
gRotate = gRotate - (float(the mouseH-320)/30)*pi()/100

为什么要除30和100呀?

回复:
还有这里:

-- compute the angle
if x = 0.0 then angle = atan(the maxInteger)
else angle = atan(float(y)/x)
if y < 0 then angle = angle + pi()

-- rotate
set angle = angle+gRotate

-- compute new x, y, and z
realX = radius*cos(angle)
realZ = radius*sin(angle)
realY = Z

这里计算夹角好像有些糊涂啊! 还请高手指点一二。谢谢谢谢!!!