POV-Ray : Newsgroups : povray.programming : Re: vectors Server Time
22 Dec 2024 17:49:19 EST (-0500)
  Re: vectors (Message 1 to 9 of 9)  
From: Thorsten Froehlich
Subject: Re: vectors
Date: 31 Jan 2004 10:02:35
Message: <401bc38b$1@news.povray.org>
In article <401bb2fb@news.povray.org> , "Mathieu" <mat### [at] wanadoofr> 
wrote:

> Well, I'am focusing on the illuminations models implemented in lighting.cpp
> but I have few doubts about the vectors directions that povray uses to
> descibe the eye point of view, the light_ray, Reye and so on... I join you
> my "point of view" widely inspired from my short renderman description
> language knowing. Could you tell me where am I right or wrong , and if there
> exists a file in source code which described that vectors.

Please do not post binary attachments in non-binary groups.

Regarding your question, I would suggest to take a look at the books listed
in the documentation rather than the source code.  They do provide an
explanation, which is probably more useful than just an implementation.

    Thorsten

____________________________________________________
Thorsten Froehlich, Duisburg, Germany
e-mail: tho### [at] trfde

Visit POV-Ray on the web: http://mac.povray.org


Post a reply to this message

From: Mathieu
Subject: Re: vectors
Date: 31 Jan 2004 10:52:49
Message: <401bcf51@news.povray.org>
Ok for the pic, but please where is this listing of  books  (I have not
found it in the pov documentation). My goal is just to know  what vector's
names povray uses to consider (for examples): incident light, the traject
from point of view to surface point...it's not difficult, but if nobody tell
me what is exactly behind that names, how could I guess ?
To sum-up I supose that :
-Eye is the vector which travels from camera point of view to evaluated
point.
-*Light_Source_Ray.direction is the vector which travels from evaluated
point to light position.
-REye ?

Mathieu


Post a reply to this message

From: Christoph Hormann
Subject: Re: vectors
Date: 31 Jan 2004 11:16:03
Message: <0c0te1-bgr.ln1@triton.imagico.de>
Mathieu wrote:
> Ok for the pic, but please where is this listing of  books  (I have not
> found it in the pov documentation).

http://www.povray.org/documentation/view/304/

> My goal is just to know  what vector's
> names povray uses to consider (for examples): incident light, the traject
> from point of view to surface point...it's not difficult, but if nobody tell
> me what is exactly behind that names, how could I guess ?
> To sum-up I supose that :
> -Eye is the vector which travels from camera point of view to evaluated
> point.
> -*Light_Source_Ray.direction is the vector which travels from evaluated
> point to light position.
> -REye ?

You should tell which position in the source code exactly you are 
referring to.  Most vectors in the lighting calculation are normalized 
so they only indicate a direction.

Christoph

-- 
POV-Ray tutorials, include files, Sim-POV,
HCR-Edit and more: http://www.tu-bs.de/~y0013390/
Last updated 11 Jan. 2004 _____./\/^>_*_<^\/\.______


Post a reply to this message

From: Mathieu
Subject: Re: vectors
Date: 31 Jan 2004 14:12:59
Message: <401bfe3b@news.povray.org>
I'am referring to the vectors used by the do_diffuse and do_specular

void do_diffuse (FINISH *Finish, RAY *Light_Source_Ray,VECTOR Layer_Normal,
COLOUR Colour, COLOUR Light_Colour, COLOUR Layer_Pigment_Colour, DBL
Attenuation);

void do_specular (FINISH *Finish, RAY *Light_Source_Ray, VECTOR REye, VECTOR
Layer_Normal, COLOUR Colour, COLOUR Light_Colour, COLOUR
Layer_Pigment_Colour);

And what about REye is it the vector opposite to Eye (from current surface
point of view) ?
Are they all normalized ? (in fact it will be a great advantage for thing I
am going to do :o))

Thanks for all.

Mathieu


Post a reply to this message

