CAD-like parametric render?

Started by mireazma, February 20, 2014, 18:01:43

Previous topic - Next topic

mireazma

Hello there.

I'm looking for a way to create and render continuous curves (splines) and surfaces not made up of segments/faces but rather parametrically, analytically for a mini CAD-like program. Is there an alternative render mode for this? I mean instead of intensively computing the hoards of vertices, maybe there's a magic simple render by the parameters of the model. 
I'm a beginner and I don't know how to approach this so I need some guidance.
I'm aware of some glu NURBS functions () but instead of using control points and knots, I want the curves / surfaces to actually pass through some given points (interpolation).

For this do I have to implement the interpolation myself and only use the magic rendering mode (if exists)?
In this case I'd start from an interpolation function of G2 continuity (has 2nd derivative = 0(?)) like natural cubic spline or other of the kind (if there's no such interpolation function in OpenGL/LWJGL already.

But again: how am I going to render something that's not comprised of faces?
Do I have to make my own transform matrices or implement the whole logic in a shader? Then if I want to interact (mouse click, collision etc.) with such a model it's going to be a problem.

After all, I'm hoping for an already existing library for this type of workflow: input vertices, output spline / patch.

spasi

GPUs cannot render parametric surfaces natively. You'll have to manually convert curved components to primitives that the GPU can rasterize, like quads and triangles. The closest you can get to something more automated is tessellation+geometry shaders, but that still requires writing the shaders on your own.