2008/09/06

using camera Adobe Papervision3D sphere 環境著球轉

最近想要建立 3D 的操作環境,安裝Flex Builder, 後來也找到Papervision3D,前者是 Adobe 的 Flash Integrated developing environment,後者是 based on actionscript for flash的 3D library, 顧名思義,用來在 "paper" 的視野上建立 3D 的運作,還算不錯,而且是 open source, 將來有機會也拿來應用在 mozilla 上,例如採用 Javascript + SVG|OpenGL|Canvas 上。

下面是一段移動 camera 環繞著球面轉動的運作的步驟:

1. Determine yAngle, the angle by which you want to rotate the camera up
2. Determine xAngle, the angle by which you want to rotate the camera right
3. Determine cameraDistance, the distance the camera is from the center of the sphere
4. Move the camera to the center of the sphere using the moveForward function: camera.moveForward(cameraDistance)
5. Tilt the camera up: camera.tilt(yAngle)
6. Pan the camera right: camera.pan(xAngle)
7. Move the camera back using the moveBackward function:
camera.moveBackward(cameraDistance)

0 意見: