POV-Ray : Newsgroups : povray.binaries.images : mesh2 asteroids: strange clippings : Re: mesh2 asteroids: strange clippings Server Time
31 Jul 2024 20:20:01 EDT (-0400)
  Re: mesh2 asteroids: strange clippings  
From: clipka
Date: 20 Apr 2009 05:40:00
Message: <web.49ec426aae2d08d51a1b9caf0@news.povray.org>
=?ISO-8859-1?Q?J=F6rg_=27Yadgar=27_Bleimann?= <yaz### [at] gmxde> wrote:
> Originally, my Phobos has radii of about 13.4 x 11.2 x 9.2 POV units, as
> the sun sits at the origin, Phobos' orbit together with Mars is about
> 227900000 POV units wide. Knowing that most objects at such distances
> won't render correct, I introduced a scaling divisor and set it to 13347
> - probably this is too high for small objects like asteroids and
> irregular moons. I decreased it to 13 (!) - and then, the clipping
> disappeared!

You have a bounding box problem. And your divisor won't solve it.

For memory efficiency, POV-Ray uses single-precision floating point numbers for
bounding boxes. Those are precise to about 7 digits.

So at a position 227900000 whatever-units away from the co-ordinate origin,
bounding boxes have a "resolution" of 100 whatever-units. Dividing all
dimensions will not help you: It's the relative size that kills here. You may
find divisors that *happen* to be ok for where the moon sits right now, but
things will go awry again as soon as you move the moon around.

What you really need to do is turn off bounding boxes altogehter. It's not as
bad as it sounds: You probably just have spheres and meshes. As long as you
generate the meshes near the origin, their internal bounding mechanism will
kick in, and do a good job on it. And those few spheres are quickly checked for
intersections - or you may want to manually bound them, maybe together with
their moons.

Or, even better yet:

Instead of centering your universe on the sun, center it to the camera. And make
sure you use as few "moves" for your moons as possible: I'm not sure ATM how
bounding boxes react to being translated to millions of POV-Units away, only to
be pushed back again shortly after; I guess they're just modified, not re-built
from scratch.

To this end, you may need to set up your transformations first (using the
transform{} statement) - "stacking" all the translations and rotations into a
single transform{} variable per moon, and then apply them in one go.


Post a reply to this message

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