POV-Ray : Newsgroups : povray.documentation.inbuilt : 3.7xx: max_extent (re: image resolution) is missing something? : Re: 3.7xx: max_extent (re: image resolution) is missing something? Server Time
28 Sep 2021 14:59:29 EDT (-0400)
  Re: 3.7xx: max_extent (re: image resolution) is missing something?  
From: Bald Eagle
Date: 8 Jun 2017 13:50:06
Message: <web.59398df47cb8f4dcc437ac910@news.povray.org>
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

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