On Sun, Apr 15, 2012 at 11:22 AM, Tuukka Verho tuukka.verho@aalto.fi wrote:
Your screenshot looks quite nice, indeed multiple intersections are correctly
handled. Though I’m getting the feeling that the code is quite large, and the
support for coloring and higher order bonds still need to be added as you say.
While thinking of a more straightforward way to achieve the same result I
stumbled upon some example code to do boolean operations with openglhttp://www.hackchina.com/en/r/78488/csg.c__html
If the clipping could be done with a logical AND operation, multiple bonds
etc. would be handled without any extra effort. Also cases when the cylinder
intersects with not just one but two or three walls would be nicely handled.I will experiment a bit and let you know if anything comes out of it.
I would advise against investing too much effort in this solution.
While it certainly should work for OpenGL, all rendering should be
done through painters so that alternative rendering backends (POV-ray,
etc) can have the same features. Clipping the primitives through GL
won’t have an effect on the other backends, which is why I’ve added
the extra code to actually draw the clipped primitives in the painter.
Dave