PDA

View Full Version : surface and point



ram1nx
02-05-2010, 06:07 AM
hello!
first: sorry for my bad english! I have a set of points and I want opengl to draw serface. Opengl should interpolate with splines. Where do i have to look for?

Thank you!
ram1nx

strattonbrazil
02-05-2010, 07:15 AM
That's kind of vague. First, what do you want to interpolate? Colors? Geometry? Is this a point-sampled geometry like a laser scan of the statue of David and you want to fill in holes? Or are the points a mesh grid and you want to create a smooth surface over it? Something like this:

http://www.cs.mtu.edu/~shene/COURSES/cs3621/NOTES/surface/bspline-construct.html

If it's the latter, there are several ways to do this.

One is OpenGL evaluators, which might be exactly what you're looking for. This is a Bezier-basis function, which isn't really splines, but you can convert your data to match the Bezier. It's kind of complex though.

http://www.opengl.org/resources/code/samples/mjktips/grid/index.html

The other is just grab an algorithm somewhere that renders the geometry for you. What kind of splinar interpolation do you want? B-spline interpolation? What degree? Linear, quadratic, cubic? Probably cubic.

Here's another link on rendering using the GLU library that comes with OpenGL. I've never used a library for rendering b-splines, but according to this page, it's supported by the evaluators.
http://glprogramming.com/red/chapter12.html

ram1nx
02-05-2010, 08:49 AM
indeed i have a surface: it is the surface of a relativistic star, which i want to draw with opengl. because the surface is a numerical result i just have a set of points. but: the surface is not "open" (if this is the correct word for it).
evaluators ?

thnak you again

strattonbrazil
02-07-2010, 09:52 AM
Ah, so you have a point cloud of geometry and want to display it as a surface?

There are several ways to do that, but I'm not sure which involve splinar interpolation.

If you can preprocess this, you can use a program that takes point clouds and turns it into surfaces. Then just read your surface in as an OBJ or something. One program I've used in the past for this is meshlab.

If you can't preprocess this, that makes it a little harder. You could alway render the points and use a reconstruction filter. There's a paper called "The Randomized z-Buffer", which provides some details of rendering high-quality point clouds.