Ejemplo n.º 1
0
        private void SceneObjectsListBox_SelectedIndexChanged(object sender, EventArgs e)
        {
            SceneObject obj = (SceneObject)SceneObjectsListBox.SelectedItem;

            if (obj is Cuboid)
            {
                Cuboid cub = obj as Cuboid;
                CurrentCuboid              = cub;
                ScaleXCub_TextBox.Text     = Convert.ToString(cub.Scaling.X, CultureInfo.InvariantCulture);
                ScaleYCub_TextBox.Text     = Convert.ToString(cub.Scaling.Y, CultureInfo.InvariantCulture);
                ScaleZCub_TextBox.Text     = Convert.ToString(cub.Scaling.Z, CultureInfo.InvariantCulture);
                TranslateXCub_TextBox.Text = Convert.ToString(cub.Translation.X, CultureInfo.InvariantCulture);
                TranslateYCub_TextBox.Text = Convert.ToString(-cub.Translation.Y, CultureInfo.InvariantCulture);
                TranslateZCub_TextBox.Text = Convert.ToString(cub.Translation.Z, CultureInfo.InvariantCulture);
                RotateXCub_TextBox.Text    = Convert.ToString(cub.RotAngle.X, CultureInfo.InvariantCulture);
                RotateYCub_TextBox.Text    = Convert.ToString(cub.RotAngle.Y, CultureInfo.InvariantCulture);
                RotateZCub_TextBox.Text    = Convert.ToString(cub.RotAngle.Z, CultureInfo.InvariantCulture);
            }
            else if (obj is Sphere)
            {
                Sphere sph = obj as Sphere;
                CurrentSphere              = sph;
                ScaleXSph_TextBox.Text     = Convert.ToString(sph.Scaling.X, CultureInfo.InvariantCulture);
                ScaleYSph_TextBox.Text     = Convert.ToString(sph.Scaling.Y, CultureInfo.InvariantCulture);
                ScaleZSph_TextBox.Text     = Convert.ToString(sph.Scaling.Z, CultureInfo.InvariantCulture);
                TranslateXSph_TextBox.Text = Convert.ToString(sph.Translation.X, CultureInfo.InvariantCulture);
                TranslateYSph_TextBox.Text = Convert.ToString(-sph.Translation.Y, CultureInfo.InvariantCulture);
                TranslateZSph_TextBox.Text = Convert.ToString(sph.Translation.Z, CultureInfo.InvariantCulture);
                RotateXSph_TextBox.Text    = Convert.ToString(sph.RotAngle.X, CultureInfo.InvariantCulture);
                RotateYSph_TextBox.Text    = Convert.ToString(sph.RotAngle.Y, CultureInfo.InvariantCulture);
                RotateZSph_TextBox.Text    = Convert.ToString(sph.RotAngle.Z, CultureInfo.InvariantCulture);
            }
            else if (obj is Camera)
            {
                Camera cam = obj as Camera;
                CurrentCamera      = cam;
                Fov_TextBox.Text   = Convert.ToString(cam.FoV, CultureInfo.InvariantCulture);
                fNear_TextBox.Text = Convert.ToString(cam.FNear, CultureInfo.InvariantCulture);
                fFar_TextBox.Text  = Convert.ToString(cam.FFar, CultureInfo.InvariantCulture);
            }
        }