POV-Ray : Newsgroups : povray.unofficial.patches : I don't understand the slope pattern : Re: I don't understand the slope pattern Server Time
1 Sep 2024 18:16:39 EDT (-0400)
  Re: I don't understand the slope pattern  
From: Rune
Date: 1 May 2001 17:15:48
Message: <3aef2784@news.povray.org>
"Tony[B]" wrote:
> Thanks a lot Rune!
> If you can finish this maybe you can send it to the
> right people to include it in the mythical 3.5... :)

It took me only about 10 minutes to write, so I'm rather surprised you find
it that good... :)

Anyway, here's the next chapter.

slope <x,y,z>, <x,y,z>, <u,v>, <u,v>
         A        B       C      D

B is a 3D vector controlling the direction of a special gradient. You know
the pattern gradient y will increase the pattern values along the y axis.
Well, the B vector in the slope pattern will increase the pattern values
along the B vector. The B vector can be any vector.

C was used to specify which range of values should be used for A. Similar, D
is used to specify the range of values for B. The u part of the D is the
lo-altitude and the v part is the hi-altitude. Let's say you set B to y, so
the pattern value increases along the y axis. Say you have a heightfield
that is one unit high so the bottom is at y=0 and the top is at y=1. In that
case you should set D to be <0,1>. But if your heightfield is bigger so it
for example goes from y=-1.1 to y=3.5, then you should set D to <-1.1, 3.5>.

So far we have looked at how A+C work (the slope) and at how B+D work (the
altitude). But how does it all work together? Well, the pattern value for a
given point is a weighted average of the slope and the altitude. The weights
are the lengths of the vectors A and B. If vector A is much longer than
vector B it means that the slope has greater effect on the results than the
altitude. If on the other hand vector B is longer, it means that the
altitude has more effect on the result.

That's all for now. Hope that was clear too. I intent to write more and to
improve what I've already written, but that'll require quite a bit more of
time and planning.

Rune
--
\ Include files, tutorials, 3D images, raytracing jokes,
/ The POV Desktop Theme, and The POV-Ray Logo Contest can
\ all be found at http://rsj.mobilixnet.dk (updated March 29)
/ Also visit http://www.povrayusers.org


Post a reply to this message

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