/// <summary> /// Sets up the View Model for the given mesh data /// </summary> /// <param name="meshData">The models data</param> public Composite3DViewModel() { RenderTechniquesManager = new CustomRenderTechniquesManager(); RenderTechnique = RenderTechniquesManager.RenderTechniques["RenderCustom"]; EffectsManager = new CustomEffectsManager(RenderTechniquesManager); this.Camera = new PerspectiveCamera(); string substr = Properties.Settings.Default.BG_Color.Substring(3, 2); int red = int.Parse(substr, System.Globalization.NumberStyles.HexNumber); substr = Properties.Settings.Default.BG_Color.Substring(5, 2); int green = int.Parse(substr, System.Globalization.NumberStyles.HexNumber); substr = Properties.Settings.Default.BG_Color.Substring(7, 2); int blue = int.Parse(substr, System.Globalization.NumberStyles.HexNumber); BackgroundColor = new Color4(red / 255f, green / 255f, blue / 255f, 1.0f); this.AmbientLightColor = new Color4(0.1f, 0.1f, 0.1f, 1.0f); this.Light1Direction = new Vector3(0, 0, -1f); this.Light2Direction = new Vector3(0, 0, 1f); this.Light1Color = Color.White; this.RenderLight1 = true; this.RenderLight2 = true; }
/// <summary> /// Sets up the View Model for the given mesh data /// </summary> /// <param name="meshData">The models data</param> public Composite3DViewModel() { RenderTechniquesManager = new CustomRenderTechniquesManager(); RenderTechnique = RenderTechniquesManager.RenderTechniques["RenderCustom"]; EffectsManager = new CustomEffectsManager(RenderTechniquesManager); this.Camera = new PerspectiveCamera(); BackgroundColor = Color.Gray; this.AmbientLightColor = new Color4(0.1f, 0.1f, 0.1f, 1.0f); this.Light1Direction = new Vector3(0, 0, -1f); this.Light2Direction = new Vector3(0, 0, 1f); this.Light1Color = Color.White; this.RenderLight1 = true; this.RenderLight2 = true; }
/// <summary> /// Sets up the View Model for the given mesh data /// </summary> /// <param name="meshData">The models data</param> public Composite3DViewModel(List <MDLTEXData> meshData) { mData = meshData; for (int i = 0; i < meshData.Count; i++) { setModel(i); } RenderTechniquesManager = new CustomRenderTechniquesManager(); RenderTechnique = RenderTechniquesManager.RenderTechniques["RenderCustom"]; EffectsManager = new CustomEffectsManager(RenderTechniquesManager); Vector3 center; try { center = SecondModel.BoundingSphere.Center; } catch { center = Model.BoundingSphere.Center; } Camera = new PerspectiveCamera { Position = new Media3D.Point3D(center.X, center.Y, center.Z + 2), LookDirection = new Media3D.Vector3D(0, 0, center.Z - 2) }; BackgroundColor = Color.Gray; this.AmbientLightColor = new Color4(0.1f, 0.1f, 0.1f, 1.0f); this.Light1Direction = new Vector3(0, 0, -1f); this.Light2Direction = new Vector3(0, 0, 1f); this.Light1Color = Color.White; this.RenderLight1 = true; this.RenderLight2 = true; this.ModelTransform = new TranslateTransform3D(0, 0, 0); this.SecondModelTransform = new TranslateTransform3D(0, 0, 0); this.ThirdModelTransform = new TranslateTransform3D(0, 0, 0); }