Example #1
0
        private void bt_Cam_Enter_Click(object sender, EventArgs e)
        {
            bool success = true;
            // Cap nhat cam position
            Point3D cam_pos = new Point3D();

            success = float.TryParse(textBox_Cam_PosX.Text, out cam_pos.x);
            success = float.TryParse(textBox_Cam_PosY.Text, out cam_pos.y);
            success = float.TryParse(textBox_Cam_PosZ.Text, out cam_pos.z);

            // Cap nhat viewpoint
            Point3D view_point = new Point3D();

            success = float.TryParse(textBox_VpX.Text, out view_point.x);
            success = float.TryParse(textBox_VpY.Text, out view_point.y);
            success = float.TryParse(textBox_VpZ.Text, out view_point.z);


            if (success)
            {
                // Goi ham setPosAndViewpoint de cap nhat position va viewpoint cua cam
                cam.setPosAndViewpoint(cam_pos.x, cam_pos.y, cam_pos.z, view_point.x, view_point.y);
                // Cap nhat la co thuc hien bien doi tren camera
                isChangedCam = true;
            }

            // Cap nhat goc nhin
            int angle;

            success = int.TryParse(textBox_View.Text, out angle);

            if (success)
            {
                // Cat nhat angle vao bien cam
                cam.setAngle(angle);
                // Cap nhat la co thuc hien bien doi tren camera
                isChangedCam = true;
            }

            isDrawing = true;             // Cap nhat de ve
        }