Esempio n. 1
0
        /// <summary>
        /// Builds the model.
        /// </summary>
        /// <returns>
        /// A Model3D object.
        /// </returns>
        private Object3DGroup BuildModel()
        {
            var modelGroup = new Object3DGroup();

            foreach (var g in this.Groups)
            {
                foreach (var gm in g.CreateModels(this.ModelInfo))
                {
                    modelGroup.Add(gm);
                }
            }

            return(modelGroup);
        }
Esempio n. 2
0
        /// <summary>
        /// Creates a Model3D object from the loaded file.
        /// </summary>
        /// <param name="info">
        /// The model info.
        /// </param>
        /// <returns>A Model3D group.</returns>
        public Object3DGroup BuildModel(ModelInfo info = default(ModelInfo))
        {
            Object3DGroup modelGroup = null;

            modelGroup = new Object3DGroup();
            var g  = this.CreateMeshGeometry3D(info);
            var gm = new Object3D()
            {
                Geometry = g, Transform = new List <Matrix>()
            };

            gm.Material = new PhongMaterialCore()
            {
                Name              = "DefaultVRML",
                AmbientColor      = new Color(0.2f, 0.2f, 0.2f, 1.0f),
                DiffuseColor      = new Color(0.8f, 0.8f, 0.8f, 1.0f),
                SpecularColor     = new Color(0.0f, 0.0f, 0.0f, 1.0f),
                EmissiveColor     = new Color(0.0f, 0.0f, 0.0f, 1.0f),
                SpecularShininess = 25.6f,
            };
            modelGroup.Add(gm);
            return(modelGroup);
        }