POV-Ray : Newsgroups : povray.general : Overlaying object over an image : Re: Overlaying object over an image Server Time
8 Aug 2022 21:23:59 EDT (-0400)
  Re: Overlaying object over an image  
From: Alain Martel
Date: 3 Aug 2022 12:26:01
Message: <62eaa199$1@news.povray.org>
Le 2022-07-30 à 17:55, 6digit a écrit :
> "m@b" <sai### [at] googlemailcom> 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;
>>
>>
>> // perspective (default, not required) camera
>> camera {
>>     orthographic
>>     location  <Image_W/2, 10000, Image_H/2,>
>>     look_at   <Image_W/2, 0, Image_H/2>
>>     right     x*Image_W/1944   // aspect
>>     //direction<3129.6857,3102.3533,0>
>>     focal_point < 563.2927, 0, 1366.9001>
>>     aperture 3.6171875
>>     // direction z                        // direction and zoom
>>     angle 16                           // field (overides direction zoom)
>> }
>>
>>
>> box{<0,0,0>,<1,1,0.001>
>>       pigment {image_map {"D:/Files/Photos/Historic boats/027.JPG" once
>> map_type 0 interpolate 2 } }
>>       finish {ambient 1 diffuse 0}
>>       scale <Image_W, Image_H, 1>
>>       rotate<90,0,0> // Rotate into the x,z plane
>> }
>>
>> box{<0,0,0>,<900,2,-80>        // Size
>>       pigment{rgb<1,0,1>}           // Colour
>>       finish {ambient 1 diffuse 0}  // Make it visible
>>       translate<88,1,88>          // Move it about (the y*1 puts it above
>> the image box)
>> }
>>
>>
>>
>>> ////////////////////////////////////////////////////////////////////////
> 
> Good evening im hoping any one can see this message i notice something when
> scrolling through this code.
> location  <Image_W/2, 10000, Image_H/2,>
>>     look_at   <Image_W/2, 0, Image_H/2>
> 
> i notice the predefined width and height were divided by 2. why ? and what does
> it do exactly. thank you
> 
> 
The height and width are for the total dimension of the image. <0,0> is 
the lower left corner. <Image_W, Image_H> is the top right corner.

If you want the camera to be at the centre, you need to divide those 
values by 2.


Post a reply to this message

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