POV-Ray : Newsgroups : povray.binaries.images : ExplainationPlease...?? Server Time
16 Aug 2024 18:22:44 EDT (-0400)
  ExplainationPlease...?? (Message 11 to 20 of 27)  
<<< Previous 10 Messages Goto Latest 10 Messages Next 7 Messages >>>
From: Ryan Mooney
Subject: Re: ExplainationPlease...??
Date: 24 Jan 2002 14:03:21
Message: <3C505A77.AFC01BA5@earthlink.net>
I would not seeing all if any links you have of all the info you found of any
use...
especially the two tutorial pages and the use of pov with vector,dot,cross...
Or anything else mathematically confusing to me right now... =]

Hugo wrote:

> > Yep. But maybe he wants to know more than just the few functions
> implemented
> > POVRay. Maybe some more on vector algebra?
> > I think it is more important to understand the vector algebra first before
> > looking at the implementation.
> >
> > But anyway, the functions are at least a base for a discussion. Let's see
> if
> > I can write a short AND understandable explanation
>
> Could you please tell about vector cross & dot products too, then?  :o)
> I've read the Pov docs, and 2 webpages explaining their use in Pov, and I've
> searched on math pages, but still don't understand.. I don't have a higher
> mathematical education and until recently I didn't know how important the
> origin <0,0,0> is regarding to vector functions.. Now I do know that
> everything involves origin, but I still can't SEE in my mind the picture of
> cross & dots.. The examples in Pov with 3 cylinders pointing in each their
> way, doesn't help.. I tried animating them too but..
>
> You could argue that I should take a further education, but I don't have
> time for this (I have work, and would have to change my life drastically)
> and I'd prefer to learn in my sparetime.. Any clear and throughfull
> explanation in simple english will be appriciated!  :o)  When you have
> time..
>
> Regards,
> Hugo


Post a reply to this message

From: Fernando González del Cueto
Subject: Re: ExplainationPlease...??
Date: 24 Jan 2002 14:20:02
Message: <3c505e62@news.povray.org>
"Ryan Mooney" <rdm### [at] earthlinknet> wrote in message
news:3C50598E.2F85ED4F@earthlink.net...
> This is basically what i am looking for... Thank you... =]
> I'm glad that someone mentioned the rest of the functions for i am only
just
> beginning to understand the vrotate and they are all equally as confusing
as
> the next...

I didn't know if I had made myself clear... I'm glad it was useful to you.

Good luck in your voyages inside R^3

Fernando.


Post a reply to this message

From: Bill DeWitt
Subject: Re: ExplainationPlease...??
Date: 24 Jan 2002 14:36:37
Message: <3c506245$1@news.povray.org>
"Mike Williams" <mik### [at] nospamplease> wrote in message
news:r+A9A### [at] econymdemoncouk...
> Wasn't it Bill DeWitt who wrote:
> >
> >"Hugo" <hua### [at] post3teledk> wrote :
> >>
> >> Could you please tell about vector cross & dot products too, then?  :o)
> >
> >    I finally got what dot products were about a year ago. I don't know
how
> >ignorant of them you are, but I had no clue. Here's what I finally
figured
> >out.
> >
> >    If you have a vector #declare v = <1,2,3>;
> >    Then v.x = 1, v.y = 2, v.z = 3.
>
> I guess that's a joke, but just in case your serious, the POV dot
> operator (which is what you have there)

    No joke, unless you count my State supplied education in math. I did
mean dot operator, which is what stopped me from understanding most of the
vector stuff I wanted to know. What this shows is how much I used them
afterwards, that I didn't remember the term.

    Most of the people here cannot imagine how ignorant of math us non-math
types can be. Someone just posted an explanation of those terms that I was
completely unable to follow. It makes assumptions of knowledge that I just
don't have. I am sure it is clear to someone, but not me. I may never
understand vector math if I have to start at that level.

    I'll stick to arithmetic (at most) advice from now on.


Post a reply to this message

From:
Subject: Re: ExplainationPlease...??
Date: 24 Jan 2002 15:07:10
Message: <3c50696e@news.povray.org>
Hi there,

The answer of Fernando is (of course) completely right. On the other hand I
want to try to give a less mathematical but more "visual" explanation.
Unfortunately I don't have the time right now to trace some pictures for
explanation (and additionally my english language isn't sufficient) but I
will give it a try.
If I start with a too low level, please read it over. I don't know where to
start with the explanation so I start at the very beginning, ok?

*) Vector
As you know, a vector is defined as a set of numbers. Depending on the
dimension we want to work these would be X and Y for two dimensions or X, Y
and Z for three. You may create vectors for any dimension but since we are
talking about POVRay let's start with three.
The notation <X,Y,Z> of a vector might be misleading since every time you
see a vector visualised it is drawn as an arrow. As we know, has as arrow a
starting node and en ending node. But we have only one set of coordinates
<X,Y,Z>!
So where is the other end?
The answer is easy. A vector starts at the origin of the coordinate system
which is <0,0,0> (mostly ;-) )

