Esempio n. 1
0
        private void DrawCombinedMesh()
        {
            MeshPolygonGroup polygonGroup = (MeshPolygonGroup)Shape.PolygonGroups[LODMeshLevel];

            GL.DrawElements(OpenGLHelper.PrimitiveTypes[polygonGroup.PrimitiveType],
                            (int)polygonGroup.Faces.Count,
                            polygonGroup.DrawElementsType,
                            (int)0);
        }
Esempio n. 2
0
        private void DrawSubMesh()
        {
            MeshPolygonGroup polygonGroup = (MeshPolygonGroup)Shape.PolygonGroups[LODMeshLevel];

            foreach (var subMesh in polygonGroup.SubMeshes)
            {
                GL.DrawElements(OpenGLHelper.PrimitiveTypes[polygonGroup.PrimitiveType],
                                (int)subMesh.Count,
                                polygonGroup.DrawElementsType,
                                (int)subMesh.Offset);
            }
        }
Esempio n. 3
0
        /// <summary>
        /// Updates the current polygon groups from the shape data.
        /// </summary>
        public void UpdatePolygonGroups()
        {
            PolygonGroups = new List <STPolygonGroup>();

            int boundingIndex = 0;

            foreach (var mesh in Shape.Meshes)
            {
                //Set group as a level of detail
                var group = new MeshPolygonGroup(Shape, mesh, boundingIndex);
                group.Material = Material;
                PolygonGroups.Add(group);

                //Todo not all versions use per mesh boundings
                //boundingIndex += mesh.SubMeshes.Count;
            }
        }