Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uflorida!ukma!rutgers!rochester!pt.cs.cmu.edu!andrew.cmu.edu!po0o+ From: po0o+@andrew.cmu.edu (Paul Andrew Olbrich) Newsgroups: comp.graphics Subject: Ray tracing refraction Message-ID: <0XryqWy00Uo1875Ud-@andrew.cmu.edu> Date: 27 Jan 89 04:18:42 GMT References: <65@sdcc10.ucsd.EDU>, <5909@leadsv.UUCP> Distribution: usa Organization: Carnegie Mellon, Pittsburgh, PA Lines: 33 In-Reply-To: <5909@leadsv.UUCP> Hi-ho, I'm trying to add refraction to a ray tracing program I'm writing in C. Could someone help me out a bit? I've pooled stuff from my Physics and Calc texts, and I think I have it all worked out, but it doesn't look quite right. Assuming I really have no clear idea what I'm going, it'd be nice if someone would, in a wonderfully idealistic way, post the equations I want to use ... I have the following to work with: v = incidence vector n = normal vector to the surface i = incidence of refraction All I want here is a three equations like r[X] = ..., r[Y] = ..., and r[Z] = ..., where r is the refracted vector. Please? ... Reflection was easy but I'm stumbling on this one. The solution should handle total internal reflection, too, although that's probably obvious if you know what you're doing. Thank you! - Drew --- Drew Olbrich po0o+@andrew.cmu.edu "Not everything worth doing is worth doing well." -- Tom West "Love is a snowmobile speeding across the tundra and then suddenly it flips over, pinning you underneath. At night, the ice weasels come." -- Matthew Groening