Exemplo n.º 1
0
        // Gets the endpoint of the renderable object
        public Point3[] getEndpoints()
        {
            // Variables
            Point3[]	endpoints=	new Point3[]	{
                new Point3(a.x, a.y, a.z),
                new Point3(b.x, b.y, b.z)
            };

            return endpoints;
        }
Exemplo n.º 2
0
 public Matrix3x4(Vector3 xAxis, Vector3 yAxis, Vector3 zAxis, Point3 origin)
 {
     xx=	xAxis.x;
     xy=	xAxis.y;
     xz=	xAxis.z;
     yx=	yAxis.x;
     yy=	yAxis.y;
     yz=	yAxis.z;
     zx=	zAxis.x;
     zy=	zAxis.y;
     zz=	zAxis.z;
     ox=	origin.x;
     oy=	origin.y;
     oz=	origin.z;
 }
Exemplo n.º 3
0
 public virtual void renderString(string str, Font font, Point3 location)
 {
     renderString(str, font, location, defaultColor, font.size);
 }
Exemplo n.º 4
0
 public virtual void renderString(string str, Font font, Point3 location, Color color)
 {
     renderString(str, font, location, color, font.size);
 }
Exemplo n.º 5
0
        // Renders a string with the given string, position, color, font, and font size
        public virtual void renderString(string str, Font font, Point3 location, Color color, float fontSize)
        {
            if(str.IndexOf("\n")!= -1)
            {
                // Variables
                string[]	breaks=	str.Split("\n".ToCharArray());

                for(int i= 0; i< breaks.Length; i++)
                    renderString(breaks[i], font, new Point3(location.x, location.y+((font.getMaxHeight()+4)*i), location.z), color, fontSize);

                return;
            }

            // Variables
            List<TextRenderingHelper>	helpers=	new List<TextRenderingHelper>();
            float	currX=	location.x;
            float[]	wh=	new float[2];

            for(int i= 0; i< str.Length; i++)
                helpers.add(new TextRenderingHelper(font, font.glyphs[str[i]]));

            if(currTextureID!= font.texture.ID)
                bindToTexture(font.texture.ID);

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

                for(int i= 0; i< helpers.size; i++)
                {
                    wh[0]=	helpers.items[i].glyph.size.width*(fontSize/font.originalSize);
                    wh[1]=	helpers.items[i].glyph.size.height*(fontSize/font.originalSize);

                    // Top Left
                    GL.TexCoord2(helpers.items[i].lcoord.u, helpers.items[i].lcoord.v);
                    GL.Vertex3(currX, location.y, location.z);

                    // Bottom Left
                    GL.TexCoord2(helpers.items[i].lcoord.u, helpers.items[i].rcoord.v);
                    GL.Vertex3(currX, location.y+wh[1], location.z);

                    // Bottom Right
                    GL.TexCoord2(helpers.items[i].rcoord.u, helpers.items[i].rcoord.v);
                    GL.Vertex3(currX+wh[0], location.y+wh[1], location.z);

                    // Top Right
                    GL.TexCoord2(helpers.items[i].rcoord.u, helpers.items[i].lcoord.v);
                    GL.Vertex3(currX+wh[0], location.y, location.z);

                    currX+=	wh[0];
                }
            }
            GL.End();
        }
Exemplo n.º 6
0
 public virtual void renderPoint(Point3 point)
 {
     renderPoint(point, defaultColor, 1f);
 }
Exemplo n.º 7
0
 public Rectangle(Point3	pmPosition, Size2 pmSize, Vector3 pmNormal)
 {
     position=	pmPosition;
     size=	pmSize;
     pNormal=	pmNormal;//.normalizeDest();
 }
Exemplo n.º 8
0
 public virtual void renderLineEndpoints(Point3 pt1, Point3 pt2)
 {
     renderLineEndpoints(pt1, pt2, defaultColor, 1f);
 }
Exemplo n.º 9
0
 public virtual void renderLineEndpoints(Point3 pt1, Point3 pt2, Color color)
 {
     renderLineEndpoints(pt1, pt2, color, 1f);
 }
Exemplo n.º 10
0
 public virtual void renderLineEndpoints(Point3 pt1, Point3 pt2, float pointSize)
 {
     renderLineEndpoints(pt1, pt2, defaultColor, pointSize);
 }
Exemplo n.º 11
0
 // Renders the endpoints of a line with the given points, color, and point size
 public virtual void renderLineEndpoints(Point3 pt1, Point3 pt2, Color color, float pointSize)
 {
     renderEndpoints(new Point3[]{pt1, pt2}, color, pointSize);
 }
Exemplo n.º 12
0
 public virtual void renderLine(Point3 pt1, Point3 pt2, float lineWidth)
 {
     renderLine(pt1, pt2, defaultColor, lineWidth);
 }
Exemplo n.º 13
0
        // Renders a line with the given points, color, and line width
        public virtual void renderLine(Point3 pt1, Point3 pt2, Color color, float lineWidth)
        {
            GL.Disable(EnableCap.Texture2D);
            GL.LineWidth(lineWidth);

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

                // Line AB
                GL.Vertex3(pt1.x, pt1.y, pt1.z);
                GL.Vertex3(pt2.x, pt2.y, pt1.z);
            }
            GL.End();

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

            renderEndpoints(new Point3[]{pt1, pt2}, color, lineWidth);
        }
Exemplo n.º 14
0
        // Renders the endpoints of with the given points, color, and point size
        protected virtual void renderEndpoints(Point3[] endpoints, Color color, float pointSize)
        {
            GL.Disable(EnableCap.Texture2D);
            GL.PointSize(pointSize);

            GL.Begin(PrimitiveType.Points);
            {
                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);
            }
            GL.End();

            GL.PointSize(1f);
            GL.Enable(EnableCap.Texture2D);
        }
Exemplo n.º 15
0
        // Renders a point with the given point, color, and point size
        public virtual void renderPoint(Point3 point, Color color, float pointSize)
        {
            GL.Disable(EnableCap.Texture2D);
            GL.PointSize(pointSize);

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

                // Point A
                GL.Vertex3(point.x, point.y, point.z);
            }
            GL.End();

            GL.PointSize(1f);
            GL.Enable(EnableCap.Texture2D);
        }
Exemplo n.º 16
0
 public Triangle(Point3 pmA, Point3 pmB, Point3 pmC)
 {
     a=	pmA;
     b=	pmB;
     c=	pmC;
 }
Exemplo n.º 17
0
 public virtual void renderPoint(Point3 point, Color color)
 {
     renderPoint(point, color, 1f);
 }
Exemplo n.º 18
0
        // Gets the endpoint of the renderable object
        public Point3[] getEndpoints()
        {
            // Variables
            Point3[]	endpoints=	new Point3[]	{
                new Point3(position.x, position.y, position.z),
                new Point3(position.x+size.width, position.y, position.z),
                new Point3(position.x+size.width, position.y+size.height, position.z),
                new Point3(position.x, position.y+size.height, position.z)
            };

            return endpoints;
        }
Exemplo n.º 19
0
 public virtual void renderPoint(Point3 point, float pointSize)
 {
     renderPoint(point, defaultColor, pointSize);
 }
Exemplo n.º 20
0
 public Rectangle(Point3 pmPosition, Size2 pmSize)
     : this(pmPosition, pmSize, Vector3.ZERO)
 {
 }
Exemplo n.º 21
0
 public Segment(Point3 pmA, Point3 pmB)
 {
     a=	pmA;
     b=	pmB;
 }