POV-Ray : Newsgroups : povray.general : normal/slope question Server Time
7 Aug 2024 03:24:12 EDT (-0400)
  normal/slope question (Message 1 to 9 of 9)  
From: Simon Adameit
Subject: normal/slope question
Date: 19 Dec 2001 07:50:30
Message: <3c208d16@news.povray.org>
Hi, I want to get the directions of the normals of a surface to use them in
a pigment. I thought that I could use a combination of 3 slope patterns to
do that
but I don't know how to get the direction when I have 3 vectors and the
degrees in that it stands to them.


Post a reply to this message

From:
Subject: Re: normal/slope question
Date: 19 Dec 2001 09:11:20
Message: <jq712ugbg4104l5q1nus1g5gnri28cnt0h@4ax.com>
On Wed, 19 Dec 2001 13:46:11 +0100, "Simon Adameit" <gom### [at] gmxde> wrote:
>Hi, I want to get the directions of the normals of a surface to use them in
>a pigment. I thought that I could use a combination of 3 slope patterns to
>do that
>but I don't know how to get the direction when I have 3 vectors and the
>degrees in that it stands to them.

I'm not sure I understand slope pattern well but perhaps you expect something
like this ?

#version 3.5;
global_settings{
  assumed_gamma 1.0
  noise_generator 2
}
background{color rgb 1}
camera{
  orthographic
  location -2*z
  direction z
  right x*image_width/image_height
  up y
  sky y
  look_at z
}
light_source{
  <-30,30,-30>
  color rgb 1
}
sphere{
   0  .5
   normal{granite}
   pigment{
     average
     pigment_map{
       [3 slope x color_map{[0 rgb 0][1 red 3]}]
       [3 slope y color_map{[0 rgb 0][1 green 3]}]
       [3 slope z color_map{[0 rgb 0][1 blue 3]}]
     }
   }
 }

// ABX


Post a reply to this message

From: Simon Adameit
Subject: Re: normal/slope question
Date: 19 Dec 2001 09:18:11
Message: <3c20a1a3@news.povray.org>
> I'm not sure I understand slope pattern well but perhaps you expect
something
> like this ?
>
>    pigment{
>      average
>      pigment_map{
>        [3 slope x color_map{[0 rgb 0][1 red 1]}]
>        [3 slope y color_map{[0 rgb 0][1 green 1]}]
>        [3 slope z color_map{[0 rgb 0][1 blue 1]}]
>      }
>    }
>
> ABX
>
I have something like this but my question is how I can get the direction of
the normal from the colors I get from this pigment.


Post a reply to this message

From: bob h
Subject: Re: normal/slope question
Date: 19 Dec 2001 09:29:50
Message: <3c20a45e@news.povray.org>
"Simon Adameit" <gom### [at] gmxde> wrote in message
news:3c20a1a3@news.povray.org...
>
> I have something like this but my question is how I can get the direction
of
> the normal from the colors I get from this pigment.


Ah, well then you want to use trace().  It can get you the normal vector
which could then be used as color vector.  The example in the documentation
should be enough to go by.
--
text{ttf"timrom""bob h"0,0pigment{rgb 7}translate 7*z}


Post a reply to this message

From: Simon Adameit
Subject: Re: normal/slope question
Date: 19 Dec 2001 10:00:50
Message: <3c20aba2@news.povray.org>
> Ah, well then you want to use trace().  It can get you the normal vector
> which could then be used as color vector.  The example in the
documentation
> should be enough to go by.

I want to make a pigment that uses the direction of the normal at each point
of the surface, this is not possible with trace.


Post a reply to this message

From:
Subject: Re: normal/slope question
Date: 19 Dec 2001 10:15:49
Message: <dkb12uk7ta6f8lkr3b56on9b7qcbnf3po8@4ax.com>
On Wed, 19 Dec 2001 16:00:12 +0100, "Simon Adameit" <gom### [at] gmxde> wrote:
> I want to make a pigment that uses the direction of the normal at each point
> of the surface, this is not possible with trace.

If slope pattern is proportional to normal vie on Direction parameter then I
think

pigment{
     average
     pigment_map{
       [3 slope x color_map{[0 red   -3][1 red   3]}]
       [3 slope y color_map{[0 green -3][1 green 3]}]
       [3 slope z color_map{[0 blue  -3][1 blue  3]}]
     }
   }

returns direction of the normal. But if slope pattern is proportional to the
angle then I'm wrong.

ABX


Post a reply to this message

From: fabien
Subject: Re: normal/slope question
Date: 19 Dec 2001 10:16:53
Message: <3c20af65$1@news.povray.org>


> I want to make a pigment that uses the direction of the normal at each
point
> of the surface, this is not possible with trace.

Using your 3-slopes trick, you should be able to define a function,
and then use it as a pattern.  A pattern of a function of three patterns.

Fabien.


Post a reply to this message

From: Simon Adameit
Subject: Re: normal/slope question
Date: 19 Dec 2001 10:48:47
Message: <3c20b6df@news.povray.org>
>
> Using your 3-slopes trick, you should be able to define a function,
> and then use it as a pattern.  A pattern of a function of three patterns.
>
That's what I wanted to do :-)


Post a reply to this message

From: Simon Adameit
Subject: Re: normal/slope question
Date: 19 Dec 2001 10:48:48
Message: <3c20b6e0$1@news.povray.org>
> returns direction of the normal. But if slope pattern is proportional to
the
> angle then I'm wrong.
>
From reading the Docs I thought it is but I'm not sure.


Post a reply to this message

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