POV-Ray : Newsgroups : povray.newusers : image_map documentation : Re: image_map documentation Server Time
30 Jul 2024 16:26:27 EDT (-0400)
  Re: image_map documentation  
From: Mike Williams
Date: 1 Dec 2003 14:08:57
Message: <t3gzhRAIF5y$Ewj9@econym.demon.co.uk>
Wasn't it ianh who wrote:
>I have been trying to use image_map to get a 3D object from a cross
>section within a gif. The effect of what I am after would be similar to a
>complex prism. I set the ouside of the object to have filter 1.0 to make
>it transparent and the remainder to have default filter i.e. solid.
>
>According to the image_map documentation "With image maps you should imagine
>that each pixel is a long, thin, square, colored rod that extends parallel
>to the z-axis. The image is made from rows and columns of these rods
>bundled together and the object is then carved from the bundle."
>
>When using map_type 0 with a box I get the image on the front face of the
>box,
>and the reflection on the rear face and the interior of the box is empty.
>The front and rear faces generate separate shadows. This is not what is
>implied in the documentation.
>
>a) Is the documentation or my interpretation wrong?
>b) Is there another way of getting a prism like 3D object from an image?

a) Perhaps that particular analogy isn't as good as the one in the
previous paragraph "The image is /projected/ onto the object as though
there were a slide projector somewhere in the -z-direction". You only
see the projected colour at points where the surface exists. The "long
thin square coloured rod" analogy works for opaque image_maps, but could
be seen to imply that you would expect to see the sides of the rods when
using an image_map with some transparent regions.

b) You could try investigating the height_field object. In particular,
note the use of water_level.

For example, if you create a PNG file which has the shape drawn in pure
white on a pure black background you can use code like this to extrude
your prism:

camera {location  <0,2,-2> look_at <0,0,0> angle 50}
light_source {<-30, 100, -30> color rgb 1}

height_field {png "image.png"
   water_level 0.00001
   pigment {rgb 1}
   translate <-0.5,-0.5,-0.5>
}

The water_level keyword prevents the black bits (colour 0) from making a
flat area at the base.

Be aware that the object is open at the bottom.

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.