Пример #1
0
        public ML3DFaceGraphic(GraphicOverlay overlay, ML3DFace face, Context context) : base(overlay)
        {
            this.mContext = context;
            this.mLFace   = face;
            this.overlay  = overlay;
            LineWidth     = Dp2px(this.mContext, 3);

            this.keypointPaint       = new Paint();
            this.keypointPaint.Color = (Color.Red);
            this.keypointPaint.SetStyle(Paint.Style.Fill);
            this.keypointPaint.TextSize = Dp2px(context, 2);

            this.boxPaint       = new Paint();
            this.boxPaint.Color = Color.Blue;
            this.boxPaint.SetStyle(Paint.Style.Stroke);
            this.boxPaint.StrokeWidth = ML3DFaceGraphic.LineWidth;
        }
Пример #2
0
        private void DisplaySuccess(ML3DFace mLFace)
        {
            float[] projectionMatrix = new float[4 * 4];
            float[] viewMatrix       = new float[4 * 4];
            mLFace.Get3DProjectionMatrix(projectionMatrix, 1, 10);
            mLFace.Get3DViewMatrix(viewMatrix);
            DecimalFormat decimalFormat = new DecimalFormat("0.00");
            string        result        = "3DFaceEulerX: " + decimalFormat.Format(mLFace.Get3DFaceEulerX());

            result += "\n3DFaceEulerY: " + decimalFormat.Format(mLFace.Get3DFaceEulerY());
            result += "\n3DFaceEulerZ: " + decimalFormat.Format(mLFace.Get3DFaceEulerZ());
            result += "\n3DProjectionMatrix:";
            for (int i = 0; i < 16; i++)
            {
                result += " " + decimalFormat.Format(projectionMatrix[i]);
            }
            result += "\nViewMatrix:";
            for (int i = 0; i < 16; i++)
            {
                result += " " + decimalFormat.Format(viewMatrix[i]);
            }

            this.mTextView.Text = result;
        }