Example #1
0
        private List<VertexPositionNormalTexture> getVertices(ShapeReadingData data)
        {
            List<VertexPositionNormalTexture> result =
                new List<VertexPositionNormalTexture>();

            for (int i = 0; i < data.Vertices.Length; i++)
                result.Add(
                    new VertexPositionNormalTexture
                    {
                        Position = data.Vertices[i].Position,
                        Normal = data.Vertices[i].Normal,
                        TextureCoordinate = new Vector2(0, 0)
                    });

            return result;
        }
Example #2
0
        //, TransData transData)
        public ShapeNode(ShapeReadingData data)
        {
            this.Name = data.Name;
            this.ParentIndex = data.ParentIndex;

            this._vertices = getVertices(data);
            //this._vertexCount = data.Vertices.Length;
            //this.IndexBuffer = data.IndexBuffer;
            _indices = new List<ushort>();
            ushort[] indices=new ushort[data.IndexBuffer.IndexCount];

            data.IndexBuffer.GetData<ushort>(indices);
            foreach (ushort index in indices)
                _indices.Add(index);
            //RenderVertices = new List<VertexPositionNormalTexture>();
            this._isIntialized = false;
            BoundingSpheres = data.BoundingSpheres;
            /*VertexBuffer = new DynamicVertexBuffer(IndexBuffer.GraphicsDevice,
                typeof(VertexPositionNormalTexture), data.Vertices.Length, BufferUsage.WriteOnly);
            */
        }