POV-Ray : Newsgroups : povray.unofficial.patches : I don't understand the slope pattern Server Time
1 Sep 2024 16:19:02 EDT (-0400)
  I don't understand the slope pattern (Message 11 to 20 of 25)  
<<< Previous 10 Messages Goto Latest 10 Messages Next 5 Messages >>>
From: Tony[B]
Subject: Re: I don't understand the slope pattern
Date: 1 May 2001 13:35:54
Message: <3aeef3fa@news.povray.org>
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... :)


Post a reply to this message

From: Rune
Subject: Re: I don't understand the slope pattern
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

From: Warp
Subject: Re: I don't understand the slope pattern
Date: 2 May 2001 08:46:12
Message: <3af00193@news.povray.org>
Tom Melly <tom### [at] tomandlucouk> wrote:
: Shouldn't that be:

:  heighfield
:  { whatever
:    texture { whatever scale <1, 1/2, 1>}
:    scale <1, 2, 1>
:  }

  No. The idea was that the heighfield should be scaled in widht and length
to the appropriate size before texturing (so that the texture would not be
distorted or anything), but the height should be 1 because of the used slope
pattern.
  My suggestion was to first set the width and length of the heightfield to
whatever they should be but leave the height to 1, then texture it and then
set the height to what it should be.

-- 
#local D=array[6]{11117333955,7382340,3358,3900569407,970,4254934330}
#local I=0;#macro M()<mod(D[I],13)-6,mod(div(D[I],13),8)-3,10>#end
blob{#while(I<6)cylinder{M()#local D[I]=div(D[I],104);M().5,2
pigment{rgb M()}}#local I=(D[I]>99?I:I+1);#end}               /*- Warp -*/


Post a reply to this message

From: Chris Huff
Subject: Re: I don't understand the slope pattern
Date: 2 May 2001 09:02:34
Message: <chrishuff-9A11E6.08000702052001@news.povray.org>
In article <3af00193@news.povray.org>, Warp <war### [at] tagpovrayorg> 
wrote:

>   No. The idea was that the heighfield should be scaled in widht and 
> length to the appropriate size before texturing (so that the texture 
> would not be distorted or anything), but the height should be 1 
> because of the used slope pattern.

But when you scaled the height field to it's proper height, the textures 
would still be stretched along the y axis.
BTW, you need to do the "scale <1, 1/2, 1>" or "transform {Trans 
inverse}" in the textures in the texture_map being controlled with the 
slope pattern, not in the slope-mapped texture itself...just thought 
that needed to be clarified.

-- 
Christopher James Huff
Personal: chr### [at] maccom, http://homepage.mac.com/chrishuff/
TAG: chr### [at] tagpovrayorg, http://tag.povray.org/

<><


Post a reply to this message

From: Tom Melly
Subject: Re: I don't understand the slope pattern
Date: 2 May 2001 09:37:39
Message: <3af00da3$1@news.povray.org>
"Chris Huff" <chr### [at] maccom> wrote in message
news:chrishuff-9A11E6.08000702052001@news.povray.org...
>
> But when you scaled the height field to it's proper height, the textures
> would still be stretched along the y axis.

That's what I thought. Warp, can you confirm, or have I/we missed something?

> BTW, you need to do the "scale <1, 1/2, 1>" or "transform {Trans
> inverse}" in the textures in the texture_map being controlled with the
> slope pattern, not in the slope-mapped texture itself...just thought
> that needed to be clarified.

Sounds right - definately one to suck and see - at least for the
mathematically and spatially challenged.


Post a reply to this message

From: Rune
Subject: Re: I don't understand the slope pattern
Date: 2 May 2001 10:45:23
Message: <3af01d83$1@news.povray.org>
But the slope pattern does indeed work with heightfields that are more than
1 unit high, so all this scaling trouble is rather pointless isn't it?

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

From: Tom Melly
Subject: Re: I don't understand the slope pattern
Date: 2 May 2001 11:11:17
Message: <3af02395$1@news.povray.org>
"Rune" <run### [at] inamecom> wrote in message
news:3af01d83$1@news.povray.org...
> But the slope pattern does indeed work with heightfields that are more
than
> 1 unit high, so all this scaling trouble is rather pointless isn't it?
>

<very small voice>yes, mr rune</very small voice>


Post a reply to this message

From: Warp
Subject: Re: I don't understand the slope pattern
Date: 2 May 2001 12:15:51
Message: <3af032b7@news.povray.org>
Tom Melly <tom### [at] tomandlucouk> wrote:
:> But when you scaled the height field to it's proper height, the textures
:> would still be stretched along the y axis.

: That's what I thought. Warp, can you confirm, or have I/we missed something?

  It depends on how you use the slope pattern, but yes, in many cases this
can happen.

-- 
#local D=array[6]{11117333955,7382340,3358,3900569407,970,4254934330}
#local I=0;#macro M()<mod(D[I],13)-6,mod(div(D[I],13),8)-3,10>#end
blob{#while(I<6)cylinder{M()#local D[I]=div(D[I],104);M().5,2
pigment{rgb M()}}#local I=(D[I]>99?I:I+1);#end}               /*- Warp -*/


Post a reply to this message

From: Rune
Subject: Re: I don't understand the slope pattern
Date: 2 May 2001 16:13:45
Message: <3af06a79@news.povray.org>
"Tom Melly" wrote:
> "Rune" wrote:
> > But the slope pattern does indeed work with
> > heightfields that are more than 1 unit high,
> > so all this scaling trouble is rather
> > pointless isn't it?
>
> <very small voice>yes, mr rune</very small voice>

Hehe, I can understand that you want to have things cleared out, I just
wanted to make sure you knew it wasn't a real problem. :)

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

From: Tony[B]
Subject: Re: I don't understand the slope pattern
Date: 2 May 2001 17:58:56
Message: <3af08320@news.povray.org>
Thanks for your help Rune! I think I mostly understand it now. This
definitely has to get into 3.5 to help those POVers who are stuck like me...
Anybody have the address for the POV-Team?


Post a reply to this message

<<< Previous 10 Messages Goto Latest 10 Messages Next 5 Messages >>>

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