POV-Ray : Newsgroups : povray.general : fit imported image to screen : Re: fit imported image to screen Server Time
8 Aug 2022 22:33:38 EDT (-0400)
  Re: fit imported image to screen  
From: m@b
Date: 20 Jul 2022 17:01:25
Message: <62d86d25@news.povray.org>
On 20/07/2022 7:47 pm, 6digit wrote:
> please i would like help with an issue I have.
> I have an imported image and I would like it to be scaled to full size as it is
> currently at a scale that is not visible to the eye. below I have posted the
> image
> and the current code i have
> 
> // perspective (default, not required) camera
> camera {
>    perspective
>    location  <5, 5, -15>
>    look_at   <0, 0,  0>
>    right     x*2752/4896   // aspect
>    //direction<3129.6857,3102.3533,0>
>    focal_point < 563.2927,1366.9001,0.0>
>    aperture 3.6171875
>    // direction z                        // direction and zoom
>    // angle 67                           // field (overides direction zoom)
> }
> plane {
>      z, 1
>      pigment {
>      image_map {png "image" once map_type 0 interpolate 2 } }
>      finish {ambient 1 diffuse 0}
>        scale 4
>      }

Here is how I would do it:

ini settings: +W2592 +H1944   // Set the output to the original size of 
your image.



#declare image_width = 2592;
#declare image_height = 1944;

///////////////////////////////////////////////////////////////////////////////
// perspective (default, not required) camera
camera {
   orthographic							
	// Less distortion with an orthographic	camera

   location  <image_width/2, image_height/2, -10000
	// Move the camera perpendicular to the center of the image
	// and back in z

   look_at   <image_width/2, image_height/2,  0>
	// Point at the center of the image

   right     x*image_width/image_height
	// aspect the same as original image.

   //direction<3129.6857,3102.3533,0>
   focal_point <image_width/2, image_height/2,  0>
	// I have never used focal_point before but I guess
	// it needs to be the centre of the image

   aperture 3.6171875
   // direction z                        // direction and zoom
   angle 14                           // 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_width, image_height, 1>
}

// Make a box from 0 to 1 in z and y, thin in z
// Add image (from 0 to 1)
// then scale to original aspect


///////////////////////////////////////////////////////////////////////////////


Post a reply to this message

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