POV-Ray : Newsgroups : povray.programming : Slope dependent textures : Re: Slope dependent textures Server Time
29 Jul 2024 08:15:05 EDT (-0400)
  Re: Slope dependent textures  
From: Hans-Detlev Fink
Date: 6 Apr 1998 19:16:44
Message: <3529625B.E946B266@pecos.n.o-s.p.a.m.de>
Ronald L. Parker wrote:

> On Mon, 06 Apr 1998 18:14:23 +0200, Hans-Detlev Fink
> <hdf### [at] pecosno-spamde> wrote:
>
> >If you want to give it a try: the patch is available
> >at ftp://user.pecos.de/pub/povray. It contains a readme
> >and two patch files (in unified diff format). One is for
> >plain POV 3.02 source, the other one is for 3.02 source that
> >contains R. Suzuki's iso-surface patch (beta-18).
>
> Very nice.  Mind if I add it to my superpatch?  I'll give proper
> credit when I finally make the superpatch available.
>

Fine.  Please contact me before final release of yourpatch. Just in case
I have some bugfixes to contribute.
I would be really happy if as many people as possible
tested the patch. I suspect I was far from all those
'pathological' scenes in my tests.

> Also, in your Readme file, I see:
>
> >  Example: slope y
> >This is what everyone associates with slopes in
> >landscapes. For all surface elements that are horizontal
> >slope returns 1.0. All vertical parts return 0.5 and all
> >'anti-horizontal' surfaces (pointing downwards) return
> >0.0.
>
> Doesn't a slope of 1.0 correspond to a "vertical" surface, while 0.5
> corresponds to "horizontal?"

No.  Well, depends on vertical with respect to what. You are
right if you mean a surface that is perpendicular to y.
I meant vertical in the everday way, ie a surface that is parallel
to y (like a wall etc.).
For this definition of vertical surfaces the surface normal is
in the x-z-plane and thus perpendicular to y. The 'dot' product
of the surface normal and y is therefore 0, which is eventually
translated to 0.5. Similarly a horizontal surface's normal points
in y direction. The product is 1.0, which is translated to 1.0.
Anti-horizontal yields a product of -1.0 which is transformed
to 0.0. (Have a look at slope() at the end of pattern.c.)

I was not sure whether or not I should map the values this way.
Originally I began with 1.0 for horizontal and 0.0 for vertical, all
'negative' surfaces were mapped to 0.0.  At the end I felt that
this was an unnecessary restriction (imagine rocks or asteroids
whose lower surface shall have a specific texture). So I did it
as I did. (A more intuitive way would be a mapping between
-1.0 and +1.0, but that would break the general structure of
maps in povray.)

Cheers

-Hans-


Post a reply to this message

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