views:

2337

answers:

3

I am going to be making an application that lets users input several parameters for a bowling ball layout, and then show what that layout would look like on the ball. I have found some good resources for sphere math, so if I have a sphere whose center is (0,0,0), I will be able to get the values of the points I need on the surface of the ball. What I will need to do is have the library create:

  • A sphere
  • Mark points on the surface of the sphere
  • Draw lines connecting the points on the sphere (arcs along a great circle - in other words, the shortest distance across the surface of the sphere)
  • Super duper bonus Actually be 3D, so the user could pan, zoom, rotate.

Basically, I want to calculate the points, tell the library which ones to draw and which ones to connect with which colors, and then sit back and watch the kudos roll in.


I'd like to use .NET 2.0 and WinForms if possible...

+1  A: 

If you use GLUT, you could just have the library draw the sphere for you without you having to figure out the points.

Jim Buck
Any recommendations for a managed library?
Chris Marasti-Georg
Hmm, I figured somewhere out in the wild are managed wrappers for OpenGL and GLUT, but Google search comes up with spotty answers. This looks decent for OpenGL in C#: http://www.codeproject.com/KB/openGL/sharpgl.aspx but to find GLUT on top of this would be ideal for you to draw spheres easily.
Jim Buck
+2  A: 

If you're gonna be using WPF I recommend you use Perspective or 3DTools. They're both easy to use and do the job fine.

If I had to recommend only one I would go with Perspective, at the time I used it it was easier and had more features, but it's been a long time so you should probably see for yourself.

sker
Any recommendations if I'm just doing winforms?
Chris Marasti-Georg
Sorry, no experience with 3D in winforms. When I needed to do 3D I had to use Managed DirectX to accomplish what I wanted in winforms, I found it too complicated and ended up using WPF which is easier IMHO. You could host a WPF control in winforms but it's probably not what you want.
sker
+1  A: 

I found the OpenGL part of the Tao Framework quite capable. It provides raw OpenGL bindings, as well as GLUT and GLFW - as a beginner, I found GLFW much easier to use for my simple needs than GLUT. It comes with decent documentation on GLFW and samples.

Be aware though that these libraries create a 3d "view" that covers the entire window, so adding standard winforms UI may not be straightforward. That's not something I've tried. There were however some samples that showed simple GUIs.

romkyns