|
|
On 2/10/2018 9:44 PM, Bald Eagle wrote:
> Mike Horvath <mik### [at] gmailcom> wrote:
>> I kinda wish there were a POV-Ray object that would be guaranteed to
>> always be 1 pixel big.
>
> I snipped this out of something I wrote last April, and haven't tested it out
> tonight in a scene all by itself, but it gives you the broad strokes.
>
>
> Location is the camera location.
> (So do
> #declare Location = <0, 0, -10>;
> camera { ... location Location ...}
> )
> Vector is the center of the object you want to be 1 pixel.
> The macro returns the radius of a sphere/cylinder so it is a pixel wide.
> you can work the rest out from there.
>
> // Minimum radius for solid visibility is (Z/image_width)*Aspect
> // Minimum radius for threshold visibility is (Z/image_width)
>
> #macro MinRad (Vector)
> #local Aspect = image_width/image_height;
> #local Dist = vlength (Vector-Location);
> #local M = (0.5*Aspect)/tan(radians(Angle/2));
> #local ZA = Dist/M;
> #local Rad = (ZA/image_width)*Aspect;
> Rad
> #end // end macro MinRad
>
>
Interesting. Would it work better with a cube oriented to face the
camera? I suppose the perspective distortion might make the cubes look
weird if they're toward the edges of the image. But spheres would end up
looking distorted too.
Mike
Post a reply to this message
|
|