Draw graphics in a 3D graph
Hi, I´m having some problems when it comes to draw some points in a 3D (x,y,z) graph, I don´t know how to draw the 3D graph, I´ve been looking throu the internet and didn´t find any method for it... does anyone know a way to solve my problem? Thank you very much.
Kelvin LokePosted May 24, 2007, 4:59 AM
Mmm if that works yes, but I don´t know, what I need is to draw some points into a graph with 3 axis (x,y,z), I suppose that for that I need some 3D graphics. Write now I´m using this code:
using System;
using System.Windows.Media;
using System.Windows.Media.Media3D;
using System.Windows;
using System.Windows.Media.Animation;
using System.Windows.Controls;
using System.Windows.Input;
namespace DataVisualization
{
public static void Main()
{
Application app = new Application();
Window w = new Window();
Viewport3D vp = new Viewport3D();
// Create our scene.
//
ModelVisual3D scene = new ModelVisual3D();
AxisAngleRotation3D rotation = new AxisAngleRotation3D(
new Vector3D(0, 0, 1) /* z-direction */, 0 /* degrees */);
plotVisual.Transform = new RotateTransform3D(rotation);
scene.Children.Add(plotVisual);
//
// Add lights.
//
.....
// Add scatter plot
//
ModelVisual3D plotVisual = MakePlot(c_numPoints, 10 /* size */);
AxisAngleRotation3D rotation = new AxisAngleRotation3D(
new Vector3D(0, 0, 1) /* z-direction */, 0 /* degrees */);
plotVisual.Transform = new RotateTransform3D(rotation);
scene.Children.Add(plotVisual);
vp.Children.Add(scene);
w.Content = vp;
w.Show();
app.Run();
}
It´s not the whole code, but it´s part of it, with this code I can show in my window "w" the point´s i want but I show them in an Application Window, but I can´t see the axis, If I close the Application and try to call it again the program will show the next Error: System.Windows.Application can´t be opened more than once, and.. I don´t know why, there´s an option to shut down the application but, when I use this It still doesn´t work.
So... if you know a different way to do it I´ll appreciate your opinion, thanks.
Oscar RiveraPosted May 20, 2007, 7:52 PM