Now you might say that you have already seen some vectors in mathematical
graphs which did obviously NOT start from the origin. You are right and you
are not. These diagrams are a bit misleading since they skip some
information to be "cleaner". Any vector which does NOT start from the origin
is originally only a part of a vector transformation (e.g. two vectors in a
chain). (I will continue on that in the next section). Transformations on
vectors do some mathematical operations with their coordinates. These
formulas might be proven by mathematicians (is that spelled correctly?) or
other freaks. In this text I don't want to use any formula. Just imagine
that this set of functions is well defined like the algorithmic of "1+1=2".

*) Length
The length of a vector can easily be computed. In two dimensions this would
be the legendary formula of pythagoras. The same thing, but just one
coordinate more for three dimensions. Graphically it is simply the length of
our arrow, measured ALONG the vector (not projected).

*) Translation
One of the easiest transformations is the translation. Translating a vector
has nothing to do with language ;-) but is just shifting the coordinates.
That means, that each coordinate of the end point of the vector gets some
number added or subtracted (remember: the starting point stays in the
origin). If we add or subtract two vectors we just add/subtract their
coordinates (X to X, Y to Y and  Z to Z).
Now you might ask: "If I translate a vertical cylinder by <1,0,0> it moves
to the right but is still vertical. How can that be if the starting point
stays in the origin?"
The answer is: The cylinder isn't the vector itself. Imagine the cylinder as
a set of <end nodes> of many, many vectors. From all these vectors you see
just the tip. And translating the cylinder is in fact translating ALL these
vectors. So all the vectors move in the same way. No wonder that they
preserve their shape!
So whenever you see a vector NOT starting in the origin it is due to
following reason:

The vector is graphically moved for better clearance. These vectors still
start at the origin but they got graphically moved to show their relation to
other vectors. Most times it would be very confusing if all vectors are
drawn from the origin. You would get a big bundle of arrows, all starting at
the same point, pointing into various directions. It is much easier do draw
if we move the vector's graph to a place where it's relationship is more
obvious. (e.g. to show a vector added to another. This situation is often
shown as a triangle (the two vectors to be added and a third one showing the
result), although ALL vectors should start at 0/0/0).

*) Multiplication
If we multiply a vector with a number (a so-called scalar) we just multiply
all coordinates with this number. This results in a longer vector which
still has the same "orientation" within our three dimensions. Graphically
spoken it just gets longer but doesn't "move".

*) Rotation
Rotation isn't really complicated but hard to explain without any picture.
One word to the rotation in POV. Whenever you rotate an object in POV you
have to give a rotation vector. This might be misleading since it is a
shortcut for three rotations in sequence! If you rotate an object by
<10,20,30> then POV rotates the object first 10 degrees around the X axis,
then 20 around Y and finally 30 around Z. This rotation is always done
around an axis.
To imagine rotation you best use a triangle. You remember these triangles
you used/use in school? Take the long base as an axis. Take the left hand
side as the vector (starting in the lower left corder of the triangle which
is our origin). Rotate the triangle around it's base (hold the left and
right edges with your fingers) to see how you vector rotates in space.
Always keep in mind that these rotations (except some special functions in
POV) rotate around an AXIS (either X, Y or Z). So if your vector has some
abitrary angle to the axis the movement might get complex.
A small example: Imaging a man we modelled in POV. This man stands still in
the origin (of the standard POV coordinate system) and we are behind him
(like at <0,0,-3> or so) Now we rotate him about <90,90,90>. This gets fun!

1) rotation around X would clap the man onto his face since the X coordinate
is the one running from left to right. If we turn this by +90 degrees the
man falls straight forward onto his nose.
2) rotation around Y rotates the man like an helicopter to the "right".
After 90 degrees he lies in front of us (still on his nose), feet to the
left, head to the right.
3) finally, rotation around Z by 90 degrees brings our poor man again into
the upright position but facing to the right. It would have beed easier if
he just would have turned around to the right! (like rotating by <0,90,0>)

*) Vector products
As you may have already encountered there are at least two vector products.
The cross product and the dot product.

