Tell me more ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I would like to know the best representation of 3D curves for my application. The application works as follows:

  • A virtual scene is represented as wire mesh, with lots of 3D curves (some of which are straight lines).
  • The game will project these curves into the 2D coordinate frame of a photograph or video frame (using a pinhole camera model, i.e. perspective projection) of a similar, but real, scene (like augmented reality). These lines are not to be rendered, so they have no thickness - they simply have a parametric representation in 2D.
  • It will then have to compute the 2D distances of points in the image to the closest point on a given curve. It will need to do this for lots of points.
  • It will then iterate this pipeline (projection followed by computing lots of distances) in order to minimize those distances.

The curve representation should be compact, and model the true curves well. The projection should take as input a parametric 3D curve and the coordinate frame of projection, and return a parametric 2D curve. If the projection can be parallelized that's a bonus. Shortest distances to the parametric 2D curve should be fast to compute.

An example of such a representation is a set of control points connected by straight line segments, but one issue with this is that high curvature is not well modelled without many control points.

I'd be interested in hearing of any good representations, or equally of any online resources which list such representations.

share|improve this question
1  
If you want to have other than the obvious answer, you might want to tell us more about your application. – Jari Komppa Dec 20 '12 at 17:05
1  
This isn't the place to generate lists. – Byte56 Dec 20 '12 at 17:19
@Jari Komppa: I've improved the description of what I need the lines for - it's pretty straightforward. An obvious answer is fine - it might be the best. Then again, you might know of a more obscure representation which suits the application better. Why not put both down and double your chances of an accept? – user664303 Dec 21 '12 at 9:46
1  
But StackExchange isn't a forum‌​, it's a Q&A-site. Questions should preferably have 1 correct answer. Furthermore, you only got 2 downvotes. Chances are if you improve your question to be more specific (like Jari suggested), then it won't "generate lists" (as Byte56 hinted), it will be a good fit for the Q&A-format and the downvotes will disappear. Also, do not assume disinterest, people's comments are intended to actually make your question more relevant to more users. – Eric Dec 21 '12 at 10:30
1  
This is a genuinely interesting topic, but I agree your question is too vague. For now I can only ask more questions, like what kind of curves, how many, how complex, do they have thickness, are they shaded/lit, are they animated in real time, are they anti-aliased, are they affected by the Z-buffer, do they affect the Z-buffer… Really, what kind of application is it? – Sam Hocevar Dec 21 '12 at 12:42
show 5 more comments

closed as not constructive by Byte56, Trevor Powell, bummzack, Josh Petrie, michael.bartnett Jan 9 at 7:08

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or specific expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, see the FAQ for guidance.

2 Answers

A list of curve representations can be found here: http://www.cs.helsinki.fi/group/goa/mallinnus/curves/curves.html

It describes:

  • Hermite curves
  • Bezier curves
  • Splines
  • Nonuniform Rational B-splines (NURBS)
share|improve this answer

Use a set of control points connected by straight line segments.

Pros:

  • Very fast to project
  • Easy distance to point computation
  • Easily parallelizable

Cons:

  • Expensive for smooth curves
share|improve this answer
This is an example of the kind of answer I'm after. – user664303 Dec 20 '12 at 16:26

Not the answer you're looking for? Browse other questions tagged or ask your own question.