POV-Ray : Newsgroups : povray.newusers : Need help with POV-Ray !! : Re: Need help with POV-Ray !! Server Time
29 Jul 2024 02:25:06 EDT (-0400)
  Re: Need help with POV-Ray !!  
From: Kenneth
Date: 21 Sep 2007 03:45:01
Message: <web.46f375604683e64732a3ba970@news.povray.org>
"k1s3k1" <k1s### [at] gmailcom> wrote:


>
> Thanks, but i dont understand at all -_-
>
> I dont know how to start using trace.. is there a template of the code that
> i can modify or something?

TRACE *can* be a bit mysterious for a new user.  (And we were ALL new users
at one time, so don't worry!) Once you understand it, it will seem simple.
Really!

In its simplest form, the trace function *gives* you a value, just a single
value, a *point* that it finds for you on a surface (your mountains, in
this case.) You need to plug three "things" into the trace function for it
to work:
1) Your object-to-trace.
2) a point in space that the single imaginary trace "ray" comes from--a
vector. For example, <.5,100,.5>. That would put it above and centered over
a 1X1 heightfield. A good place to start!
3) the direction of that trace ray--toward your object, of course--which is
another "vector," but it's really a DIRECTION--like <0,-1,0>, which means
"pointing in -y", or straight down. That's the easiest direction to
understand, until you get a feel for how trace works. But make sure that #2
and #3 together WILL point the trace ray somewhere at your mountains!!

To use trace at all, you need to #declare it with a name:

#declare my_point  = trace(mountain_object, <.5,100,.5>, <0,1,0>);  Don't
forget the semi-colon!

That actually starts the tracing operation!  Very simple. And my_point now
contains the value--a vector--that is the point on your mountains that the
trace "ray" hit. You use that vector to place another object there.  For
example,
object{bush_object translate my_point}

But to really use trace to its fullest, you'll need to learn about #while
loops and random numbers  (seed and rand), so that you can trace your
mountains hundreds of times, to put LOTS of bushes on it.

Have fun!

Ken W.


Post a reply to this message

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