POV-Ray : Newsgroups : povray.text.scene-files : Moon in the daylight : Re: Moon in the daylight Server Time
28 Jul 2024 16:19:30 EDT (-0400)
  Re: Moon in the daylight  
From: Peter Popov
Date: 5 Nov 1999 17:11:31
Message: <whQjOEG+97dM=V7XVEDAAvS9wZEG@4ax.com>
On Thu, 4 Nov 1999 01:06:34 +0100, "Branimir Troshic" <tro### [at] pttyu>
wrote:

>It works. Thank you, Peter. Only problem is that I can not use gradient
>colors for sky, but, you can't get everything. A layers of fogs and clouds
>will fix it...
>
>Trole

Lo and behold, it worked :) I am no less surprised than you are


Here goes another shot in the dark (or more like daylight :) ). OK, so
your gradient sky problem is that the moon's plain color shows. Two
approaches come to mind:

1. Put the moon in a part of the sky where the latter's colour is
constant. And yeah, that's chickening out.

2. This one requires some heavy math. You'll need to know how the
gradient of the sky will look when perspective-mapped on the Moon with
respect to the viewpoint. Let me clarify a bit more on this:
  a) calclulate a ray from the camera to the lower edge of the moon
and see where it will intersect the sky. Of course, you will need to
use a sky sphere instead of a sky_sphere to do that :) Then use the y
coordinate of the intersection point to calculate the position in the
color_map and hence the color of the point in question
  b) do the same for the upper edge of the moon
  c) replace the solid color of the moon with a gradient

You can use the trace funtion of the SuperPatch or plain POV (but the
math is not easy). I think someone made an "evaluate pigment" patch
which could also be handy but again, it can be done with more trig
etc.

3. Another idea that just came to me is that you can give the Moon a
gradient pigment_map with a somewhat sharp transition from clear to
its normal color/image map, with the gradient vector pointing at the
Sun. Beware, though! The gradient pattern 'flips' at the origin, i.e.
changes direction.

I realise this post is somewhat late but I just found it in my outbox,
half-written and saved. And I opened the outbox by chance. Anyway, I
hope it helps in your endeavors.


Peter Popov
ICQ: 15002700


Post a reply to this message

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