Path: news.umkc.edu!kuhub.cc.ukans.edu!wupost!psuvax1!news.pop.psu.edu!news.cac.psu.edu!howland.reston.ans.net!spool.mu.edu!mnemosyne.cs.du.edu!nyx10.cs.du.edu!not-for-mail Newsgroups: alt.3d Subject: Re: Using POV-RAY to generate data for SIRDS? (Yes! Source included.) Message-ID: <2uteqt$o4l@nyx10.cs.du.edu> From: jolsen@nyx10.cs.du.edu (John Olsen) Date: 29 Jun 1994 21:40:13 -0600 References: <1994Jun29.141500.5517@excaliber.uucp> Organization: University of Denver, Math/CS Dept. Lines: 48 joel@wam.umd.edu (Joel M. Hoffman) writes: [Use POV-RAY to build depth images?] This comes up once every month or so. Here's how to do it. (I just happen to be reading news on the system containing the modified source for a change. Stuart or Todd: Can this go in the FAQ?) You need to change render.c, and should not need to hit any other files. Inside the Trace() function, you need to replace where it looks up colors with the already available depth information. The full diff ("diff render.c.new render.c" assuming POV2.0) contains a bit of other tweaking: ----------------------------------------------------- 382c382 < /* Make_Colour (Colour, 0.0, 0.0, 0.0); */ --- > Make_Colour (Colour, 0.0, 0.0, 0.0); 408,414c408 < { < Make_Colour ( Colour, < 1-((int)(Best_Intersection.Depth) % 255 ) / 255.0, < 1-((int)(Best_Intersection.Depth) % 255 ) / 255.0, < 1-((int)(Best_Intersection.Depth) % 255 ) / 255.0); < /* Determine_Apparent_Colour (&Best_Intersection, Colour, Ray); */ < } --- > Determine_Apparent_Colour (&Best_Intersection, Colour, Ray); 416,422c410,413 < { < /* if (Frame.Fog_Distance > 0.0) < *Colour = Frame.Fog_Colour; < else < *Colour = Frame.Background_Colour; */ < Make_Col, 0.0, 0.0, 0.0 ); < } --- > if (Frame.Fog_Distance > 0.0) > *Colour = Frame.Fog_Colour; > else > *Colour = Frame.Background_Colour; ----------------------------------------------------- -- John M. Olsen Infix Technologies jolsen@nyx.cs.du.edu PO Box 381 Orem, UT 84057-0381 USA Phone (801) 221-9233