public void AddSceneObjects(double packageHeight, double packageWidth, double packageLength, double paletteWidth, double paletteLength, int levels = 1) { Levels = levels; PackageHeight = packageHeight; PackageWidth = packageWidth; PackageLength = packageLength; PaletteWidth = paletteWidth; PaletteLength = paletteLength; ModelSource = new Model3DGroup(); paletteBase = new PaletteBase(packageHeight, packageWidth, packageLength, paletteWidth, paletteLength); ModelSource.Children.Add(paletteBase.GetModel()); packagesGenerator = new PackagesGenerator(packageHeight, packageWidth, packageLength, paletteWidth, paletteLength, Levels); ModelSource.Children.Add(packagesGenerator.GetModel()); Transform3DGroup TranslationGroup = new Transform3DGroup(); TranslationGroup.Children.Add(new RotateTransform3D(new AxisAngleRotation3D(new Vector3D(0, 1, 0), 90))); TranslationGroup.Children.Add(new TranslateTransform3D(new Vector3D(0, 0, 0))); ModelSource.Transform = TranslationGroup; ChangeFocus(); }
public ViewPortData() { ModelSource = new Model3DGroup(); MainCamera = new PerspectiveCamera(); CameraUpdate = (PerspectiveCamera Camera) => { MainCamera.Position = Camera.Position; MainCamera.LookDirection = Camera.LookDirection; MainCamera.FieldOfView = Camera.FieldOfView; TurnSigns(MainCamera.Position); }; MouseControlCamera = new MouseControlCamera(CameraUpdate); _initPanelCommand = new RelayCommand(MouseControlCamera.InitPanel, obj => true); _getPanelSizeCommand = new RelayCommand(MouseControlCamera.GetPanelSize, obj => true); _moveCommand = new RelayCommand(MouseControlCamera.MouseMove, obj => true); _leftButtonDownCommand = new RelayCommand(MouseControlCamera.MouseLeftButtonDown, obj => true); _leftButtonReleaseCommand = new RelayCommand(MouseControlCamera.MouseLeftButtonRelease, obj => true); _rightButtonDownCommand = new RelayCommand(MouseControlCamera.MouseRightButtonDown, obj => true); _rightButtonReleaseCommand = new RelayCommand(MouseControlCamera.MouseRightButtonRelease, obj => true); _slideChangeValue = new RelayCommand(SlideValue, obj => true); _isLevelFocusOn = new RelayCommand(LevelFocusOn, obj => true); LightModel = new Model3DGroup(); LightModel.Children.Add(new AmbientLight(Colors.White)); paletteBase = new PaletteBase(0, 0, 0, 0, 0); ModelSource.Children.Add(paletteBase.GetModel()); Transform3DGroup TranslationGroup = new Transform3DGroup(); TranslationGroup.Children.Add(new RotateTransform3D(new AxisAngleRotation3D(new Vector3D(0, 1, 0), 90))); TranslationGroup.Children.Add(new TranslateTransform3D(new Vector3D(0, 0, 0))); ModelSource.Transform = TranslationGroup; }