POV-Ray : Newsgroups : povray.unofficial.patches : I don't understand the slope pattern Server Time
1 Nov 2024 05:22:10 EDT (-0400)
  I don't understand the slope pattern (Message 1 to 10 of 25)  
Goto Latest 10 Messages Next 10 Messages >>>
From: Tony[B]
Subject: I don't understand the slope pattern
Date: 28 Apr 2001 14:14:52
Message: <3aeb089c@news.povray.org>
Can someone please explain this to me in simpler terms than those used in
the MegaPOV docs? I've been struggling to get this thing to work on
heightfields higher than 1 unit (in my case a heightfield 3.28 units high,
which will be changed later). Specifically the one with syntax: slope,
<x,y,z>,<x,y,z>,<u,v>,<u,v>. An example is greatly appreciated. TIA

--
Anthony Bennett


Post a reply to this message

From: Tom Melly
Subject: Re: I don't understand the slope pattern
Date: 30 Apr 2001 05:45:21
Message: <3aed3431@news.povray.org>
"Tony[B]" <ben### [at] catholicorg> wrote in message
news:3aeb089c@news.povray.org...
> Can someone please explain this to me in simpler terms than those used in
> the MegaPOV docs? I've been struggling to get this thing to work on
> heightfields higher than 1 unit (in my case a heightfield 3.28 units high,
> which will be changed later). Specifically the one with syntax: slope,
> <x,y,z>,<x,y,z>,<u,v>,<u,v>. An example is greatly appreciated. TIA
>

I may well be wrong here, but I've always assumed that slope (apart from the
simple "slope <slope>"usage) requires the hf to be only 1 unit high max.


Post a reply to this message

From: Tony[B]
Subject: Re: I don't understand the slope pattern
Date: 30 Apr 2001 09:48:33
Message: <3aed6d31@news.povray.org>
I was afraid of that...


Post a reply to this message

From: Warp
Subject: Re: I don't understand the slope pattern
Date: 1 May 2001 07:18:12
Message: <3aee9b74@news.povray.org>
Tony[B] <ben### [at] catholicorg> wrote:
: I was afraid of that...

  Texture first, scale then. What's the problem?

-- 
#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
#while(I<6)cylinder{M()#local D[I]=div(D[I],104);M().1
pigment{rgb M()}}#local I=(D[I]>99?I:I+1);#end              /*- Warp -*/


Post a reply to this message

From: Tom Melly
Subject: Re: I don't understand the slope pattern
Date: 1 May 2001 07:28:51
Message: <3aee9df3@news.povray.org>
"Warp" <war### [at] tagpovrayorg> wrote in message
news:3aee9b74@news.povray.org...
> Tony[B] <ben### [at] catholicorg> wrote:
> : I was afraid of that...
>
>   Texture first, scale then. What's the problem?

Perhaps his texture is distorted when scaled. Of course, he could scale his
texture inversely to account for this.


Post a reply to this message

From: Warp
Subject: Re: I don't understand the slope pattern
Date: 1 May 2001 07:53:34
Message: <3aeea3be@news.povray.org>
Tom Melly <tom### [at] tomandlucouk> wrote:
: Perhaps his texture is distorted when scaled.

  Well, he can do this:

heighfield
{ whatever
  scale <10, 1, 20>
  texture { whatever }
  scale <1, 2, 1>
}

-- 
#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
#while(I<6)cylinder{M()#local D[I]=div(D[I],104);M().1
pigment{rgb M()}}#local I=(D[I]>99?I:I+1);#end              /*- Warp -*/


Post a reply to this message

From: Tom Melly
Subject: Re: I don't understand the slope pattern
Date: 1 May 2001 08:25:47
Message: <3aeeab4b$1@news.povray.org>
"Warp" <war### [at] tagpovrayorg> wrote in message
news:3aeea3be@news.povray.org...
>
> heighfield
> { whatever
>   scale <10, 1, 20>
>   texture { whatever }
>   scale <1, 2, 1>
> }
>

Shouldn't that be:

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

?


Post a reply to this message

From: Chris Huff
Subject: Re: I don't understand the slope pattern
Date: 1 May 2001 09:09:56
Message: <chrishuff-1590B8.08072801052001@news.povray.org>
In article <3aeeab4b$1@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>
>  }


#declare HFTrans = transform {...}
heighfield { whatever
    texture {whatever transform {HFTrans inverse}}
    transform {HFTrans inverse}
}

;-)

-- 
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: Rune
Subject: Re: I don't understand the slope pattern
Date: 1 May 2001 11:22:28
Message: <3aeed4b4@news.povray.org>
"Tony[B]" wrote:
> Can someone please explain this to me in simpler
> terms than those used in the MegaPOV docs? I've
> been struggling to get this thing to work on
> heightfields higher than 1 unit (in my case a
> heightfield 3.28 units high, which will be
> changed later). Specifically the one with syntax:
> slope, <x,y,z>,<x,y,z>,<u,v>,<u,v>. An example is
> greatly appreciated. TIA

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

You have four vectors. Let's call them vector A, B, C and D. A and B are 3D
vectors. C and D look like 2D vectors in their syntax, but in fact they have
nothing to do with vectors.

A is a 3D vector controlling the which direction the slope pattern is based
on. As I'm sure you understand that one, I won't go into details.

C is used to give you better control over A. If you're using a heightfield
and A is set to be y you are not having any surfaces that are anti-parallel
to A (-y). Actually, even the most steep surfaces of the HF would be
perpendicular to the slope vector at most. That means the pattern only will
return values from 0.5 (perpendicular) to 1.0 (parallel). The part of your
color_map that uses values from 0.0 to 0.5 is sort of wasted, since it's
never used.

You can use C to specify that only a certain range of slopes are used. The u
part in C sets the lo-slope and the v part sets the hi-slope. For example,
if you set C to be <0.5,1.0> it means that the pattern value goes from 0
when the slope is perpendicular to A, to 1 when the slope is parallel to A.
That means that your entire color_map is used, even though only a certain
range of slopes are used.

Let me know if it's clear so far!

To be continued...

In the next message I'll try to explain how to use the slope pattern with
heightfields higher than 1 unit! But maybe someone will beat me to 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: Christoph Hormann
Subject: Re: I don't understand the slope pattern
Date: 1 May 2001 11:51:38
Message: <3AEEDBAE.C1F5024D@gmx.de>
Rune wrote:
> 
> slope, <x,y,z>,<x,y,z>,<u,v>,<u,v>
>           A       B      C     D
> 
> [...]

That looks really good and understandable, just add some illustrating
pictures (and of course something on B and D) and you have an excellent
slope pattern tutorial.

Christoph

-- 
Christoph Hormann <chr### [at] gmxde>
IsoWood include, radiosity tutorial, TransSkin and other 
things on: http://www.schunter.etc.tu-bs.de/~chris/


Post a reply to this message

Goto Latest 10 Messages Next 10 Messages >>>

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