Papervision3D 是否有 arcball 实现?
有许多针对 Flash/ActionScript 的轨迹球实现,但没有专门针对 Papervision3D 的实现。
以下是 Flash 的 arcball 实现示例:
http://www.unitzeroone.com/blog/2009/09/08/source-better-flash-10-3d-interaction-arcball/
我已经开始编写自己的基于实现的在 DirectX ArcBall 类上。
然而,它无法正常工作,我不知道为什么。
从立方体的初始位置,我可以按照预期单击并拖动轨迹球。
但是,如果我开始累积四元数中的轴/角度,当立方体旋转足够时,方向就会相反。不应出现旋转方向反转或任何其他奇怪的行为。
我搜索了互联网,没有发现任何与 Papervision3D 和 arcballs 直接相关的内容。 (也许有另一个 3D Flash 引擎的 arcball 实现?)如果您能
在这方面提供任何帮助,我们将不胜感激。
** 编辑 ** 为 Papervision3D 的工作轨迹球实现的答案添加了 500 点赏金(场景中必须至少有 1 个对象(即)立方体)。
Is there an arcball implementation for Papervision3D?
There are many arcball implementations for Flash/ActionScript but none specifically for Papervision3D.
Here's an example of an arcball implementation for flash:
http://www.unitzeroone.com/blog/2009/09/08/source-better-flash-10-3d-interaction-arcball/
I have taken to writing my own implementation based on the DirectX ArcBall class.
It does not work correctly, however, and I am at a loss as to why.
From the cubes initial position I can click and drag the arcball as one would expect.
However, if I start accumulating the axis/angles in a quaternion, the directions reverse when the cube is rotated enough. There should be no reversing of the directions of rotation or any other weird behaviour.
I have scoured the internet and found nothing directly related to Papervision3D and arcballs. (Perhaps there is an arcball implementation for another 3D Flash engine?)
Any help in this matter would be greatly appreciated.
** EDIT ** Added a 500 point bounty for an answer with a working arcball implementation for Papervision3D (must have at least 1 object (i.e.) cube in the scene).
发布评论
评论(4)
Dave K 之前提到的页面有许多 arcball 示例,这里 符合轨迹球的典型物理特性。然而,您可能想扩大搜索范围并寻找四元数和纸视觉。
如果您不熟悉四元数,它们是 4 维向量空间的元素,并且您正在寻找的轨迹球效果背后的基础。这个教程将帮助您快速了解四元数数学,这相当容易理解。
四元数由 Papervision 本地处理,因此教程并不难找到。快速浏览一下 google 产生了以下结果。
Papervision3D 中的四元数
A 关于 papervision3d 和可怕的万向节锁的对话
最后,一个 讨论该主题的 WordPress 博客列表(并非全部与 Flash 相关)
The page mentioned by Dave K earlier has a number of arcball examples, here is one that conforms to the typical physics expected out of a trackball. However you may want to broaden your search a bit and look for quaternions and papervision.
If you are unfamiliar with quaternions, they are an element of a 4 dimensional vector-space and the basis behind the arcball effect you are looking for. This tutorial will get you up to speed on quaternion math that is fairly easy to understand.
Quaternions are handled natively by Papervision so tutorials are not that hard to find. A quick look at google produced the following results.
Quaternions in Papervision3D
A conversation on papervision3d and the dreaded Gimbal lock
Finally, a list of wordpress blogs discussing the topic (not all flash related)
我猜你正在寻找这个:
http://www.kelvinluck.com/assets/papervision3d/cube_tweaks/
I thing you are looking for this:
http://www.kelvinluck.com/assets/papervision3d/cube_tweaks/
完全不确定这是否是您想要的,但该项目基本上是一个 Flash 实现,其中有一些针对 papervision3D 的元素:
http://code.google.com/p/spinnyglobe/
特别是:
http://code.google.com/p/spinnyglobe/source/browse/trunk/flash/org/makerlab/ArcBall.as? r=122
Not at all sure if this is what you want, but this project is basically a Flash implementation, with some elements aimed at papervision3D:
http://code.google.com/p/spinnyglobe/
particularly:
http://code.google.com/p/spinnyglobe/source/browse/trunk/flash/org/makerlab/ArcBall.as?r=122
这就是您要查找的内容:拖动对象进行旋转?
这是有趣的部分:
This is what you are looking for:Dragging an object to rotate ?
here's the interesting part: