Пример #1
0
        private ThreeDeeEditor(MainForm xiMainForm)
            : base(xiMainForm)
        {
            MoveScale = 100;

              mMainForm.KeyPreview = true;
              mMainForm.DialogKey +=new KeyEventHandler(MainForm_KeyDown);
              mMainForm.FormClosing += new FormClosingEventHandler(mMainForm_FormClosing);

              mMainForm.ChunkTreeView.NodeMouseClick += new TreeNodeMouseClickEventHandler(ChunkTreeView_NodeMouseClick);

              mScene = new MMEdScene();

              Camera lCameraBottomLeft = new Camera(80, 0.1, 1e10);
              lCameraBottomLeft.ProjectionMode = eProjectionMode.Orthographic;
              CreateView(mMainForm.Viewer3DRenderingSurfaceBottomLeft, mScene, lCameraBottomLeft, RenderMode.Wireframe);

              Camera lCameraBottomRight = new Camera(80, 0.1, 1e10);
              lCameraBottomRight.ProjectionMode = eProjectionMode.Orthographic;
              CreateView(mMainForm.Viewer3DRenderingSurfaceBottomRight, mScene, lCameraBottomRight, RenderMode.Wireframe);

              CreateView(mMainForm.Viewer3DRenderingSurfaceTopRight, mScene, new Camera(80, 0.1, 1e10), RenderMode.Undefined);

              Camera lCameraTopLeft = new Camera(80, 0.1, 1e10);
              lCameraTopLeft.ProjectionMode = eProjectionMode.Orthographic;
              CreateView(mMainForm.Viewer3DRenderingSurfaceTopLeft, mScene, lCameraTopLeft, RenderMode.Wireframe);

              //add view mode menus:
              mOptionsMenu = new ToolStripMenuItem("3D");
              //
              PropertyController lMoveCtrl = new PropertyController(this, "MovementMode");
              mOptionsMenu.DropDownItems.AddRange(lMoveCtrl.CreateMenuItems());
              mOptionsMenu.DropDownItems.Add(new ToolStripSeparator());
              //
              PropertyController lNormCtrl = new PropertyController(this, "DrawNormalsMode");
              mOptionsMenu.DropDownItems.AddRange(lNormCtrl.CreateMenuItems());
              mOptionsMenu.DropDownItems.Add(new ToolStripSeparator());
              //
              PropertyController lTexModeCtrl = new PropertyController(this, "TextureMode");
              mOptionsMenu.DropDownItems.AddRange(lTexModeCtrl.CreateMenuItems());
              mOptionsMenu.DropDownItems.Add(new ToolStripSeparator());
              //
              PropertyController lSelMetaCtrl = new PropertyController(this, "SelectedMetadata");
              mOptionsMenu.DropDownItems.Add(lSelMetaCtrl.CreateToolStripComboBox());
              mOptionsMenu.DropDownItems.Add(new ToolStripSeparator());
              //
              mOptionsMenu.DropDownItems.Add(new ToolStripMenuItem("Hide all invisible Flats", null, new EventHandler(this.HideAllInvisibleFlats)));
              mOptionsMenu.DropDownItems.Add(new ToolStripMenuItem("Refresh View", null, new EventHandler(this.RefreshView)));
              mMainForm.mMenuStrip.Items.Add(mOptionsMenu);

              ResetCamera();

              MovementMode = eMovementMode.FlyMode;
              DrawNormalsMode = eDrawNormalsMode.HideNormals;
              TextureMode = eTextureMode.NormalTextures;
              SelectedMetadata = eTexMetaDataEntries.Waypoint;
        }
Пример #2
0
        private ThreeDeeEditor(MainForm xiMainForm)
            : base(xiMainForm)
        {
            MoveScale = 100;

            mMainForm.KeyPreview   = true;
            mMainForm.DialogKey   += new KeyEventHandler(MainForm_KeyDown);
            mMainForm.FormClosing += new FormClosingEventHandler(mMainForm_FormClosing);

            mMainForm.ChunkTreeView.NodeMouseClick += new TreeNodeMouseClickEventHandler(ChunkTreeView_NodeMouseClick);

            mScene = new MMEdScene();

            Camera lCameraBottomLeft = new Camera(80, 0.1, 1e10);

            lCameraBottomLeft.ProjectionMode = eProjectionMode.Orthographic;
            CreateView(mMainForm.Viewer3DRenderingSurfaceBottomLeft, mScene, lCameraBottomLeft, RenderMode.Wireframe);

            Camera lCameraBottomRight = new Camera(80, 0.1, 1e10);

            lCameraBottomRight.ProjectionMode = eProjectionMode.Orthographic;
            CreateView(mMainForm.Viewer3DRenderingSurfaceBottomRight, mScene, lCameraBottomRight, RenderMode.Wireframe);

            CreateView(mMainForm.Viewer3DRenderingSurfaceTopRight, mScene, new Camera(80, 0.1, 1e10), RenderMode.Undefined);

            Camera lCameraTopLeft = new Camera(80, 0.1, 1e10);

            lCameraTopLeft.ProjectionMode = eProjectionMode.Orthographic;
            CreateView(mMainForm.Viewer3DRenderingSurfaceTopLeft, mScene, lCameraTopLeft, RenderMode.Wireframe);

            //add view mode menus:
            mOptionsMenu = new ToolStripMenuItem("3D");
            //
            PropertyController lMoveCtrl = new PropertyController(this, "MovementMode");

            mOptionsMenu.DropDownItems.AddRange(lMoveCtrl.CreateMenuItems());
            mOptionsMenu.DropDownItems.Add(new ToolStripSeparator());
            //
            PropertyController lNormCtrl = new PropertyController(this, "DrawNormalsMode");

            mOptionsMenu.DropDownItems.AddRange(lNormCtrl.CreateMenuItems());
            mOptionsMenu.DropDownItems.Add(new ToolStripSeparator());
            //
            PropertyController lTexModeCtrl = new PropertyController(this, "TextureMode");

            mOptionsMenu.DropDownItems.AddRange(lTexModeCtrl.CreateMenuItems());
            mOptionsMenu.DropDownItems.Add(new ToolStripSeparator());
            //
            PropertyController lSelMetaCtrl = new PropertyController(this, "SelectedMetadata");

            mOptionsMenu.DropDownItems.Add(lSelMetaCtrl.CreateToolStripComboBox());
            mOptionsMenu.DropDownItems.Add(new ToolStripSeparator());
            //
            mOptionsMenu.DropDownItems.Add(new ToolStripMenuItem("Hide all invisible Flats", null, new EventHandler(this.HideAllInvisibleFlats)));
            mOptionsMenu.DropDownItems.Add(new ToolStripMenuItem("Refresh View", null, new EventHandler(this.RefreshView)));
            mMainForm.mMenuStrip.Items.Add(mOptionsMenu);

            ResetCamera();

            MovementMode     = eMovementMode.FlyMode;
            DrawNormalsMode  = eDrawNormalsMode.HideNormals;
            TextureMode      = eTextureMode.NormalTextures;
            SelectedMetadata = eTexMetaDataEntries.Waypoint;
        }