Find most right and left point of a horizontal circle in 3d Vector environment

Posted by Olivier de Jonge on Stack Overflow See other posts from Stack Overflow or by Olivier de Jonge
Published on 2010-05-20T14:45:54Z Indexed on 2010/05/20 16:40 UTC
Read the original article Hit count: 172

Filed under:
|
|
|

I'm drawing a 3D pie chart that is rendered with in 3D vectors, projected to 2D vectors and then drawn on a Graphics object. I want to calculate the most left and right point of the circle The method to create a vector, draw and project to a 2d vector are below. Anyone knows the answer?

public class Vector3d
{

    public var x:Number;
    public var y:Number;
    public var z:Number;
    //the angle that the 3D is viewed in tele or wide angle.
    public static var viewDist:Number = 700;


    function Vector3d(x:Number, y:Number, z:Number){
        this.x = x;
        this.y = y;
        this.z = z;
    }

    public function project2DNew():Vector
    {
        var p:Number = getPerspective();
        return new Vector(p * x, p * y);
    }

    public function getPerspective():Number{
        return viewDist / (this.z + viewDist);
    }
}

© Stack Overflow or respective owner

Related posts about flex

Related posts about actionscript-3