[Plib-users] Semi-transparent plane
Brought to you by:
sjbaker
From: Martin H. <how...@os...> - 2001-01-17 00:36:06
|
I've been struggling for about a week trying to get a semi-transparent plane to show using SSG. First off, I'm primarily an HCI guy with programming skills which I use for prototype production, and not primarily a programmer. I took the Tux demo and transmogrified it into a display where there is a textured ground plane, a camera at a certain altitude above that plane, and a number of objects scattered at different heights in the field of view. What I want to achieve is a semi-transparent plane just under the camera's altitude, parallel to the ground plane, with a slight colour tint: everything under that plane would be slightly dimmer and slightly colour tinted (as if viewed through tinted glass), everything above would be unobstructed. Objects cut in half by the translucent plane would be rendered accordingly. (I'm doing this as part of my research on 3D displays, so I'm not really interested in the prototype itself beyond being able to run experiments with it as a stimulus.) I have the Red Book, and the OpenGL Superbible and I've read the PLIB documentation on the web site. From what I can tell, you need to draw everything else before you draw the translucent plane, but I don't know how to achive this with SSG (I tried adding the plane as the last child to the scene, but it doens't seem to work). Also, it would appear that ssgSimpleState cannot achieve the effects on its own: I need callbacks that call 'glBlendFunc()' and 'glDepthMask()'. So, please, excuse a dumb beginner, but am I on the right track with callbacks? How do I control drawing order? And am I missing anything obvious? As it is, my transluscent plane isn't being drawn at all. M. -- Martin Howard | Visiting Scholar, CSEL, OSU | 53 kB/s and nothing on. email: how...@os... | www: http://mvhoward.i.am/ +---------------------------------------- |