POV-Ray : Newsgroups : povray.newusers : Texture : Re: Texture Server Time
29 Jul 2024 22:27:01 EDT (-0400)
  Re: Texture  
From: Mike Williams
Date: 15 Feb 2005 00:47:43
Message: <9jrcnHAD9UECFw2c@econym.demon.co.uk>
Wasn't it Daniel who wrote:
>Can you make this thick and only on one side of the box?

I think you need to use a heightfield rather than a texture.

The image (cookiecutter.png" in the code below) should be the cutout
shape. This can either be a completely white image with an alpha channel
indicating the cutouts, or an image without an alpha channel which uses
black for the holes and white for the solid parts.

If you also want an image-based texture, you'll need a second image
without an alpha channel ("texture.png" in the code below).

#version 3.6;
global_settings {assumed_gamma 1.0}
camera {location  <-10,10,-10> look_at <0,0,0> angle 15}
background {rgb 1}
light_source {<-30, 100, -50> color rgb 1}


#declare Thickness = 0.04;


#declare W=1-Thickness;
// The lid has a cut out
intersection {
  height_field {png "cookiecutter.png" 
    translate <-0.5,0,-0.5>
    scale <2,1,2>
  }
  box {<-0.99,W,-0.99><0.99,1,0.99>}
  pigment {image_map {png "texture.png"}
    rotate x*90
    translate <-0.5,0,-0.5>
    scale 2 
  }
}

// The other sides don't
difference {
  box {-0.99,0.99}
  box {<-W,-W,-W><W,1.1,W>}
  pigment {rgb 1}
}


-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

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