, Visual C#


- 2


33.2. ProcessCmdKey.

protected override bool ProcessCmdKey(

ref System.Windows.Forms.Message msg,

System.Windows.Forms.Keys keyData)

{

// :

const float delta_theta = (float)pi / 20; ;

// :

if (keyData == System.Windows.Forms.Keys.Left)

theta_Eye = theta_Eye - delta_theta;

if (keyData == System.Windows.Forms.Keys.Right)

theta_Eye = theta_Eye + delta_theta;

if (keyData == System.Windows.Forms.Keys.Up)

phi_Eye = phi_Eye - delta_theta;

if (keyData == System.Windows.Forms.Keys.Down)

phi_Eye = phi_Eye + delta_theta;

// :

Projection(ref MatrixProjection, PerspectiveProjection,

r_Eye, phi_Eye, theta_Eye,

(float)x_focus, (float)y_focus, (float)z_focus,

0, 1, 0);

Designing((Bitmap)pictureBox1.Image);

// PictureBox :

pictureBox1.Refresh();

return true;

}

.

33.3. .

// DrawSolid

// CheckBox - :

private void Designing(Bitmap bmp)

{

// g Graphics:

Graphics g;

// g bmp:

g = Graphics.FromImage(bmp);

// Window

// PictureBox1:

g.Clear(SystemColors.Window);

// g:

g.Dispose();

// :

TransformAllDataFull(ref MatrixProjection);

// CheckBox :

if (checkBox1.CheckState ==

System.Windows.Forms.CheckState.Checked)

{

DrawSolid(

bmp, Tetrahedron, Cube - 1,

System.Drawing.Color.Red, false);

}

if (checkBox2.CheckState ==




- -  - -  - -