POV-Ray : Newsgroups : povray.newusers : shadows/sunlight : Re: shadows/sunlight Server Time
30 Jun 2022 12:15:15 EDT (-0400)
  Re: shadows/sunlight  
From: Bald Eagle
Date: 5 Dec 2020 16:55:00
Message: <web.5fcc018160c1d92e1f9dae300@news.povray.org>
"Julia" <nomail@nomail> wrote:
> Hi,
> there is another problem that i have been trying to figure out for the past
> week, but i'm just starting to give up.

Well don't do that - because once you make it past the first few hurdles, you
will see that it was worth it!  :)

If you are new, then it's important to learn how to see exactly what is
happening in your scenes, how to experiment with parts of the scene to see if
they cause/fix any problems, and how to write your code to make all of that a
lot easier on yourself and anyone who's trying to assist you.

Try and keep all of the parts of your scene well organized, and easy to edit.
You have some large objects with a lot of code associated with them.
And as pointed out, some of them may be causing your problems.

Rather than write everything in large blocks of code all at once, build your
objects, and your scene, in smaller bits that can be progressively added
together - it will be cleaner, easier to follow, and easier to modify as you go
through the process.

You will, of course, develop and adopt coding practices that are uniquely your
own, but I have a few suggestions that will help you at the beginning.

Rather than write out the whole scene at once, start writing it piece by piece
in a new file.

I would suggest starting off with a simple "space" that has a camera, light
source, a (temporary) ground plane, and some lines that show you the axes.
This will give you a "blank" scene that allows you to follow things around and
give you a sense of scale.

Now you can add things one at a time.

Rather than make a planet, make _pieces_ of the planet.

So:
#declare Clock = clock;
#declare Origin = <0, 0, 0>;
#declare Earth_radius = 0.5;
#declare Earth_distance = 5;
#declare Tex_Earth = texture {pigment {agate} {finish {specular 0.2}}

Then assemble them:

#declare Earth =
sphere {
 Origin, Earth_radius texture {Tex_Earth}
 translate x * Earth_distance
 rotate -y * 360 * Clock
}

This gives things names, meaning, and lets you find WHERE you want to change a
value, once - rather than hunting down every instance.

I define Clock (capitalized) as a "meta-clock" because I find it makes my life
easier when doing animations.   #declare Clock = clock * 0.1;  can slow things
down that may be going WAY too quickly to judge and debug.

You might also think about defining your units in terms of multiples of "POV
units" so that you can play around with distances and scales very easily and
quickly.

So,
#declare M = 1; // a multiplier
#declare kilometer = 1000 * M;   // 1000 POV-units times M

Then you can "shrink" your scene by making M less than 1.

Now you can play with your Earth and make it spin and rotate, and you will only
have ONE object in your scene to focus on which might cause any problems.

And then you can add your moon.

And then you can add your sun.

do that at the end of the file like this:

object {Earth}
object {Moon}
object {Sun}

Then you can comment out ONE LINE, and leave all of the previous code untouched.

I would keep your sizes small and your textures extremely simple, so that you
can see what's going on, and the patterned spheres will allow you to see the
rotation.

One final note:
If you are going to use the looks_like modifier for the Sun, put a "working"
light at the origin with the shadowless keyword, so that it never gets blotted
out.

Then you can work on your actual Sun definition and the rest of the scene will
be lit and visible.  Then just comment out the working light when you have it
all working like you want.


Post a reply to this message

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