0

Is there a possibility to detect whether an object intersects another object in Opengl ?

For example: I have 2 quads(later nurbs),I am moving these quads so that at some point they intersect. Now I would like to cut out those parts which are lying over the edge. The result should be a nice smooth edge.

Nico Schlömer
  • 53,797
  • 27
  • 201
  • 249
buddy
  • 821
  • 2
  • 12
  • 30
  • Are you talking about something like [CSG](http://en.wikipedia.org/wiki/Constructive_solid_geometry)? – Blender Nov 30 '11 at 17:44

1 Answers1

2

OpenGL is not a geometry library. It's a drawing API. You send it points, lines and triangles, and it draws them. There's no notion of "geometrical objects" in OpenGL.

What you want to do is the task for geometry libraries, like GTS or similar.

datenwolf
  • 159,371
  • 13
  • 185
  • 298
  • I've never worked with this before. Is it compatible with OpenGL.Is it very complicated? I mean, from your experience.As I indicated in my question I am planning to use Nurbs(OpenGL-Nurbs) as well. Is it possible with this library? – buddy Nov 30 '11 at 21:28
  • @buddy: OpenGL deals with drawing things. GTS deals with processing geometry. There's no direct interaction between OpenGL and GTS. But it is of course possible, and quite common to use GTS in programs, that use OpenGL to draw stuff. OpenGL itself has no NURBS at all. The closest come evaluators, but those have been removed from OpenGL-3 core and later. NURBS always came as part of the GLU library (which is not part of OpenGL, but used to ship alongside). Anyway: You should implement your own NURBS evaluator, which emits a mesh. That mesh then can be processed by GTS. – datenwolf Dec 01 '11 at 01:19