.) Cross product
Beside the mathematical definition of Fernando I will try to give a
graphical explanation so that you get a picture in your mind.
Imagine two vectors in the X/Z plane of POVRay. These vectors would "lie
flat on the floor". Since both start in the origin they share their starting
points. These two vectors "span up" a plane (not an infinite plane like the
POV primitive). Just imagine a sheet of paper lying flat on your desktop.
Imagine the lower, left corner is the origin and the lower horizontal and
left vertical edge are your vectors. This is like these vectors form a flat
area (depending on the angle between these vectors your area is more or less
rectangular).
Ok. But what is the cross product?
The cross product is a vector standing perpendicular onto these two vectors
(or in other words perpendicular onto the sheet of paper). There are only
two possible ways a vector can be perpendicular on BOTH vectors. Spoken in
words of our sheet of paper this would mean straight upward (coming out of
your desktop towards the ceiling) and downwards (going through the desktop
downwards to the floor). This would be the direction of the resultant
cross-vector product. It's length would be as long as the CONTENT of the
area defined by the two starting vectors. Again, remember your sheet of
paper. It's size is about (29cm to 31cm or so for A4). So if our starting
vectors are of length 29cm and 31cm and have an angle of 90degrees between
them (as it is given for our paper) then the resultant vector (yes the
result of the cross product is a vector) would have a length of 29*31 = 899
(damn, now I DID use a formula). Note that if the angle is not 90 degrees
these visualisation is still valid, just the content is the one of a
parallelogram.
What about its direction? ("up" or "down"). Well, this is defined by the
order of the arguments. If vector1 cross vector2 results in an upright
vector, the reverse thing vector2 cross vector1 results in a downward
directed vector. (Mathematically spoken: the angle between the first and the
second vector must be "in mathematical counting direction" (which is
counterclockwise, right, up, left) to result in an upright vector). Please
note that "up" and "down" depends on the rotation of the whole thing. This
example is spoken for vectors in the X/Z plane of POVRay. You may rotate
this "picture" in any way but the cross product is always perpendicular to
the two vectors.

.) Dot product
The dot product (also called scalar product) is not so easy to explain in a
graphical way, but it is not impossible. It also starts with two "input"
vectors, similar to the cross product example.
The main advantage of the dot product is that it includes the ANGLE between
our two starting vectors. The result of the dot product is a number (a
scalar, thus the name). This number can be seen as the length of a vector
whose direction is something we don't really care (for now!). This sounds
useless since the purpose of using a vector IS having it's direction. But I
will come to this lateron.
Mathematically spoken we get the dot product if we do the following:
1) get the length of our first vector
2) get the length of our second vector
3) multiply those lengths
4) get the angle between the vectors
5) compute the COSINE of this angle
6) multiply the cosine with the result of the length multiplication

This is not really easy, so for what do we need this?
The trick is that on vector-basis this computation is VERY easy to do!

we have the dot product. That's easier than step1 to 6 isn't it?
The BIG advantage is that we know that in the result there is somewhere the
ANGLE between our vectors. So whenever we need the angle between two vectors
(since all vectors start at the origin we always have an angle) we can
easily compute the dot product and divide it by the lengths of our vectors.
The result is then the cosine of the angle.
Another very useful thing is projection. Imagine a light source illuminates
out vectors. The light source is placed so that it is perpendicular to one
of our vectors. So all light-rays fall with an angle of 90 degrees straight
forward onto our vector. Now the other vector comes into the scene and it's
shadow drops exactly onto the illuminated vector. This is called a
projection. The vector causing the shadow is PROJECTED ONTO the other
vector. By using the dot product (since it already takes the angle into
count) we can easily figure out the LENGTH of the SHADOW. Since we know that
the shadow is ON the illuminated vector we also know the direction of the
shadow.

That's it!
I hope you can understand my english and this text helps a bit in vector
algebra.
Let's see if this kicks off a discussion ;-)

best regards


Post a reply to this message

From: Fernando González del Cueto
Subject: Re: ExplainationPlease...??
Date: 24 Jan 2002 15:24:30
Message: <3c506d7e@news.povray.org>
"Bill DeWitt" <bde### [at] cflrrcom> wrote in message
news:3c506245$1@news.povray.org...

>     No joke, unless you count my State supplied education in math. I did
> mean dot operator, which is what stopped me from understanding most of the
> vector stuff I wanted to know. What this shows is how much I used them
> afterwards, that I didn't remember the term.
>
>     Most of the people here cannot imagine how ignorant of math us
non-math
> types can be. Someone just posted an explanation of those terms that I was
> completely unable to follow. It makes assumptions of knowledge that I just
> don't have. I am sure it is clear to someone, but not me. I may never
> understand vector math if I have to start at that level.
>
>     I'll stick to arithmetic (at most) advice from now on.

