using System;
using System.Windows.Forms;

using Spark3D.Algebra3D;
using Spark3D.Objects3D;
using Spark3D.Objects3D.Shapes;
using Spark3D.Projector3D;

namespace Spark3D
{
    public partial class IsometricMainWnd : Form
    {
        /// <summary>
        /// Main Window Constructor
        /// </summary>
        public IsometricMainWnd()
        {
            InitializeComponent();
            this.WindowState = FormWindowState.Normal;
            IObject3D o3D = new Sphere(0.5, 5);
            this.View.Insert(new IsometricProjector());
            this.View.Insert(o3D);
            this.View.Insert(new LightSources.PointSource(new Vector3D(4.0, 4.0, 4.0)));
            SetCameraDistance();
        }
 

      

        private void tbFieldOfView_Scroll(object sender, EventArgs e)
        {
            View.FieldOfView=(double)this.tbFieldOfView.Value/(double)this.tbFieldOfView.Maximum;
        }

        private void tbCameraDistance_Scroll(object sender, EventArgs e)
        {
            SetCameraDistance();
        }

        private void SetCameraDistance()
        {
            View.CameraDistance = (double)(this.tbCameraDistance.Value)/2.0;
        }

          

    }
}