Original Post
Hi all,
I''ve been cooking my brain trying to come up with a practical way to do a reflective surface (i.e. mirror) in OpenGL. If anyone could help me out (even with just some theory, not OGL-specific stuff), that would rock my world.
I know in theory what I should be rendering (calculating angle of incidence (from eye) to surface, and reversing it, then treating the plane normal to this as a viewport to project to... its kinda hard to put into words, but I know what I''m getting at
), but I''m having trouble deciding on how to actually determine what to draw, and how to map it onto a poly.
Can I have a separate OpenGL state machine which treats this surface as a viewport, projecting onto the poly (I know, it sounds very unlikely to me too)?
I assume I have to implement some sort of (software) clipping and hidden surface determination, and ''project'' what can be ''seen'' onto a texture, which I then apply to the poly (does this sound feasible?). This sounds like a real bitch, ''coz I want it to work with a perspective projection (i.e. a clipping frustum, rather than a ''box''... screw doing that in software
)
Would environment mapping do this, or is that just a smoke-and-mirrors (d''oh, bad analogy
) way of doing reflection?
Even some links on the topic would be much appreciated.
Thankyou, bye.
-------------
squirrels are a remarkable source of protein...