示例#1
0
        private void EVENT_MouseMove(object sender, MouseEventArgs e)
        {
            float x = MousePosX - e.X;
            float y = MousePosY - e.Y;

            if (MouseRightButton)
            {
                Renderer.Camera.Zoom(y);    // Zmiana odleglosci kamery
            }
            else if (MouseLeftButton)
            {
                Renderer.Camera.Move(new Vector3(0, 0, -y)); // Poruszanie kamery w pionie
                Renderer.Camera.Rotate(x * 0.01f);           // Obrót kamery
            }

            MousePosX = e.X;
            MousePosY = e.Y;

            gizmo.SetViewMatrix(Renderer.Camera.View);
            grid.SetViewMatrix(Renderer.Camera.View);
            if (mesh != null)
            {
                mesh.SetViewMatrix(Renderer.Camera.View);
            }
        }
示例#2
0
 public void SetMesh(KModel m)
 {
     if (m != null)
     {
         mesh = m;
         mesh.SetViewMatrix(Renderer.Camera.View);
     }
 }