Exemplo n.º 1
0
        public Orientation(Vector axisZ)
        {
            Vector vector;

            if (System.Math.Abs(axisZ.X) < System.Math.Abs(axisZ.Y))
            {
                vector = new Vector(1.0, 0.0, 0.0);
            }
            else
            {
                vector = new Vector(0.0, 1.0, 0.0);
            }
            axisZ = Vector.Unit(axisZ);
            Vector v       = Vector.Unit(Vector.Cross(vector, axisZ));
            Vector vector3 = Vector.Unit(Vector.Cross(axisZ, v));

            this.m_Xx = v.X;
            this.m_Xy = v.Y;
            this.m_Xz = v.Z;
            this.m_Yx = vector3.X;
            this.m_Yy = vector3.Y;
            this.m_Yz = vector3.Z;
            this.m_Zx = axisZ.X;
            this.m_Zy = axisZ.Y;
            this.m_Zz = axisZ.Z;
        }
Exemplo n.º 2
0
        public Orientation(Vector axisX, Vector axisY)
        {
            Vector u = Vector.UnitCross(axisX, axisY);

            axisX     = Vector.Unit(axisX);
            axisY     = Vector.Cross(u, axisX);
            this.m_Xx = axisX.X;
            this.m_Xy = axisX.Y;
            this.m_Xz = axisX.Z;
            this.m_Yx = axisY.X;
            this.m_Yy = axisY.Y;
            this.m_Yz = axisY.Z;
            this.m_Zx = u.X;
            this.m_Zy = u.Y;
            this.m_Zz = u.Z;
        }