|
|
Well, here's how I've been using it for the past several years:
// Sized image Map - 1 unit thick box
#declare XSize = 40;
#declare ImageMap = pigment {image_map {jpeg "TestGear.jpg" once} };
#declare Resolution = max_extent (ImageMap) + <0, 0, 1>;
#declare ImageMappedBox =
box {0, 1
texture {
pigment {ImageMap}
}
translate <-0.5, -0.5, -0.5>
scale Resolution*(1/Resolution.x)*XSize
//translate y*(Resolution.y / Resolution.x)*XSize/2
}
Note that there are only x and y non-zero-values to the max_extent, so that's
what the addition of the vector in defining Resolution is for (to avoid warnings
when using scale.
That last translation is to move the box from origin-centered to having it's
base at y=0.
Post a reply to this message
|
|