POV-Ray : Newsgroups : povray.general : fit imported image to screen : Re: fit imported image to screen Server Time
26 Apr 2024 07:57:29 EDT (-0400)
  Re: fit imported image to screen  
From: 6digit
Date: 20 Jul 2022 18:00:00
Message: <web.62d87a5f5cc658d2d8145616fb08dd02@news.povray.org>
"6digit" <eob### [at] gmailcom> wrote:
> "m@b" <sai### [at] googlemailcom> wrote:
> > 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
> >
> >
> > ///////////////////////////////////////////////////////////////////////////////
> Thank you very much this has been an issue i have been dealing with. one more
> thing if you dont mind  if i want to overlay a simple box over the image what do
> i have to do? and secondly is ok if i refrence you in my work as you have
> provided such good work?

for the box or any other object i want to specifically place it in the x and z
plane.


Post a reply to this message

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