예제 #1
0
        public PictureBox3D(DeviceManager initDM, SceneManager initSM)
        {
            // This call is required by the Windows.Forms Form Designer.
            InitializeComponent();

            // initialize members
            nameVisible    = true;                      // show the name of this viewport on-screen?
            _drawMode      = DrawMode.wireFrame;        // default to wireframe view
            arcBall        = new ArcBall(this);
            arcBall.Radius = 1.0f;

            BuildCameraMenu();

            // new events
            Midget.Events.EventFactory.DeselectObjects        += new Midget.Events.Object.Selection.DeselectObjectEventHandler(EventFactory_DeselectObjects);
            Midget.Events.EventFactory.SelectAdditionalObject += new Midget.Events.Object.Selection.SelectAdditionalObjectEventHandler(EventFactory_SelectAdditionalObject);
            Midget.Events.EventFactory.AdjustCameraEvent      += new Midget.Events.User.AdjustCameraEventHandler(EventFactory_AdjustCameraEvent);
            Midget.Events.EventFactory.SwitchEditModeEvent    += new Midget.Events.User.SwitchEditModeEventHandler(EventFactory_SwitchEditModeEvent);
            selectedObjects = new ArrayList();

            this.dm = initDM;

            // attach listener for render event
            dm.Render       += new System.EventHandler(this.Viewport_Render);
            this.renderView += new RenderSingleViewHandler(dm.OnRenderSingleView);

            this.sm = initSM;

            this.ConfigureRenderTarget();
        }
예제 #2
0
        public PictureBox3D(DeviceManager initDM, SceneManager initSM)
        {
            // This call is required by the Windows.Forms Form Designer.
            InitializeComponent();

            // initialize members
            nameVisible = true;				// show the name of this viewport on-screen?
            _drawMode = DrawMode.wireFrame;	// default to wireframe view
            arcBall = new ArcBall(this);
            arcBall.Radius = 1.0f;

            BuildCameraMenu();

            // new events
            Midget.Events.EventFactory.DeselectObjects +=new Midget.Events.Object.Selection.DeselectObjectEventHandler(EventFactory_DeselectObjects);
            Midget.Events.EventFactory.SelectAdditionalObject +=new Midget.Events.Object.Selection.SelectAdditionalObjectEventHandler(EventFactory_SelectAdditionalObject);
            Midget.Events.EventFactory.AdjustCameraEvent +=new Midget.Events.User.AdjustCameraEventHandler(EventFactory_AdjustCameraEvent);
            Midget.Events.EventFactory.SwitchEditModeEvent +=new Midget.Events.User.SwitchEditModeEventHandler(EventFactory_SwitchEditModeEvent);
            selectedObjects = new ArrayList();

            this.dm = initDM;

            // attach listener for render event
            dm.Render += new System.EventHandler(this.Viewport_Render);
            this.renderView += new RenderSingleViewHandler(dm.OnRenderSingleView);

            this.sm = initSM;

            this.ConfigureRenderTarget();
        }