POV-Ray : Newsgroups : povray.general : Positioning a camera : Re: Positioning a camera Server Time
1 Aug 2024 20:10:54 EDT (-0400)
  Re: Positioning a camera  
From: Cesar
Date: 18 Apr 2005 14:15:01
Message: <web.4263f7dc1c98b29bb45fb2880@news.povray.org>
>   Let me guess: You are not printing enough decimals.
>
>   By default C and C++ print only a few decimals for floating point numbers
> (six, if I remember correctly). This rounds (from POV-Ray's point of view)
> the values way too much. You have to print the values more accurately,
> with like 15 decimals or so to be sure.
>   The way to increase printing accuracy of floating point numbers depends
> on whether you are printing using C or C++ streams.
>
> --
>                                                           - Warp


Thanks for the answers! I'm using povray to simulate a camera we have in an
airship, so I'm interested in the distorted image cause then I can directly
simulate a not perfect camera, instead of introducing the erros in the
already rendered image.

I've been programming in c/c++ for years but I just realized I never had to
change printing accuracy of floating point numbers in c++, only in c.
Anyway, i found the precision() function (member of the ostream class) and
set the precision to 15 digits. Even so, povray still complains. I checked
the angles inside povray and I got things like: 90.0000001 and 89.9999993.
I think I'll work with this values and accept a most probably not
noticeable distortion (if I adjust the vectors inside povray, they will be
inconsistent with the c++ app).

Thanks again,

Cesar


Post a reply to this message

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