
OpenTK lagging due to thousands of points
Posted Thursday, 15 July, 2010 - 14:37 by adityatan inHi there:
I just plotted a thousand points in OpenTK window. I also have created a first-person camera on that window. As I tried to maneuver, the window lagged so bad.
Do you think the lagging is possibly due to my code, or is it due to the capacity of OpenTK? (Things were fine when I only plotted hundreds of cubes.)
FYI, I'm trying to make a stress-strain-force-displacement visualization of a pile. So, if OpenTK cannot handle my coordinates, I might as well just switch to another platform.
THank you for your help.
Aditya


Comments
Re: OpenTK lagging due to thousands of points
Here's the two pictures. The first one is my way, while the second picture is Fiddler's way.
Here's my code on OnRenderFrame:
Side note: Have anyone ever wondered the purpose of the following lines? I'm not the one who wrote the following lines, by the way. You don't have to answer as this is not OpenTK problem. :)
Wow many many thanks for the help.
Aditya
Re: OpenTK lagging due to thousands of points
Unfortunately, there's nothing in the code you provided that might indicate why they're displaying different results. As far as OpenGL is concerned, they're functionally identical (though the Lines loop probably won't work as you intend). I'd take another look at your loading code to make sure you haven't missed something or that you aren't doing something different with your cameraMatrix Mat4.
What part of
a.Nodes.ElementAt(i).Coordinate[0] = Convert.ToDouble(fields[0]);are you questioning the purpose of? It's not terribly attractive code, but I'm not sure that there's anything really weird about it.Re: OpenTK lagging due to thousands of points
I kinda get "a.Nodes.ElementAt(i).Coordinate[0] = Convert.ToDouble(fields[0]);" now. At first I have no idea as to what it returns. Now after my Prof. explained it in detail, I finally got it.
I also couldn't see what's wrong with the two methods that it yields two different results. Please let me know when you find something. Thank you.
Aditya