Well, everybody begins at zero. Remember how akward it was to substract when
you only knew addition. Right now I'm struggling to understand some
differential equations in order to simulate cloth movement, which may be
very easy for other people.

How old are you?

I suggest you to take small steps and do not try to learn advanced things if
you don't know the fundamentals. Remember everything in math is very
"chained" and you can't understand higher levels if you haven't understood
the lower levels.

I find that going through this staircase, one step at a time, is very
amusing and interesting. Trying to skip some steps can lead you to a sad
frustration.

There are very good books in which you can teach yourself this things. I

written an excellent and very detailed explanation of vectors. You should
try to read it!

Good luck,

Fernando.


Post a reply to this message

From: Josh English
Subject: Re: ExplainationPlease...??
Date: 24 Jan 2002 16:09:07
Message: <3C5077D2.F6A404C2@spiritone.com>
I've got a few tutorials at http://www.spiritone.com/~english/cyclopedia

there is one on vaxis_rotate, vrotate, vnormalize, and vcross (These
should help and will be updated soon with more material)

Josh English
eng### [at] spiritonecom
http://www.spiritone.com/~english


Post a reply to this message

From: Jamie Davison
Subject: Re: ExplainationPlease...??
Date: 24 Jan 2002 16:50:14
Message: <MPG.16ba7830dff95f1e989ab4@news.povray.org>
>     Most of the people here cannot imagine how ignorant of math us non-math
> types can be.

Guilty.  I can do trig, and I can do some basic 3d geometry, but 
calculus, matrices and more advanced vector mathematics goes straight 
over my head.

Hell, I was trained as a biologist, so the most mathematics I ever needed 
was some slightly more advanced statistical analysis, all of which I have 
long since forgotten.

Bye for now,
     Jamie.
(from a new install on his machine - long story, but at least it seems to 
be working with no data lost)


Post a reply to this message

From: Tor Olav Kristensen
Subject: Re: ExplainationPlease...??
Date: 24 Jan 2002 16:52:09
Message: <3C508140.F474238B@hotmail.com>
Mike Williams wrote:
> 
> Wasn't it Bill DeWitt who wrote:
> >
> >"Hugo" <hua### [at] post3teledk> wrote :
> >>
> >> Could you please tell about vector cross & dot products too, then?  :o)
> >
> >    I finally got what dot products were about a year ago. I don't know how
> >ignorant of them you are, but I had no clue. Here's what I finally figured
> >out.
> >
> >    If you have a vector #declare v = <1,2,3>;
> >    Then v.x = 1, v.y = 2, v.z = 3.
> 
> I guess that's a joke, but just in case your serious, the POV dot
> operator (which is what you have there) is a completely different thing
> from the vector dot product (which you can calculate with the "vdot()"
> vector function).

Well, it's not a completely different thing...  ;)

v.x does give exactly the same result as vdot(v, x) does


Tor Olav


Post a reply to this message

From: Jim Charter
Subject: Re: ExplainationPlease...??
Date: 24 Jan 2002 16:58:15
Message: <3C5085EF.13025F6E@aol.com>
I seek solice in a quote I seem to remember being attributed to Van Nuemann (sp?
the guy who was in on the very first computers and the a-bomb )
The sense of it was roughly: "You don't so much come to understand mathematics ,
rather, you just sort of get used to it"

PS.  When I laid this sage nugget on my son, then twelve, he simply responded, "
I don't what to learn math and I don't want to get used to it either!"


>
>
>     Most of the people here cannot imagine how ignorant of math us non-math
> types can be. Someone just posted an explanation of those terms that I was
> completely unable to follow. It makes assumptions of knowledge that I just
> don't have. I am sure it is clear to someone, but not me. I may never
> understand vector math if I have to start at that level.
>
>


Post a reply to this message

From: Bill DeWitt
Subject: Re: ExplainationPlease...??
Date: 24 Jan 2002 17:04:34
Message: <3c5084f2$1@news.povray.org>

>
> How old are you?

    Much too old to go back and start over. I would try if I didn't have so
much to do in other areas.


> written an excellent and very detailed explanation of vectors. You should
> try to read it!

    I saw that and saved it, but don't have much confidence that my ability
to understand higher math will improve even if I can make my way through it.
I have been struggling with remedial geometry for years now and have made
more progress with learning Chinese than with that...


Post a reply to this message

<<< Previous 10 Messages Goto Latest 10 Messages Next 7 Messages >>>

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