/// <summary>
        /// Draw axis with arc ball rotation effect on viewport as an UI.
        /// </summary>
        /// <param name="anchor">the edges of the viewport to which a SimpleUIAxis is bound and determines how it is resized with its parent.</param>
        /// <param name="margin">the space between viewport and SimpleUIAxis.</param>
        /// <param name="size">Stores width when <see cref="OpenGLUIRect.Anchor"/>.Left & <see cref="OpenGLUIRect.Anchor"/>.Right is <see cref="OpenGLUIRect.Anchor"/>.None.
        /// <para> and height when <see cref="OpenGLUIRect.Anchor"/>.Top & <see cref="OpenGLUIRect.Anchor"/>.Bottom is <see cref="OpenGLUIRect.Anchor"/>.None.</para></param>
        /// <param name="zNear"></param>
        /// <param name="zFar"></param>
        /// <param name="rectColor"></param>
        /// <param name="rightHandAxis"></param>
        public SimpleUIAxis(AnchorStyles anchor, Padding margin, System.Drawing.Size size, int zNear = -1000, int zFar = 1000, GLColor rectColor = null, CoordinateSystem coordSystem = CoordinateSystem.RightHand)
            : base(anchor, margin, size, zNear, zFar)
        {
            axis = new CylinderAxis();
            LinearTransformationEffect axisTransform = new SharpGL.SceneGraph.Effects.LinearTransformationEffect();

            this.axisTransform = axisTransform.LinearTransformation;
            axis.AddEffect(axisTransform);
            base.AddChild(axis);
            this.RectColor   = new GLColor(1, 1, 0, 1);// red(x axis) + green(y axis)
            this.CoordSystem = coordSystem;
        }
Esempio n. 2
0
        /// <summary>
        /// Draw color indicator on viewport as an UI.
        /// </summary>
        /// <param name="anchor">the edges of the viewport to which a SimpleUIColorIndicator is bound and determines how it is resized with its parent.</param>
        /// <param name="margin">the space between viewport and SimpleUIColorIndicator.</param>
        /// <param name="size">Stores width when <see cref="OpenGLUIRect.Anchor"/>.Left & <see cref="OpenGLUIRect.Anchor"/>.Right is <see cref="OpenGLUIRect.Anchor"/>.None.
        /// <para> and height when <see cref="OpenGLUIRect.Anchor"/>.Top & <see cref="OpenGLUIRect.Anchor"/>.Bottom is <see cref="OpenGLUIRect.Anchor"/>.None.</para></param>
        /// <param name="zNear"></param>
        /// <param name="zFar"></param>
        /// <param name="rectColor"></param>
        public SimpleUIColorIndicator(AnchorStyles anchor, Padding margin, System.Drawing.Size size, int zNear = -1000, int zFar = 1000, GLColor rectColor = null)
            : base(anchor, margin, size, zNear, zFar)
        {
            {
                this.colorBar = new ColorIndicatorBar()
                {
                    Name = "color indicator's bar"
                };
                var colorBarTransform = new SharpGL.SceneGraph.Effects.LinearTransformationEffect();
                colorBar.AddEffect(colorBarTransform);
                base.AddChild(colorBar);
                this.colorBarTransform = colorBarTransform.LinearTransformation;
            }

            {
                this.colorNumber = new ColorIndicatorNumber()
                {
                    Name = "color indicator's number"
                };
                base.AddChild(colorNumber);
            }
        }