POV-Ray : Newsgroups : povray.binaries.images : Viewing geometry problem Server Time
14 Nov 2024 14:20:29 EST (-0500)
  Viewing geometry problem (Message 1 to 9 of 9)  
From: Jörg 'Yadgar' Bleimann
Subject: Viewing geometry problem
Date: 3 May 2009 10:24:12
Message: <49fda90c@news.povray.org>
High!

To implement a LOD (level of detail) system for large surface textures 
of planets in my Solar System model, I started with testing the FOV 
width in POV units corresponding to camera distance and angle.

As the horizontal image width (in POV units) as 
camera_distance*tan(angle/2), a sphere with a radius of 3396.2 units 
(the planet Mars) should exactly fit into the camera window when viewed 
from a distance of 9330.982812 units - but instead the planet's disc is 
still too large for the image (see attachment)! Obviously, "angle 40" 
does not give really a 40-degree FOV, but a somewhat narrower one... or 
what else did I get wrong?

See you on www.khyberspace.de!

Yadgar


Post a reply to this message


Attachments:
Download '2009-05-03 mars, take 3.jpg' (102 KB)

Preview of image '2009-05-03 mars, take 3.jpg'
2009-05-03 mars, take 3.jpg


 

From: Warp
Subject: Re: Viewing geometry problem
Date: 3 May 2009 10:34:26
Message: <49fdab72@news.povray.org>

> As the horizontal image width (in POV units) as
> camera_distance*tan(angle/2), a sphere with a radius of 3396.2 units
> (the planet Mars) should exactly fit into the camera window when viewed
> from a distance of 9330.982812 units - but instead the planet's disc is
> still too large for the image (see attachment)!

  Did you take into account perspective? You are not using a disc, but a
sphere, and perspective will make the half of the sphere closer to the
camera be larger than the "disc" at that exact distance.

  You should try it with a true disc object instead.


Post a reply to this message

From: sooperFoX
Subject: Re: Viewing geometry problem
Date: 3 May 2009 11:10:00
Message: <web.49fdb297c9b881af3e3c08aa0@news.povray.org>
Warp <war### [at] tagpovrayorg> wrote:

> > As the horizontal image width (in POV units) as
> > camera_distance*tan(angle/2), a sphere with a radius of 3396.2 units
> > (the planet Mars) should exactly fit into the camera window when viewed
> > from a distance of 9330.982812 units - but instead the planet's disc is
> > still too large for the image (see attachment)!
>
>   Did you take into account perspective? You are not using a disc, but a
> sphere, and perspective will make the half of the sphere closer to the
> camera be larger than the "disc" at that exact distance.
>
>   You should try it with a true disc object instead.

I don't think the spherical shape would have *that much* of an effect. In my
(somewhat little) experience with POV cameras, the camera's direction vector
also has a bearing on the field of view.

The docs (3.3.1 Camera) says for the camera type: perspective, default values
are:

angle : ~67.380 (direction_length=0.5*right_length/tan(angle/2))
direction : <0,0,1>
right : 1.33*x

So you might need to play around with reducing the direction vector, and/or
taking care in the order you specify the parameters (yes, it can have an effect
too!). If you _are_ specifying the direction, try it without, or make sure it's
a vector of length 1 (unit vector), and comes before angle but after location.


Hope this helps

- sooperFoX


Post a reply to this message

From: clipka
Subject: Re: Viewing geometry problem
Date: 4 May 2009 06:25:00
Message: <web.49fec16ac9b881af451fd6cd0@news.povray.org>
"sooperFoX" <bon### [at] gmailcom> wrote:
> >   Did you take into account perspective? You are not using a disc, but a
> > sphere, and perspective will make the half of the sphere closer to the
> > camera be larger than the "disc" at that exact distance.
> >
> >   You should try it with a true disc object instead.
>
> I don't think the spherical shape would have *that much* of an effect.

We're talking about a ratio of distance vs. radius of roughly 2:1. At that
distance, we're talking about roughly 10-15% "overshoot" (didn't bother to
calculate it, just drew a picture instead and measured), which would fit the
bill quite well it seems.


Post a reply to this message

From: Tim Attwood
Subject: Re: Viewing geometry problem
Date: 4 May 2009 17:31:18
Message: <49ff5ea6$1@news.povray.org>
> To implement a LOD (level of detail) system for large surface textures 
> of planets in my Solar System model, I started with testing the FOV 
> width in POV units corresponding to camera distance and angle.
> 
> As the horizontal image width (in POV units) as 
> camera_distance*tan(angle/2), a sphere with a radius of 3396.2 units 
> (the planet Mars) should exactly fit into the camera window when viewed 
> from a distance of 9330.982812 units - but instead the planet's disc is 
> still too large for the image (see attachment)! Obviously, "angle 40" 
> does not give really a 40-degree FOV, but a somewhat narrower one... or 
> what else did I get wrong?

I think you used degrees instead of radians.

