POV-Ray : Newsgroups : povray.object-collection : The Bright Star Catalogue : Re: The Bright Star Catalogue Server Time
19 Apr 2024 20:28:05 EDT (-0400)
  Re: The Bright Star Catalogue  
From: Bald Eagle
Date: 10 Feb 2018 21:45:00
Message: <web.5a7fae1be3b4c4165cafe28e0@news.povray.org>
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


Post a reply to this message

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