Пример #1
0
 // Renders the endpoints of a rectangle with the given rectangle, color, and point size
 public virtual void renderRectEndpoints(Rectangle bounds, Color color, float pointSize)
 {
     renderEndpoints(bounds.getEndpoints(), color, pointSize);
 }
Пример #2
0
        // Renders the outline of a rectangle with the given rectangle, color, and line width
        public virtual void outlineRect(Rectangle bounds, Color color, float lineWidth)
        {
            // Variables
            Point3[]	endpoints=	bounds.getEndpoints();

            GL.Disable(EnableCap.Texture2D);
            GL.LineWidth(lineWidth);

            GL.Begin(PrimitiveType.Lines);
            {
                GL.Color4(color.red, color.green, color.blue, color.alpha);

                for(int i= 0; i< endpoints.Length; i++)
                {
                    GL.Vertex3(endpoints[i].x, endpoints[i].y, endpoints[i].z);
                    if(i== endpoints.Length-1)
                        GL.Vertex3(endpoints[0].x, endpoints[0].y, endpoints[0].z);
                    else
                    GL.Vertex3(endpoints[i+1].x, endpoints[i+1].y, endpoints[i+1].z);
                }
            }
            GL.End();

            GL.LineWidth(1f);
            GL.Enable(EnableCap.Texture2D);

            renderEndpoints(endpoints, color, lineWidth);
        }
Пример #3
0
        // Renders a rectangle with the given rectangle and color
        public virtual void renderRect(Rectangle bounds, Color color)
        {
            // Variables
            Point3[]	endpoints=	bounds.getEndpoints();

            GL.Disable(EnableCap.Texture2D);

            GL.Begin(PrimitiveType.Quads);
            {
                GL.Color4(color.red, color.green, color.blue, color.alpha);

                // Rectangle ABCD
                GL.Vertex3(endpoints[0].x, endpoints[0].y, endpoints[0].z);
                GL.Vertex3(endpoints[1].x, endpoints[1].y, endpoints[1].z);
                GL.Vertex3(endpoints[2].x, endpoints[2].y, endpoints[2].z);
                GL.Vertex3(endpoints[3].x, endpoints[3].y, endpoints[3].z);
            }
            GL.End();

            GL.Enable(EnableCap.Texture2D);
        }