From: Christopher James Huff
Subject: Re: vectors
Date: 31 Jan 2004 17:57:38
Message: <cjameshuff-B520BB.17574131012004@news.povray.org>
In article <401bfe3b@news.povray.org>, "Mathieu" <mat### [at] wanadoofr> 
wrote:

> I'am referring to the vectors used by the do_diffuse and do_specular
> 
> void do_diffuse (FINISH *Finish, RAY *Light_Source_Ray,VECTOR Layer_Normal,
> COLOUR Colour, COLOUR Light_Colour, COLOUR Layer_Pigment_Colour, DBL
> Attenuation);

Finish is the texture finish, Light_Source_Ray is the ray from the 
surface point to the light source, Layer_Normal is the surface normal 
perturbed by this texture layer, Colour is the color result, 
Light_Colour is the light color, Layer_Pigment_Color is the color of the 
pigment of the current layer at that point (blame the original authors 
for the misspelling of color ;-), Attenuation is the attenuation. These 
are all pretty simple to figure out, by their names and by what they're 
used for.


> void do_specular (FINISH *Finish, RAY *Light_Source_Ray, VECTOR REye, VECTOR
> Layer_Normal, COLOUR Colour, COLOUR Light_Colour, COLOUR
> Layer_Pigment_Colour);
> 
> And what about REye is it the vector opposite to Eye (from current surface
> point of view) ?

As computed in Diffuse(), it's a reversed version of Eye->Direction, Eye 
being the incoming ray.


> Are they all normalized ? (in fact it will be a great advantage for thing I
> am going to do :o))

If you want to know if it's normalized, check and see if it is.

-- 
Christopher James Huff <cja### [at] earthlinknet>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: <chr### [at] tagpovrayorg>
http://tag.povray.org/


Post a reply to this message

From: Ken
Subject: Re: vectors
Date: 31 Jan 2004 18:08:33
Message: <401C35AF.93C7B844@pacbell.net>
Christopher James Huff wrote:

> (blame the original authors for the misspelling of color ;-),

http://news.povray.org/povray.general/510/

-- 
Ken Tyler


Post a reply to this message

From: Mathieu
Subject: Re: vectors
Date: 1 Feb 2004 13:05:58
Message: <401d4006@news.povray.org>
Thanks to all,  I have no more doubts with that vectors :o)
But I have a small question . To compute diffuse lighting povray uses
lambertian reflection of light on surfaces, to simplify it just computes
the dot product between the incoming light  and the normal_layer, with
normalized vectors it  returns the cos of the angle bewteen that 2 vectors.
But why using fabs(Cos_Angle_of_Incidence)  ? If Cos_Angle_of_Incidence is
negative it seems that the geometric angle between normal and incoming light
is greater than pi/2. I understand that computing negative intensity isn't a
good choice :o) but why removed it by fabs(Cos_Angle_of_Incidence), this
value isn't more  linked to the 'real' angle between normal and incoming
light.

Mathieu


Post a reply to this message

From: Warp
Subject: Re: vectors
Date: 1 Feb 2004 13:11:31
Message: <401d4153@news.povray.org>
The lighting of a surface must be correct with regard to the light
source regardless of which way the surface normal points at. The normal
can in some cases point to the other side of the surface (without it
being wrong in any way). The simplest example is putting the camera
and a light source inside a sphere.

-- 
plane{-x+y,-1pigment{bozo color_map{[0rgb x][1rgb x+y]}turbulence 1}}
sphere{0,2pigment{rgbt 1}interior{media{emission 1density{spherical
density_map{[0rgb 0][.5rgb<1,.5>][1rgb 1]}turbulence.9}}}scale
<1,1,3>hollow}text{ttf"timrom""Warp".1,0translate<-1,-.1,2>}//  - Warp -


Post a reply to this message

From: Mathieu
Subject: Re: vectors
Date: 1 Feb 2004 14:56:04
Message: <401d59d4@news.povray.org>
Ok it works as  normal_layer reversal ( in the case it's accurate). Thanks.

Mathieu


Post a reply to this message

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