Implementation of arcades for Papervision3D

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 started writing my own implementation based on the DirectX ArcBall class.

However, this does not work correctly and I do not understand why.

From the starting position of the cubes, I can click and drag the arcades as I would expect.

However, if I start to accumulate the axis / angles in the quaternion, the directions are reversed when the cube rotates enough. There should be no change in direction of rotation or any other strange behavior.

I scoured the internet and didn't find anything directly related to Papervision3D and arcballs. (Perhaps there is an implementation of arcball for another 3D flash engine?)

Any help on this would be greatly appreciated.

** EDIT ** Added 500 point bonus for answering with a work arc for Papervision3D (there must be at least 1 piece of object (i.e.) in the scene).

+2


source to share


4 answers


On the previous page, provided by Dave K, there are some examples of arkball, here is one that fits the typical physics expected from trackball. However, you can expand your search a bit and search for quaternions and papervision.

If you are not familiar with quaternions , they represent an element of 4D vector space and the underlying underlying arcball effect you are looking for. This tutorial will help you speed up your quaternion math, which is fairly easy to understand.

Quaternions are handled natively by Papervision, so tutorials aren't that hard to find. A quick google look gave the following results.



Quaternions in Papervision3D

A conversation on papervision3d and a scary lock in your pocket

Finally, a list on Wordpress blogs discussing the topic (not all stick related)

+1


source


I want you to search for this: http://www.kelvinluck.com/assets/papervision3d/cube_tweaks/



0


source


Is this what you are looking for: Dragging an object to rotate ?

here's the interesting part:

    var currentMousePoint:Point = new Point(viewport.containerSprite.mouseX, viewport.containerSprite.mouseY);

    if(isMouseDown)
    {
        var difference:Point = currentMousePoint.subtract(previousMousePoint);
        var vector:Number3D = new Number3D(difference.x, difference.y, 0);

        var rotationAxis:Number3D = Number3D.cross(vector, FORWARD);
        rotationAxis.normalize();

        var distance:Number = Point.distance(currentMousePoint, previousMousePoint);
        var rotationMatrix:Matrix3D = Matrix3D.rotationMatrix(rotationAxis.x, -rotationAxis.y, rotationAxis.z, distance/250);

        sphere.transform.calculateMultiply3x3(rotationMatrix, sphere.transform);
    }

    previousMousePoint = currentMousePoint;

      

0


source


Not at all sure if this is what you want, but this project is mostly a Flash implementation and some elements target papervision3D:

http://code.google.com/p/spinnyglobe/

in particular:

http://code.google.com/p/spinnyglobe/source/browse/trunk/flash/org/makerlab/ArcBall.as?r=122

0


source







All Articles