From charnel!olivea!spool.mu.edu!howland.reston.ans.net!europa.eng.gtefsd.com!uunet!news2.uunet.ca!uunet.ca!portnoy!canrem.com!david.anjo Wed Nov 3 19:15:46 PST 1993 Article: 35799 of comp.graphics Newsgroups: comp.graphics Subject: POV T'N T No.9 (1/3) From: david.anjo@canrem.com (David Anjo) Path: charnel!olivea!spool.mu.edu!howland.reston.ans.net!europa.eng.gtefsd.com!uunet!news2.uunet.ca!uunet.ca!portnoy!canrem.com!david.anjo Distribution: world Message-ID: <60.30488.4387.0N18917C@canrem.com> Date: Tue, 2 Nov 93 21:08:00 -0400 Organization: CRS Online (Toronto, Ontario) Lines: 71 <<***** Split Message. Part 1 Of 3 *****>> PoV Tips'n Tricks No.9 Based on the question posed by new user of PoV I thought I'd turn my attention to the creation of flat image mapping and height fields. The former is something that the authour of Pv3D, Ludovic Lecointe, initiated some months ago at my request. The technique is a simple one and one I use extensively, especially when creating "art gallery" rooms. Note how the size of the flat image map is matched to the overall scale of the object you are mapping to. That will provide the "best fit" that I have experienced, if the quality of the image map is something you want to retain. Height field "logos", although limited by the initial image resolution, are one the one way I know of for including 3D text in PoV scenes. Although far from perfect (actually kind of chunky) this technique is still reasonably acceptable. Especially if you are careful in how you apply your lighting and textures. The demonstration scene is as follows... -----cut here-------------------------------------------------- /* PV3D B1.91 One modeler for POV-RAY and VIVID POV-RAY V2.0 Generated file Pv3D is Copyright Lecointe Ludovic 1992,1993 PoV v.2.0 file demonstrating flat image (GIF) mapping and height field "logo" creation... from DASIGN/David Anjo Creation time: 6 minutes 23 seconds at 320x240, running under Windows 3.1, with the following PoV parameters, as defined in my POVRAY.DEF file: +W320 +H240 +A0.25 +X +V +MV2.0 */ /* External PV3D 'DEFAULT.INC' Area ...standard texture for those objects without a defined finish attribute - optional, but handy... */ #default { pigment { colour rgbf <1.0 1.0 1.0 0.0>} finish { ambient 0.4 diffuse 0.6 phong 1.0 }} // Standard POV includes files Area #include "colors.inc" #include "shapes.inc" #include "textures.inc" /* External 'filename.PIT' pigment Area for this frame ...this is where I declare my image maps for later inclusion within the scene... */ #declare POVTEST1 = pigment { image_map { < 1, -1, 0 > gif "POVTEST.GIF" map_type 0 interpolate 2 }} /* Note that POVTEST.GIF is located in a directory that is also included in the search path found within my <<***** Continued Next Message *****>> ~~~ * VbReader 2.0 #11 * It's not the tobacco we're after, it's the fire <<***** Split Message. Part 2 Of 3 *****>> POVRAY.DEF file, via the "+l" parameter. The file itself is a 320x200-256 GIF, simply white text on a black background. I created the original file in PhotoStyler and then converted that 24 bit TIF to a GIF via Image Alchemy. The palette was specifically mapped via a custom GIF file who's palette map is typically referred to as NTSC "compatible". That doesn't mean you have to do this; it just works best for me and the work I do... */ // Camera location... roughly to the "right", "up" and "back". camera { location <1.0, 4.0, -8.0> direction <0, 0, 1.0> up <0, 1, 0> right <1.3333, 0, 0 > look_at <0.0, 0.0, 0.0>} /* This is the cube I will be flat image mapping the GIF file to. The specific definition provides for a "poster" feel. */ object { box {<-1.0, -1.0, -1.0>, <1.0, 1.0, 1.0> scale < 3.2, 2.0, 0.1> translate < 0.0, 0.75000, 0.0> texture { POVTEST1 scale < 6.4, 4.0, 0.2> translate < -3.2, -1.25000, -0.1>} pigment { quick_colour red 1.00 green 1.00 blue 1.00 filter 0.00} bounded_by { box { <-3.3, -1.35000, -0.2>, <3.3, 2.85000, 0.2>}}}} /* This is the "height field" logo I will be creating, also using the same GIF file... note the rotation of the object, so the "message" faces the camera (x rotation = 270 degrees). Additionally note that the "waterlevel" essentially wipes out the black areas of the GIF image. Thus, only the text, in white, will remain to have the Polished_Brass texture applied to it... */ object { height_field { gif "povtest.gif" water_level 0.001 translate < -0.5, -0.5, -0.5> scale < 6.4, 0.5, 4.0> rotate < 270, 0, 0> translate < 0.0, -0.75000, -1.0> texture { Polished_Brass scale < 3.2, 0.25000, 2.0> rotate < 270, 0, 0> translate < 0.0, -0.75000, -1.0> } pigment { quick_colour red 1.00 green 1.00 blue 1.00 filter 0.00} bounded_by { box { <-3.3, -2.85016, -1.35130>, <3.3, 1.35016, -0.64870>}}}} /* A simple box/cube, so the scene has a "floor"... note there is no "bounding box" applied to this object; nothing special going on, no need to bound... */ <<***** Continued Next Message *****>> ~~~ * VbReader 2.0 #11 * It's not the tobacco we're after, it's the fire <<***** Split Message. Part 3 Of 3 *****>> object { box {<-1.0, -1.0, -1.0>, <1.0, 1.0, 1.0> scale < 4.0, 0.1, 4.0> translate < 0.0, -3.0, 0.0>}} // The light for the scene... object { light_source <0.0, 0.0, 0.0> colour rgb <1.0, 1.0, 1.0> scale <0.4, 0.44, 0.4> translate < 5.0, 15.0, -15.0>}} // end -----cut here-------------------------------------------------- That's it... nothing really all that special. The scene isn't one for the art galleries of the world; but, hopefully the technique will prove beneficial in your raytracing endeavours. Happy 'tracing... David Anjo | RIME ->118 | DASIGNet +1 519 744 8489 david.anjo@canrem.com | FIDO 1:229/15 | 00:00-08:00 EST 9600+ 8N1 ~~~ * VbReader 2.0 #11 * It's not the tobacco we're after, it's the fire