Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
VerticalBars3DPainter.cs
1using System;
2using System.Numerics;
5
7{
12 {
24 public void DrawGraph(Graphs3D.Canvas3D Canvas, Vector4[,] Points, Vector4[,] Normals,
25 object[] Parameters, Vector4[,] PrevPoints, Vector4[,] PrevNormals,
26 object[] PrevParameters, DrawingVolume DrawingVolume)
27 {
28 int i, c = Points.GetLength(0);
29 int j, d = Points.GetLength(1);
30 I3DShader Shader = Graph3D.ToShader(Parameters[0]);
31 Vector3 P1, P2;
32 float dx, dz;
33 int i0, j0;
34 double[] v = DrawingVolume.ScaleY(new DoubleVector(0));
35 float OrigoY = (float)v[0];
36
37 for (i = 0; i < c; i++)
38 {
39 i0 = i == 0 ? i : i - 1;
40
41 for (j = 0; j < d; j++)
42 {
43 j0 = j == 0 ? j : j - 1;
44
45 P1 = Graphs3D.Canvas3D.ToVector3(Points[i0, j0]);
46 P2 = Graphs3D.Canvas3D.ToVector3(Points[i0 + 1, j0 + 1]);
47
48 dx = P2.X - P1.X;
49 dz = P2.Z - P1.Z;
50
51 P1 = Graphs3D.Canvas3D.ToVector3(Points[i, j]);
52 dx /= 2;
53 dz /= 2;
54
55 Canvas.Box(P1.X - dx, OrigoY, P1.Z - dz, P1.X + dx, P1.Y, P1.Z + dz, Shader);
56 }
57 }
58 }
59 }
60}
Contains information about the current drawing area.
double[,] ScaleY(IMatrix Matrix)
Scales a matrix with y-coordinates to fit a given volume.
Plots a three-dimensional vertical bars chart.
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.
Definition: Graph3D.cs:28
static I3DShader ToShader(object Argument)
Gets a shader object from an argument.
Definition: Graph3D.cs:1414
Interface for 3D shaders.
Definition: I3DShader.cs:11
Interface for 3D graph drawing functions.
Definition: IPainter3D.cs:11