
Good you used B-splines to model your road, since simple Bezier curves don't
have continuous curvature between segments, which results in all kinds of
trouble.
It's really great to see many bright people like you and Quicksilver working
on code like this. This is really something Haskell desperately needs IMHO
:)
2009/3/26 Patai Gergely
Maxim Shemanarev, the author of the open source anti-grain 2D rendering engine, seems to have tackled the curve stroking (dealing with cusps etc) pragmatically: http://www.antigrain.com/mcseem/index.html http://www.antigrain.com/mcseem/index.html
http://www.antigrain.com/research/adaptive_bezier/index.html#PAGE_ADAPTIVE_B...
I did something similar in my car racing game (currently under development, naturally in Haskell ;), where the track is defined with B-splines. I keep subdividing those parts where the cosine of the angle between subsequent segments is below a certain limit. I also found that by adding well-chosen textures, this limit--hence the polygon count--can be decreased drastically without any perceivable loss in quality.
Gergely
-- http://www.fastmail.fm - Or how I learned to stop worrying and love email again
_______________________________________________ Reactive mailing list Reactive@haskell.org http://www.haskell.org/mailman/listinfo/reactive