Example #1
0
 private void glCanvas1_KeyPress(object sender, KeyPressEventArgs e)
 {
     if (e.KeyChar == 'o')
     {
         if (this.openTextureDlg.ShowDialog() == System.Windows.Forms.DialogResult.OK)
         {
             {
                 var renderer = this.BindingObject.Renderer as IDisposable;
                 if (renderer != null)
                 {
                     renderer.Dispose();
                 }
             }
             {
                 var renderer = new ImageProcessingRenderer(this.openTextureDlg.FileName);
                 renderer.Initialize();
                 this.BindingObject.Renderer = renderer;
             }
         }
     }
     else if (e.KeyChar == 'z')
     {
         var renderer = this.BindingObject.Renderer as ImageProcessingRenderer;
         renderer.SwitchDisplayImage(true);
     }
     else if (e.KeyChar == 'x')
     {
         var renderer = this.BindingObject.Renderer as ImageProcessingRenderer;
         renderer.SwitchDisplayImage(false);
     }
 }
Example #2
0
 private void Form_Load(object sender, EventArgs e)
 {
     {
         var camera = new Camera(
             new vec3(0, 0, -1), new vec3(0, 0, 0), new vec3(0, 1, 0),
             CameraType.Perspecitive, this.glCanvas1.Width, this.glCanvas1.Height);
         var rotator = new SatelliteManipulater();
         rotator.Bind(camera, this.glCanvas1);
         this.rotator = rotator;
         this.scene   = new Scene(camera, this.glCanvas1);
         this.scene.RootViewPort.ClearColor = Color.SkyBlue;
         this.glCanvas1.Resize += this.scene.Resize;
     }
     {
         var renderer = new ImageProcessingRenderer();
         renderer.Initialize();
         SceneObject obj = renderer.WrapToSceneObject(new UpdateImageScript(this.glCanvas1));
         this.scene.RootObject.Children.Add(obj);
     }
     {
         var builder = new StringBuilder();
         builder.AppendLine("1: Scene's property grid.");
         builder.AppendLine("2: Canvas' property grid.");
         MessageBox.Show(builder.ToString());
     }
 }
 private void Form_Load(object sender, EventArgs e)
 {
     {
         var camera = new Camera(
             new vec3(0, 0, -1), new vec3(0, 0, 0), new vec3(0, 1, 0),
             CameraType.Perspecitive, this.glCanvas1.Width, this.glCanvas1.Height);
         var rotator = new SatelliteManipulater();
         rotator.Bind(camera, this.glCanvas1);
         this.rotator = rotator;
         this.scene = new Scene(camera, this.glCanvas1);
         this.scene.RootViewPort.ClearColor = Color.SkyBlue;
         this.glCanvas1.Resize += this.scene.Resize;
     }
     {
         var renderer = new ImageProcessingRenderer();
         renderer.Initialize();
         SceneObject obj = renderer.WrapToSceneObject(new UpdateImageScript(this.glCanvas1));
         this.scene.RootObject.Children.Add(obj);
     }
     {
         var builder = new StringBuilder();
         builder.AppendLine("1: Scene's property grid.");
         builder.AppendLine("2: Canvas' property grid.");
         MessageBox.Show(builder.ToString());
     }
 }
Example #4
0
 private void glCanvas1_KeyPress(object sender, KeyPressEventArgs e)
 {
     if (e.KeyChar == 'o')
     {
         if (this.openTextureDlg.ShowDialog() == System.Windows.Forms.DialogResult.OK)
         {
             var renderer = new ImageProcessingRenderer(this.openTextureDlg.FileName);
             renderer.Initialize();
             this.renderer = renderer;
         }
     }
     else if (e.KeyChar == 'c')
     {
         this.renderer.SwitchDisplayImage(true);
     }
     else if (e.KeyChar == 'x')
     {
         this.renderer.SwitchDisplayImage(false);
     }
 }
Example #5
0
 private void Form02OrderIndependentTransparency_Load(object sender, EventArgs e)
 {
     {
         var camera = new Camera(
             new vec3(0, 0, -1), new vec3(0, 0, 0), new vec3(0, 1, 0),
             CameraType.Perspecitive, this.glCanvas1.Width, this.glCanvas1.Height);
         var rotator = new SatelliteRotator(camera);
         this.camera  = camera;
         this.rotator = rotator;
     }
     {
         var renderer = new ImageProcessingRenderer();
         renderer.Initialize();
         this.renderer = renderer;
     }
     {
         var frmPropertyGrid = new FormProperyGrid();
         frmPropertyGrid.DisplayObject(this.renderer);
         frmPropertyGrid.Show();
         this.formPropertyGrid = frmPropertyGrid;
     }
 }
 private void Form_Load(object sender, EventArgs e)
 {
     {
         var camera = new Camera(
             new vec3(0, 0, -1), new vec3(0, 0, 0), new vec3(0, 1, 0),
             CameraType.Perspecitive, this.glCanvas1.Width, this.glCanvas1.Height);
         var rotator = new SatelliteManipulater();
         rotator.Bind(camera, this.glCanvas1);
         this.rotator           = rotator;
         this.scene             = new Scene(camera, this.glCanvas1);
         this.glCanvas1.Resize += this.scene.Resize;
     }
     {
         var renderer = new ImageProcessingRenderer();
         renderer.Initialize();
         SceneObject obj = renderer.WrapToSceneObject(new UpdateImageScript(this.glCanvas1));
         this.scene.RootObject.Children.Add(obj);
     }
     {
         var frmPropertyGrid = new FormProperyGrid(this.scene);
         frmPropertyGrid.Show();
     }
 }
Example #7
0
 private void glCanvas1_KeyPress(object sender, KeyPressEventArgs e)
 {
     if (e.KeyChar == 'o')
     {
         if (this.openTextureDlg.ShowDialog() == System.Windows.Forms.DialogResult.OK)
         {
             {
                 var renderer = this.BindingObject.Renderer as IDisposable;
                 if (renderer != null)
                 { renderer.Dispose(); }
             }
             {
                 var renderer = new ImageProcessingRenderer(this.openTextureDlg.FileName);
                 renderer.Initialize();
                 this.BindingObject.Renderer = renderer;
             }
         }
     }
     else if (e.KeyChar == 'z')
     {
         var renderer = this.BindingObject.Renderer as ImageProcessingRenderer;
         renderer.StateDisplayImage(true);
     }
     else if (e.KeyChar == 'x')
     {
         var renderer = this.BindingObject.Renderer as ImageProcessingRenderer;
         renderer.StateDisplayImage(false);
     }
 }