POV-Ray : Newsgroups : povray.general : perspective - calculations Server Time
19 Nov 2024 01:50:29 EST (-0500)
  perspective - calculations (Message 1 to 4 of 4)  
From: Rafal 'Raf256' Maj
Subject: perspective - calculations
Date: 4 Jul 2002 12:52:15
Message: <Xns9241BF6EAA147raf256com@204.213.191.226>
camera {
  location 0
  look_at z
}

how can I calculate (X,Y) of image for given <x,y,z> point, assuming image 
is 1x1 and angle is A.
for perspective camera it will be 
X=(x-0.5)*d + 0.5
Y=(y-0.5)*d + 0.5

(what's forumla for 'd' btw...)

what are formulas for diffrent camera types (especialy for fish_eye and 
ultra_wide)

-- 


Post a reply to this message

From:
Subject: Re: perspective - calculations
Date: 4 Jul 2002 13:03:24
Message: <dpv8iuoqqousmoq0p5ishao8q214n4mb32@4ax.com>
On 4 Jul 2002 12:52:15 -0400, "Rafal 'Raf256' Maj" <raf### [at] raf256com> wrote:
> camera {
>   location 0
>   look_at z
> }
>
> how can I calculate (X,Y) of image for given <x,y,z> point, assuming image 
> is 1x1 and angle is A.
> for perspective camera it will be 
> X=(x-0.5)*d + 0.5
> Y=(y-0.5)*d + 0.5

take a look at my extension to standard screen.inc include file:
http://news.povray.org/povray.text.scene-files/23663/

> what are formulas for diffrent camera types (especialy for fish_eye and 
> ultra_wide)

IIRC you have C skills so you can look for it in POV sources.

ABX


Post a reply to this message

From: Rafal 'Raf256' Maj
Subject: Re: perspective - calculations
Date: 4 Jul 2002 13:06:52
Message: <Xns9241C1E904F09raf256com@204.213.191.226>

news:dpv8iuoqqousmoq0p5ishao8q214n4mb32@4ax.com: 

> take a look at my extension to standard screen.inc include file:
> http://news.povray.org/povray.text.scene-files/23663/

>> what are formulas for diffrent camera types (especialy for fish_eye
>> and ultra_wide)
> IIRC you have C skills so you can look for it in POV sources.

no time to do this now :/

but - this question IS related with programming... I hope my idea will 
work - and I will make somethig useful for POV :)


-- 


Post a reply to this message

From: Hermann Voßeler
Subject: Re: perspective - calculations
Date: 4 Jul 2002 15:29:19
Message: <3D249FA5.6010104@webcon.de>
Rafal 'Raf256' Maj wrote:
>>>what are formulas for diffrent camera types (especialy for fish_eye
>>>and ultra_wide)
>>
>>IIRC you have C skills so you can look for it in POV sources.
> 
> 
> no time to do this now :/
> 

I would guess it is much simpler to have a look at the formulas
in the source, than try to explain it by abstract mathematical
formula, because -- as a consequence of the way raytracing works
-- the cameras are defined "backwards", i.e. you enter pixel
coordinates and the camera constructs a ray.

The Function is called "create_ray()" and is located in RENDER.c
It is really pretty much self explaining... :-)

Hermann


Post a reply to this message

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