I am rendering smooth and faceted polygons in 3D. The user is able to select the polygons and I display the selection as a boundary around the polygon by adjusting the polygon mode to GL_LINE. Pretty standard stuff.
But, what I don’t have clue how to do is to render this nicely so that the selection is always visible. For example, if I use black, then selections in the shade don’t show.
So, I was thinking, how is it possible to achieve Windows GDI like effects like XOR to show the selection clearly no matter what.
Have you tried glLogicOp() with GL_XOR?
This is in core since 1.1. Not sure about hardware acceleration but I don’t see any reason why it should not work.
Originally posted by sqrt[-1]: Have you tried glLogicOp() with GL_XOR?
This is in core since 1.1. Not sure about hardware acceleration but I don’t see any reason why it should not work.
As long as he doesn’t use an RGBA color buffer:
NOTES
Logical pixel operations are not applied to RGBA color buffers.
To ensure that your selection colour stands out, you could always just render a width 3 line in “say grey”, or perphaps semi opaque black, with a dashed width 1 line in “say white” on top. That way you’ll at least be guaranteed some contrast.
Hope this helps,
Heath.
[This message has been edited by heath (edited 07-17-2003).]
The logical operation on color values is enabled or disabled with Enable or
Disable using the symbolic constant COLOR LOGIC OP. If the logical operation is
enabled for color values, it is as if blending were disabled, regardless of the value of BLEND.