User Tools

Site Tools

blog:2023-06-05_graph3d_a_windows.forms_render_control_in_c



2023-06-05 Graph3D: A Windows.Forms Render Control in C#

  • Found in Code Project. An easy to use 3D control which can be integrated into an application in a few minutes. A universal ready-to-use 3D Graph control for System.Windows.Forms applications. It displays 3D functions or X,Y,Z data. The control consists of a single C# file and is optimized for maximum speed.
  • Enter - Graph3D: A Windows.Forms Render Control in C#
  • Demo: Nested Graphs
    • const int POINTS = 8;
      cSurfaceData i_Data1 = new cSurfaceData(eSurfaceMode.Lines, POINTS, POINTS, new cColorScheme(3, Color.Orange));
      cSurfaceData i_Data2 = new cSurfaceData(eSurfaceMode.Lines, POINTS, POINTS, new cColorScheme(2, Color.Black));
      
      for (int C=0; C<POINTS; C++)
      {
          for (int R=0; R<POINTS; R++)
          {
              double d_X = (C - POINTS / 2.3) / (POINTS / 5.5);
              double d_Y = (R - POINTS / 2.3) / (POINTS / 5.5);
              double d_Radius = Math.Sqrt(d_X * d_X + d_Y * d_Y);
              double d_Z = Math.Cos(d_Radius) + 1.0;
      
              i_Data1.SetPointAt(C, R,  d_X, d_Y, d_Z);
              i_Data2.SetPointAt(C, R,  d_X, d_Y, d_Z * 0.6);
          }
      }
      
      cMessgData i_Mesg1 = new cMessgData("Graph with error data",   10, -10, Color.Orange);
      cMessgData i_Mesg2 = new cMessgData("Graph with correct data", 10, -27, Color.Black);
      
      graph3D.BeginUpdate();
      graph3D.AddRenderData (i_Data1);
      graph3D.AddRenderData (i_Data2);
      graph3D.AddMessageData(i_Mesg1);
      graph3D.AddMessageData(i_Mesg2);
      graph3D.EndUpdate(eNormalize.MaintainXY);

Local Copy Project

TAGS

  • 70 person(s) visited this page until now.

Permalink blog/2023-06-05_graph3d_a_windows.forms_render_control_in_c.txt · Last modified: 2023/06/05 16:50 by jethro

oeffentlich