예제 #1
0
        public void BuildVertices(byte[] vertices)
        {
            int size = Marshal.SizeOf(typeof(RawVertex));
            var barray = new byte[size];

            using (var ms = new MemoryStream(vertices))
            {
                for (int i = 0; i < VertexCount; i++)
                {
                    ms.Read(barray, 0, size);
                    var rawvert = Functions.ByteArrayToStructure<RawVertex>(barray);
                    var vert = new Vertex(
                        _centerX + rawvert.x * _scale,
                        _centerY + rawvert.y * _scale,
                        _centerZ + rawvert.z * _scale);
                    _vertices.Add(vert);
                }
            }
        }
예제 #2
0
 //private short _v1;
 //private short _v2;
 //private short _v3;
 public Polygon(bool solid, Vertex v1, Vertex v2, Vertex v3)
 {
     _solid = solid;
     _v1 = v1;
     _v2 = v2;
     _v3 = v3;
 }