POV-Ray : Newsgroups : povray.general : Overlaying object over an image : Re: Overlaying object over an image Server Time
8 Aug 2022 21:48:39 EDT (-0400)
  Re: Overlaying object over an image  
From: Cousin Ricky
Date: 25 Jul 2022 14:01:18
Message: <62deda6e$1@news.povray.org>
On 2022-07-24 05:55 (-4), m@b wrote:
> It has been pointed out that "image_width" and "image_height" are
> built-in POV-Ray variables.
> 
> Here is a corrected version of my answer:
> 
>>
>> here is mt previous answer rotated into the x, z, plane:
>>
>> /////////////////////////////////////////////////////////////////////////
> 
> 
> #declare Image_W = 2592;
> #declare Image_H = 1944;

Also, in POV-Ray 3.7 and later, you can read the dimensions directly
from the pigment:

  #declare P = pigment
  { image_map
    { jpeg "D:/Files/Photos/Historic boats/027.JPG"
      once map_type 0 interpolate 2
    }
  }
  #declare Image_W = max_extent (P).x;
  #declare Image_H = max_extent (P).y;

> [snip]
> 
>     pigment {image_map {"D:/Files/Photos/Historic boats/027.JPG" once
> map_type 0 interpolate 2 } }
>     finish {ambient 1 diffuse 0}

Did you omit the #version at the top of the scene deliberately?  POV-Ray
3.7 and POV-Ray 3.6 render it differently; if you include #version 3.7,
the image turns out too pale.  Also, you omitted the jpeg keyword in the
image_map; POV-Ray 3.7 renders it to completion, but 3.6 halts, looking
for PNG image.

If the scene is intended for POV-Ray 3.7 or later, then the finish
statement should be:
  finish {ambient 0 diffuse 0 emission 1}
This will be important if 6digit decides to use radiosity.

If the scene is intended for POV-Ray 3.6, the finish statement must
remain as you wrote it, and the image dimensions cannot be read from the
file; but the jpeg keyword needs to be included in the image_map statement.


Post a reply to this message

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