Ejemplo n.º 1
0
        public MainForm()
        {
            InitializeComponent();

            _VirtualCamera          = new VirtualCamera();
            _VirtualCamera.Position = new Vector3(0, 0, 3);

            _GraphicObject = FileManager.importObject("..\\..\\3DModels\\Thompson.obj");
            _GraphicObject.transform.Position = new Vector3(1000, 500, 0);
            _GraphicObject.transform.Scale    = new Vector3(100f, 100f, .3f);


            worldToScreenPoint = new WorldToScreenPoint(new WorldToScreenPoint.Window(0, 0, canvas.Size.Width, canvas.Size.Height), new WorldToScreenPoint.Viewport(-1, -1, 1, 1));

            updateCameraTransformValues();
            updateGraphicTransformValues();

            updateScreen();
        }
Ejemplo n.º 2
0
 private void MainForm_SizeChanged(object sender, EventArgs e)
 {
     worldToScreenPoint = new WorldToScreenPoint(new WorldToScreenPoint.Viewport(0, 0, canvas.Size.Width, canvas.Size.Height));
     _VirtualCamera.Perspective.aspect = canvas.Size.Width / canvas.Size.Height;
     updateScreen();
 }