Creating invisible object
I would like to create a totally "invisible" object (can be a simple one, like a "gluCylinder"). The viewer would notice the object when it is behind or collide with another object - example, if a "glutSolidCube" is behind my "invisible gluCylinder", the cube would be partially occluded by the cylinder (we would see the background on the occluded area).
How can I do that? I've tried to use glColorMask, so I could hide the cylinder , but the mask affected the whole frame instead of only the cylinder (maybe I'm not using it correctly, is there a way of doing it only for one (or a few) objects?). I don't think transparency would work for me, because I'd see the occluded part of the cube, for instance.
Can you help?
Thanks in advance
Well, because you didn't reset the color mask after you've drawn the invisible cylinder. Set glColorMask to all false before drawing the invisible cylinder then reset it to all true.
Originally Posted by leoalvesmachado
Disclaimer: This is my personal profile. Whatever I write here is my personal opinion and none of my statements or speculations are anyhow related to my employer and as such should not be treated as accurate or valid and in no case should those be considered to represent the opinions of my employer.
Technical Blog: http://www.rastergrid.com/blog/
Thanks, it worked.
Originally Posted by aqnuep
I was putting false only on the color I was drawing the object and reseting it. I should have put everything false as you suggested.