#include "colors.inc"
#include "math.inc"

#declare disc_radius = 3396.2;
#declare camera_angle = 40;
#declare camera_dist = -(disc_radius/tand(camera_angle/2));

camera {
   location  <0, 0, camera_dist>
   direction 1.0*z
   right     x*image_width/image_height
   look_at   <0.0, 0.0,  0.0>
   angle camera_angle
   
}

background {Black}

disc {<0,0,0>,-z,disc_radius
   texture {
      pigment {White}
      finish {ambient 1}
   }
}


Post a reply to this message

From: Cousin Ricky
Subject: Re: Viewing geometry problem
Date: 5 May 2009 21:19:01
Message: <op.uthhxtoo6b35ac@your-727a0a4e7c.vipowernet.net>
On Sun, 03 May 2009 11:04:55 -0400, sooperFoX <bon### [at] gmailcom>  
wrote:
> I don't think the spherical shape would have *that much* of an effect.

Oh, but it does.  Please find attached the view of a sphere using Yadgar's  
numbers, the view of a disc with the same geometry, and a diagram of the  
geometry.


-- 
<Insert witty .sig here>


Post a reply to this message


Attachments:
Download 'yadgar-sphere.jpg' (6 KB) Download 'yadgar-disc.jpg' (6 KB) Download 'yadgar-geometry.png' (15 KB)

Preview of image 'yadgar-sphere.jpg'
yadgar-sphere.jpg

Preview of image 'yadgar-disc.jpg'
yadgar-disc.jpg

Preview of image 'yadgar-geometry.png'
yadgar-geometry.png


 

From: sooperFoX
Subject: Re: Viewing geometry problem
Date: 6 May 2009 04:30:00
Message: <web.4a014a78c9b881af3e3c08aa0@news.povray.org>
"Cousin Ricky" wrote:
> On Sun, 03 May 2009 11:04:55 -0400, sooperFoX wrote:
> > I don't think the spherical shape would have *that much* of an effect.
>
> Oh, but it does.  Please find attached the view of a sphere using Yadgar's
> numbers, the view of a disc with the same geometry, and a diagram of the
> geometry.

Wow, that's a lot more than I would have expected. I guess the camera is pretty
close (relatively). Thanks for the illustration!


Post a reply to this message

From: John VanSickle
Subject: Re: Viewing geometry problem
Date: 8 May 2009 08:27:37
Message: <4a042539$1@news.povray.org>

> High!
> 
> To implement a LOD (level of detail) system for large surface textures 
> of planets in my Solar System model, I started with testing the FOV 
> width in POV units corresponding to camera distance and angle.
> 
> As the horizontal image width (in POV units) as 
> camera_distance*tan(angle/2), a sphere with a radius of 3396.2 units 
> (the planet Mars) should exactly fit into the camera window when viewed 
> from a distance of 9330.982812 units - but instead the planet's disc is 
> still too large for the image (see attachment)! Obviously, "angle 40" 
> does not give really a 40-degree FOV, but a somewhat narrower one... or 
> what else did I get wrong?

To see what's going on,

1) Draw a circle.
2) Draw a line dividing the circle into equal halves.
3) Select a point on either side, outside of the circle.
4) Draw two lines, one going from the point you chose in step three to 
each of the ends of the circle's diameter.

You will observe that one or both of the lines from step 4 intersect the 
circle before reaching the end of the diameter.

The following code produces a scene in which the sphere exactly touches 
the left and right edges of the frame.

// BEGINNING OF SCENE
#local camAngle=40;
#local sphereRad=45;


sphere { 0,sphereRad pigment { rgb .75 } }

camera {
   angle camAngle
   location -z*sphereRad / sin(radians(camAngle/2))
   look_at 0
}


light_source {
   <1e4,1e4,-1e4>
   1
}

// END OF SCENE

You can change the values of camAngle and sphereRad, and the scene will 
not change significantly.

Regards,
John


Post a reply to this message

From: Jellby
Subject: Re: Viewing geometry problem
Date: 8 May 2009 13:40:04
Message: <7g5ed6-q79.ln1@badulaque.unex.es>
Among other things, sooperFoX saw fit to write:

> I don't think the spherical shape would have *that much* of an effect.

If r is the radius of the sphere/disc and d is the distance from its center
to the camera, then the angle occupied by a disc is:

alpha = atan (r/d)

while the angle occupied by a sphere is:

beta = asin (r/d)

The smaller r/d the more similar alpha and beta are, but alpha is always
smaller than beta, and for r/d=0.5:




-- 
light_source{9+9*x,1}camera{orthographic look_at(1-y)/4angle 30location
9/4-z*4}light_source{-9*z,1}union{box{.9-z.1+x clipped_by{plane{2+y-4*x
0}}}box{z-y-.1.1+z}box{-.1.1+x}box{.1z-.1}pigment{rgb<.8.2,1>}}//Jellby


Post a reply to this message

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