POV-Ray : Newsgroups : povray.general : fit imported image to screen Server Time
31 Oct 2024 10:24:04 EDT (-0400)
  fit imported image to screen (Message 1 to 10 of 11)  
Goto Latest 10 Messages Next 1 Messages >>>
From: 6digit
Subject: fit imported image to screen
Date: 20 Jul 2022 14:50:00
Message: <web.62d84daeafca4da4d8145616fb08dd02@news.povray.org>
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
    }


Post a reply to this message


Attachments:
Download 'test.png' (155 KB)

Preview of image 'test.png'
test.png


 

From: m@b
Subject: Re: fit imported image to screen
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

From: 6digit
Subject: Re: fit imported image to screen
Date: 20 Jul 2022 17:55:00
Message: <web.62d878955cc658d2d8145616fb08dd02@news.povray.org>
"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?


Post a reply to this message

From: 6digit
Subject: Re: fit imported image to screen
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

From: jr
Subject: Re: fit imported image to screen
Date: 21 Jul 2022 04:30:00
Message: <web.62d90e0c5cc658d21be3cd4b6cde94f1@news.povray.org>
hi,

"6digit" <eob### [at] gmailcom> wrote:
> please i would like help with an issue I have.
> ....

"below I have posted ... the current code i have"

well, most code, probably, I need a '#version' and things, too, to make POV-Ray
happy ;-).  have included an alternative to m@b's suggestion, fwiw.


regards, jr.


-----<snip>-----
#version 3.8;

global_settings {assumed_gamma 1}

// dims, divided by 1000.
#declare w_ = 2.752;
#declare h_ = 4.896;

// map.
#declare p_ = pigment {
  image_map {png "6dig.png" once map_type 0 interpolate 2}
};

// lights, camera, action.

light_source {<-1,1,-1>*1000 color srgb 1 parallel}

camera {
  location <w_/2,h_/2,-15>
  right x * (w_/h_)
  up y
  look_at <w_/2,h_/2,0>
}

box {
  0, <w_,h_,.1>
  texture {
    pigment {p_}
    scale <w_,h_,1>
  }
}
-----<snip>-----


Post a reply to this message

From: 6digit
Subject: Re: fit imported image to screen
Date: 21 Jul 2022 14:00:00
Message: <web.62d993435cc658d24eb0f47cfb08dd02@news.povray.org>
"jr" <cre### [at] gmailcom> wrote:
> hi,
>
> "6digit" <eob### [at] gmailcom> wrote:
> > please i would like help with an issue I have.
> > ....
>
> "below I have posted ... the current code i have"
>
> well, most code, probably, I need a '#version' and things, too, to make POV-Ray
> happy ;-).  have included an alternative to m@b's suggestion, fwiw.
>
>
> regards, jr.
>
>
> -----<snip>-----
> #version 3.8;
>
> global_settings {assumed_gamma 1}
>
> // dims, divided by 1000.
> #declare w_ = 2.752;
> #declare h_ = 4.896;
>
> // map.
> #declare p_ = pigment {
>   image_map {png "6dig.png" once map_type 0 interpolate 2}
> };
>
> // lights, camera, action.
>
> light_source {<-1,1,-1>*1000 color srgb 1 parallel}
>
> camera {
>   location <w_/2,h_/2,-15>
>   right x * (w_/h_)
>   up y
>   look_at <w_/2,h_/2,0>
> }
>
> box {
>   0, <w_,h_,.1>
>   texture {
>     pigment {p_}
>     scale <w_,h_,1>
>   }
> }
> -----<snip>-----

good evening so i created a series of cylinders using the following code
sphere_sweep {
    linear_spline
    5,
    <image_width,image_height, 5>, 0.5
    <image_width, image_height, 6>, 0.5
    <image_width, image_height, 7>, 0.5
    <image_width, image_height, 8>,0.5
    <image_width, image_height, 9>,0.5
    tolerance 0.1
    scale 0.9
    //rotate<0.0169,0.5644,3.0455>

  }
i want to overlay this image over the image imported to pov ray. i have 2 issues
tho the first been
1. it seems the cylinders are behind the image ? how do i bring them foward in a
way they can seen as an intergral part of the scene. secondly how do i put them
in the x and y plane


Post a reply to this message

From: jr
Subject: Re: fit imported image to screen
Date: 21 Jul 2022 14:25:00
Message: <web.62d9993c5cc658d21be3cd4b6cde94f1@news.povray.org>
hi,

"6digit" <eob### [at] gmailcom> wrote:
> ...
> good evening so i created a series of cylinders using the following code
> sphere_sweep {
>     linear_spline
>     5,
>     <image_width,image_height, 5>, 0.5
>     <image_width, image_height, 6>, 0.5
>     <image_width, image_height, 7>, 0.5
>     <image_width, image_height, 8>,0.5
>     <image_width, image_height, 9>,0.5
>     tolerance 0.1
>     scale 0.9
>     //rotate<0.0169,0.5644,3.0455>
>
>   }
> i want to overlay this image over the image imported to pov ray. i have 2 issues
> tho the first been
> 1. it seems the cylinders are behind the image ? how do i bring them foward in a
> way they can seen as an intergral part of the scene. secondly how do i put them
> in the x and y plane

#2 - each point is a (3-vector) sphere centre, so just place them at convenient
locations.

#1 - so much depends.  you could declare the sweep, then translate it so it
moves nearer the camera, eg

#declare theSweep = sphere_sweep { ... };
  ...
object {theSweep translate some_pos}


regards, jr.


Post a reply to this message

From: jr
Subject: Re: fit imported image to screen
Date: 21 Jul 2022 14:30:00
Message: <web.62d99aac5cc658d21be3cd4b6cde94f1@news.povray.org>
(forgot, sorry)

"6digit" <eob### [at] gmailcom> wrote:
> ...
> sphere_sweep {
>     linear_spline
>     5,
>     <image_width,image_height, 5>, 0.5
>     <image_width, image_height, 6>, 0.5
>     <image_width, image_height, 7>, 0.5
>     <image_width, image_height, 8>,0.5
>     <image_width, image_height, 9>,0.5

you are aware that the variables you use refer to the rendered image size, ie
your '+wnnn +hnnn' options?


regards, jr.


Post a reply to this message

From: 6digit
Subject: Re: fit imported image to screen
Date: 21 Jul 2022 14:40:00
Message: <web.62d99d5d5cc658d24eb0f47cfb08dd02@news.povray.org>
"jr" <cre### [at] gmailcom> wrote:
> (forgot, sorry)
>
> "6digit" <eob### [at] gmailcom> wrote:
> > ...
> > sphere_sweep {
> >     linear_spline
> >     5,
> >     <image_width,image_height, 5>, 0.5
> >     <image_width, image_height, 6>, 0.5
> >     <image_width, image_height, 7>, 0.5
> >     <image_width, image_height, 8>,0.5
> >     <image_width, image_height, 9>,0.5
>
> you are aware that the variables you use refer to the rendered image size, ie
> your '+wnnn +hnnn' options?
>
>
> regards, jr.

yes i am aware. just experimenting


Post a reply to this message

From: Cousin Ricky
Subject: Re: fit imported image to screen
Date: 21 Jul 2022 19:37:30
Message: <62d9e33a$1@news.povray.org>
On 2022-07-20 17:57 (-4), 6digit wrote:
> 
> for the box or any other object i want to specifically place it in the x and z
> plane.

All image map pigments are in the x-y plane, so you would use rotate x
to bring it into the x-z plane.


Post a reply to this message

Goto Latest 10 Messages Next 1 Messages >>>

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