23 public void DrawGraph(Graphs3D.Canvas3D Canvas, Vector4[,] Points, Vector4[,] Normals,
24 object[] Parameters, Vector4[,] PrevPoints, Vector4[,] PrevNormals,
27 int i, c = Points.GetLength(0);
28 int j, d = Points.GetLength(1);
31 Vector4[] Nodes =
new Vector4[4];
32 Vector4[] NodeNormals =
new Vector4[4];
39 Vector4[,] N =
new Vector4[c + 1, d + 1];
43 for (i = 0; i < c; i++)
45 for (j = 0; j < d; j++)
48 P2 = Points[i + 1, j];
50 P2 = Points[i + 1, j + 1];
51 P3 = Points[i, j + 1];
53 P3 = Points[i + 1, j + 1];
55 N[i, j] = Graphs3D.Canvas3D.CalcNormal(P1, P2, P3);
58 if (Vector4.Distance(Points[i, d], Points[i, 0]) < 1e-10f)
61 N[i, d] = N[i, d - 1];
64 for (j = 0; j <= d; j++)
66 if (Vector4.Distance(Points[c, j], Points[0, j]) < 1e-10f)
69 N[c, j] = N[c - 1, j];
72 Normals =
new Vector4[c + 1, d + 1];
74 for (i = 0; i <= c; i++)
76 for (j = 0; j <= d; j++)
88 P1 += N[i - 1, j - 1];
99 Normals[i, j] = P1 / n;
104 for (i = 0; i < c; i++)
106 for (j = 0; j < d; j++)
108 Nodes[0] = Points[i, j];
109 Nodes[1] = Points[i + 1, j];
110 Nodes[2] = Points[i + 1, j + 1];
111 Nodes[3] = Points[i, j + 1];
113 NodeNormals[0] = Normals[i, j];
114 NodeNormals[1] = Normals[i + 1, j];
115 NodeNormals[2] = Normals[i + 1, j + 1];
116 NodeNormals[3] = Normals[i, j + 1];
118 Canvas.Polygon(Nodes, NodeNormals, Shader, TwoSided);
Class managing a script expression.
static double ToDouble(object Object)
Converts an object to a double value.
Contains information about the current drawing area.
Plots a three-dimensional surface.
void DrawGraph(Graphs3D.Canvas3D Canvas, Vector4[,] Points, Vector4[,] Normals, object[] Parameters, Vector4[,] PrevPoints, Vector4[,] PrevNormals, object[] PrevParameters, DrawingVolume DrawingVolume)
Draws the graph on a canvas.
Handles three-dimensional graphs.
static I3DShader ToShader(object Argument)
Gets a shader object from an argument.
Painters for single-color graphs
Interface for 3D shaders.
Interface for 3D graph drawing functions.