Пример #1
0
        public FormModernOpenGL()
        {
            InitializeComponent();

            //GL.ClearColor(0x87 / 255.0f, 0xce / 255.0f, 0xeb / 255.0f, 0xff / 255.0f);

            this.camera = new Camera(CameraType.Perspecitive, this.glCanvas1.Width, this.glCanvas1.Height);
            this.camera.Position = new vec3(-5,5,-5);
            rotator = new SatelliteRotator(this.camera);

            var model = new PyramidModel();
            IModel modelAdapter = new PyramidModelAdapter(model);
            this.pyramidRenderer = new PyramidRenderer(modelAdapter);
            this.pyramidRenderer.Initialize();

            this.glCanvas1.MouseWheel += glCanvas1_MouseWheel;
            this.glCanvas1.MouseDown += glCanvas1_MouseDown;
            this.glCanvas1.MouseMove += glCanvas1_MouseMove;
            this.glCanvas1.MouseUp += glCanvas1_MouseUp;
            this.glCanvas1.OpenGLDraw += glCanvas1_OpenGLDraw;
            this.glCanvas1.Resize += glCanvas1_Resize;
            this.glCanvas1.KeyPress += glCanvas1_KeyPress;
        }
Пример #2
0
        public FormModernOpenGL()
        {
            InitializeComponent();

            //GL.ClearColor(0x87 / 255.0f, 0xce / 255.0f, 0xeb / 255.0f, 0xff / 255.0f);

            this.camera          = new Camera(CameraType.Perspecitive, this.glCanvas1.Width, this.glCanvas1.Height);
            this.camera.Position = new vec3(-5, 5, -5);
            rotator = new SatelliteRotator(this.camera);

            var    model        = new PyramidModel();
            IModel modelAdapter = new PyramidModelAdapter(model);

            this.pyramidRenderer = new PyramidRenderer(modelAdapter);
            this.pyramidRenderer.Initialize();

            this.glCanvas1.MouseWheel += glCanvas1_MouseWheel;
            this.glCanvas1.MouseDown  += glCanvas1_MouseDown;
            this.glCanvas1.MouseMove  += glCanvas1_MouseMove;
            this.glCanvas1.MouseUp    += glCanvas1_MouseUp;
            this.glCanvas1.OpenGLDraw += glCanvas1_OpenGLDraw;
            this.glCanvas1.Resize     += glCanvas1_Resize;
            this.glCanvas1.KeyPress   += glCanvas1_KeyPress;
        }
Пример #3
0
 public PyramidModelAdapter(PyramidModel model)
 {
     this.model = model;
 }
Пример #4
0
        public FormLegacyOpenGL()
        {
            InitializeComponent();

            this.model = new PyramidModel();
        }
Пример #5
0
        public FormLegacyOpenGL()
        {
            InitializeComponent();

            this.model = new PyramidModel();
        }