POV-Ray : Newsgroups : povray.advanced-users : Use Slope pattern for Planting distribution? : Re: Use Slope pattern for Planting distribution? Server Time
6 Oct 2024 13:36:38 EDT (-0400)
  Re: Use Slope pattern for Planting distribution?  
From: Tim Attwood
Date: 12 Dec 2006 16:44:21
Message: <457f22b5$1@news.povray.org>
>>   Some basic vector math knowledge could be of great help when designing
>> thing with POV-Ray... :P
>
> In my defence, I am relatively new and to me, a "vector" is a *direction*
> (which could be defined in various ways).  Yet what is returned is
> obviously three float values combined in what POV calls a "vector".
>
> Therefore, the normal vector could define a point 1 unit (or more?) away
> from the intersected point in the perpendicular direction, or could be 
> that
> point minus the intersected point.  So I suppose my real question is: How
> exactly does POV define its vectors?

In POV vectors are directions from the origin. This can be used to represent
a point <x,y,z> by the magnitude of the vector, or in some cases the 
magnitude
is ignored and the vector only represents a direction. For example, the 
normal
returned from the trace function represents the direction of the vector 
perpendicular
to the surface as a unit vector from the origin. (A unit vector has a length 
of 1 unit)
The vnormalize function returns a unit vector from a non-unit vector by 
changing the
vector length to one without changing the direction. Essentially, POV uses 
vectors
to represent points, because points ARE vectors, but uses unit vectors for 
directions.

To complicate matters a bit more, POV also uses vectors to define colors, so 
there
are options for two more vector components filter and transmit, making a 5D 
vector.
For clarity of use the dot x, dot y, and dot z accessors can be used as dot 
red,
dot green, and dot blue; so N.x = N.red, N.y = N.green, and N.z = N.blue.
The other 2 components can be accessed with dot filter, and dot transmit.

Addtionally you can use dot u and dot v for 2D vectors. So N.x = N.u, and
N.y = N.v. Also 4D vectors <x,y,z,t>, where N.t = N.filter.


Post a reply to this message

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