Exemple #1
0
        internal void Draw(VertexBuffer <ColouredVertex> vertexBuffer)
        {
            var verticies = _faces.SelectMany(f => f.HalfEdges().Select(he => he.TargetVertex));

            foreach (var vertex in verticies)
            {
                vertexBuffer.AddVertex(vertex.Vertex);
            }
        }
Exemple #2
0
        private void DrawBuferSpritesPoints(int NumberOfSprites)
        {
            for (int i = 0; i < NumberOfSprites; i++)
            {
                var r = new Random((int)DateTime.Now.Ticks);

                float x = (float)r.NextDouble() * 110 - 55;
                float y = (float)r.NextDouble() * 110 - 55;
                float z = (float)r.NextDouble() * 110 - 55;
                float w = (float)r.NextDouble() * 55;

                VertexBuffer.AddVertex(x, y, z, w);

                Thread.Sleep(1);
            }
        }
        public void RenderFaceNegY(ref VertexBuffer buffer, double x, double y, double z)
        {
            double d1 = x + this.RenderMinX;
            double d2 = x + this.RenderMaxX;
            double d3 = y + this.RenderMinY;
            double d4 = z + this.RenderMinZ;
            double d5 = z + this.RenderMaxZ;

            buffer.AddVertex(d2, d3, d4);
            buffer.AddVertex(d1, d3, d4);
            buffer.AddVertex(d2, d3, d5);

            buffer.AddVertex(d1, d3, d5);
            buffer.AddVertex(d2, d3, d5);
            buffer.AddVertex(d2, d3, d4);
        }