POV-Ray : Newsgroups : povray.newusers : How do you get just a piece of the image Server Time
26 Nov 2024 17:38:37 EST (-0500)
  How do you get just a piece of the image (Message 1 to 4 of 4)  
From: Apchar Boiir
Subject: How do you get just a piece of the image
Date: 5 Mar 2004 01:44:55
Message: <404821e7@news.povray.org>
I have raytracing that is 200x200 and I want to extract just the upper right 
20x20 pixel corner. I thought
+W200 +H200 +SC180 +ER20
would do the trick but the result is still a 200x200 file with all but my
desired square blackened out. But I don't want a 200x200 file. I want a
20x20 file that has that upper right corner and nothing else. Is there some
way to do this without resorting to manual cropping with an external
graphics program?
Thanx,
Apchar

-- 
No one is safe while the legislature is in session. -- Mark Twain


Post a reply to this message

From: Apchar Boiir
Subject: I forgot to say I am using POVRAY
Date: 5 Mar 2004 01:48:56
Message: <404822d8@news.povray.org>
Sorry. I forgot to mention that I'm using povray for linux.

-- 
No one is safe while the legislature is in session. -- Mark Twain


Post a reply to this message

From: Florian Brucker
Subject: Re: How do you get just a piece of the image
Date: 5 Mar 2004 11:29:08
Message: <4048aad4@news.povray.org>
Short Answer:
No

Long Anser:
You will always get an image-file which fills the whole space of the 
original size. There have been discussions about that, but the search of 
the news-interface is down ATM, so I can't give you any links.

HTH,
Florian


Post a reply to this message

From: StephenS
Subject: Re: How do you get just a piece of the image
Date: 6 Mar 2004 22:11:52
Message: <404a92f8@news.povray.org>
> I have raytracing that is 200x200 and I want to extract just the upper
right
> 20x20 pixel corner. I thought
> +W200 +H200 +SC180 +ER20
> would do the trick but the result is still a 200x200 file with all but my
> desired square blackened out. But I don't want a 200x200 file. I want a
> 20x20 file that has that upper right corner and nothing else. Is there
some
> way to do this without resorting to manual cropping with an external
> graphics program?

Transforming the camera can work, example
// +h200 +w200
// -uv +h20 +w20
#declare Shear= transform {
   matrix <  .21,  0,  0,
             0,  .21,  0,
             .9,  .9,  1,
             0,  0,  0 >
}
camera {
        perspective
        location <0,0,0>
        right <1,0,0>
        look_at <0,0,10>
        // transform Shear
        }

box {<-10,-10,10>,<10,10,11>
     pigment {checker rgb<1,1,1>,rgb<0,0,0>}
     }
sky_sphere {pigment {rgb <0.859,0.910,0.831>}}

light_source {<100,120,-130> rgb<10,10,10>}

The transformation you need depends on the camera location and the direction
it's looking. I've chosen the easiest, with the location at <0,0,0>, looking
along the positive z direction. The .21 scales the view (.2 perfect fit) and
the .9 skews the image plane to the upper right corner. When using a
transformation like this, you need to turn off the vista buffer (-uv). The
only way to get a 20 x 20 final render is to use +h20 +w20.

I hope this is correct :-)

Stephen


Post a reply to this message

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