Pergunta

I have images which have line segments, rays etc. I am representing these line segments using Bresenham algorithm (means whatever coordinates I get using this algorithm between two points). Now I want to do operations such as finding intersection point between two line segments, finding the projection of one vector onto other etc... The problem is I am not working in continuous space. The line segments are being approximated using Bresenham algorithm.

So I want suggestions on what are the best and most efficient ways to do this? A link to C++ library or implementation would also be good enough. Please suggest some books also which deal with such problems.

Foi útil?

Solução

Bresenham is just a way to rasterise a geometric entity, and is used to avoid per-pixel floating-point operations. There's nothing stopping you from reverting to analytic geometry to find intersections.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top