예제 #1
0
    Vector3 SphericalPos(Mouse mouse)
    {
        Theta = Theta.AddDeg(mouse.Delta.X);
        Phi   = Phi.AddDegClamp(mouse.Delta.Y);
        // Util.DebugWrite(Phi.ToString());
        float   t    = Theta.Rad( );
        float   p    = Phi.Rad( );
        float   x    = Distance * Util.Sin(p) * Util.Sin(t);
        float   y    = Distance * Util.Cos(p);
        float   z    = Distance * Util.Sin(p) * Util.Cos(t);
        Vector3 temp = new Vector3(x, y, z);

        return(temp);
    }