Click here to Skip to main content
15,881,559 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have created a chart using the code from this link http://csharphelper.com/blog/2015/04/draw-a-3d-surface-from-a-set-of-data-points-with-an-altitude-map-using-wpf-and-c/[^]

In my code the application redraw the graph in a particular interval. But this will draw the graph only once. Please help me to solve this error. My chart drawing function is



C#
MainModel3Dgroup.Children.Clear();
           double[,] val = CreatePoints(newval);

           xmin = 0;
           xmax = val.GetUpperBound(0);
           dx = 1;
           zmin = 0;
           zmax = val.GetUpperBound(1);
           dz = 1;

           texture_xscale = (xmax - xmin);
           texture_zscale = (zmax - zmin);

           // Create an altitude map.
           CreateAltitudeMap(val);

           // Create the model.
           DefineModel(MainModel3Dgroup, val);

           // Add the group of models to a ModelVisual3D.
           ModelVisual3D model_visual = new ModelVisual3D();
           model_visual.Content = MainModel3Dgroup;

           MainViewport.Children.Clear();
           // Display the main visual to the viewportt.
           MainViewport.Children.Add(model_visual);



I have uploaded the sample code in this link. In this application a new image will drawn from a button click but its not working correctly http://www.filedropper.com/howtosamplealtitudemap[^]
Posted
Updated 16-Apr-15 7:52am
v3
Comments
Kenneth Haugland 16-Apr-15 9:20am    
Don't know what you did wrong, but I have made a continuous simulation using WPF:
http://www.codeproject.com/Articles/661257/Transmission-Line-Matrix-for-Acoustic-Simulations
Arun Kumar K S 16-Apr-15 9:46am    
That is too big code.. Could you help me to solve this..
I have uploaded the sample code in this link
http://www.filedropper.com/howtosamplealtitudemap
<img src=http://www.filedropper.com/download_button.png width=127 height=145 border=0/><br /><div style=font-size:9px;font-family:Arial, Helvetica, sans-serif;width:127px;font-color:#44a854;> file upload storage</div>
Sergey Alexandrovich Kryukov 16-Apr-15 10:55am    
Do you need to create moving graph, changing based on some data you got in some time intervals? Are you pulling this data from somewhere you there is some push by some kind of event(s)? The problem is pretty simple; you need to use Dispatcher.
—SA
Arun Kumar K S 16-Apr-15 12:04pm    
I have created a sample application in the above link. That draws the corect image only once. In that application added a button to redraw another image but the image drwan incorrectly. Please check my sample code in the above link
Sergey Alexandrovich Kryukov 16-Apr-15 15:14pm    
First, please answer my question on what exactly you are trying to achieve. The solution will be pretty simple. I already told you need to use.
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900