Select Page

Dynamic Text around an Ellipse

Recently I had to create a dynamic menu that required some text to wrap around an ellipse. Getting the rotation correct involved calculating the angle of the tangent around the ellipse which was a challenge. Also the letter spacing was tricky and I don’t think I have the best solution for this but it seems to work quite well.

Here is a quick demo I put together tonight of it in action

ellipticaltext

click to launch
download source CS5 (also requires minimalcomps Slider source)

Dragging in Papervision 3D – example

UPDATE 29/09/09: This technique is possibly no longer valid with the latest version of Papervision3D.


Dragging in Papervision example

Here is a small example I put together quickly today to demonstrate how to drag in 3D using Papervision and the InteractiveUtils.getMapCoordAtPointDO3D function.
Since my last post on this in December last year, the Papervision getMapCoordAtPointDO3D method returned object’s x and y values seemed to have changed by a factor of 36.

UPDATE 29/09/09: This technique is possibly no longer valid with the latest version of Papervision3D.

private function _updateDrag(e:Event):void 
{
    // get the update position on the plane
    var obj:Object = InteractiveUtils.getMapCoordAtPointDO3D(_selectedPlane, 
                                        _selectedPlane.container.mouseX, 
                                        _selectedPlane.container.mouseY)
    // move the dragged plane to the new postion with the offset                
    _selectedPlane.x = _selectedPlane.x + obj.x * 36 - _drag_X_offset;
    _selectedPlane.y = _selectedPlane.y - obj.y * 36  + _drag_Y_offset;
}

Click here to see it in action.

The source files can be downloaded here.