POV-Ray : Newsgroups : povray.general : grouping transforms into one final rotation? Server Time
19 Apr 2024 08:13:59 EDT (-0400)
  grouping transforms into one final rotation? (Message 11 to 20 of 20)  
<<< Previous 10 Messages Goto Initial 10 Messages
From: Stephen
Subject: Re: grouping transforms into one final rotation?
Date: 18 Sep 2018 11:58:28
Message: <5ba120a4$1@news.povray.org>
On 18/09/2018 14:59, Bald Eagle wrote:
> "Kenneth"<kdw### [at] gmailcom>  wrote:
>> "Bald Eagle"<cre### [at] netscapenet>  wrote:
>> Thanks! I've started diligently going through these useful links for insights;
>> some good tidbits have popped up already...
> Well I'm glad they're useful --- I'm never sure.

They are. I might be in danger of understanding matrices some time soon.

-- 

Regards
     Stephen


Post a reply to this message

From: Bald Eagle
Subject: Re: grouping transforms into one final rotation?
Date: 18 Sep 2018 12:45:00
Message: <web.5ba12b6581dcebf3c437ac910@news.povray.org>
Stephen <mca### [at] aolcom> wrote:

> > Well I'm glad they're useful --- I'm never sure.
>
> They are. I might be in danger of understanding matrices some time soon.


:)    I think there's a lot of basic matrix stuff that's a whole lot easier and
simpler than it's made out to be.

I like to watch some of the videos and other channels to get the overall gist of
things.  There's a few good ones on linear algebra, basis vectors, and
quaternions.


https://www.youtube.com/watch?v=kYB8IZa5AuE


Post a reply to this message

From: Kenneth
Subject: Re: grouping transforms into one final rotation?
Date: 18 Sep 2018 14:10:07
Message: <web.5ba13e5581dcebf3a47873e10@news.povray.org>
"Bald Eagle" <cre### [at] netscapenet> wrote:
> I think what you need to do is define something like:
> X = x, Y = y, and Z = z, and use those as the basis vectors of your overall
> transform matrix composition.

        [..."then a miracle occurs"...]
>
> Then apply those sequential transforms to those vectors, and then, as an
> exercise for you, the alert reader, do trig to get the angles back.

        [..."and the final miracle happens here"...]
>
> This sounds pretty cool - it should be neat once it's worked out.  :)

:-P  I couldn't resist! It all seems like magic to me at present. I must now
cast the runes, to see if the auspices are favorable...

BTW, I had previously seen the Wikipedia article on "Transformation Matrix"
(with my eyes glazing over), but it's actually starting to make some sense now.
As is often the case with Wikipedia technical articles, there is just enough
detail to be maddening, with a fair amount of knowledge by the reader already
assumed.

I see that an important concept re: matrices is the use of "homogenous
coordinates", rather than the typical Cartesian coordinates, something I didn't
know about:

https://en.wikipedia.org/wiki/Homogeneous_coordinates#Use_in_computer_graphics

It helps explain why matrices use 1's and 0's, and what they represent. (I'm
still digesting that stuff though, so I'm not yet totally clear about the
concepts.)

The other mystery to me is what a 'basis vector' is (maybe specifically to
POV-Ray.) Am I correct in thinking that it's not a typical <...,...,...>-style
vector, but a matrix version of same? The Wiki article about that is way over my
head-- but I did come across this link, which is somewhat more human-readable
:-) ---

http://fourier.eng.hmc.edu/e102/lectures/orthogonaltransform/node3.html

I'm still a "babe in the woods" with this stuff, so any comments/corrections are
certainly appreciated. It's all *slowly* starting to sink in...


Post a reply to this message

From: Bald Eagle
Subject: Re: grouping transforms into one final rotation?
Date: 18 Sep 2018 15:05:00
Message: <web.5ba14c4281dcebf3c437ac910@news.povray.org>
"Kenneth" <kdw### [at] gmailcom> wrote:
> I must now
> cast the runes, to see if the auspices are favorable...

Make sure you stir the chicken entrails in the proper direction.  POV-Ray use
the left-hand coordinate system.


> As is often the case with Wikipedia technical articles, there is just enough
> detail to be maddening, with a fair amount of knowledge by the reader already
> assumed.

Hey, listen, the POV-Ray docs...   :|   Nevermind.

> I see that an important concept re: matrices is the use of "homogenous
> coordinates", rather than the typical Cartesian coordinates, something I didn't
> know about:

https://en.wikipedia.org/wiki/Homogeneous_coordinates#Use_in_computer_graphics

> It helps explain why matrices use 1's and 0's, and what they represent. (I'm
> still digesting that stuff though, so I'm not yet totally clear about the
> concepts.)

Didn't have time to read through all of that - but it looks a lot like the
stereographic 4D-->3D projection stuff I'd like to do.

> The other mystery to me is what a 'basis vector' is (maybe specifically to
> POV-Ray.) Am I correct in thinking that it's not a typical <...,...,...>-style
> vector, but a matrix version of same?

The basis vectors are just the "axis vectors" you're using.

Suppose you applied a shear transform to an entire scene.
If you had the original x, y, and z vectors defined as "user-defined" vectors,
and applied that shear transformation, then the resulting output would be the
basis vectors for that new sheared scene-space.

So If you used THOSE vectors as the axes, then you'd be able to traverse all
around THAT space without having to apply any transformations - it would be
_native_.

Look over the 3brown1blue video channel I posted - he does a GREAT job at
explaining it all - look at the linear algebra series - he specifically focuses
on basis vectors in one video.


Post a reply to this message

From: Bald Eagle
Subject: Re: grouping transforms into one final rotation?
Date: 18 Sep 2018 15:30:00
Message: <web.5ba151bb81dcebf3c437ac910@news.povray.org>
"Bald Eagle" <cre### [at] netscapenet> wrote:
> "Kenneth" <kdw### [at] gmailcom> wrote:

> > The other mystery to me is what a 'basis vector' is (maybe specifically to
> > POV-Ray.) Am I correct in thinking that it's not a typical <...,...,...>-style
> > vector, but a matrix version of same?
>
> The basis vectors are just the "axis vectors" you're using.

https://en.wikipedia.org/wiki/Basis_(linear_algebra)

Imagine you had a piece of "graph paper" that had pivot points at every
intersection.  You could "tilt" it.
Rather than trying to calculate where points would be _based upon the original
position_ of the graph paper axes, you just "swivel" the y-axis so it's slanted
at a 30-degree angle, and now you can travel along that just as easy as
"translate y*10".  you do the trig to get the transform for the axis, ONCE, and
the whole rest of the space gets "calculated" for free.

Take a vector <0, 1, 0> and plot it, 20 times as long, as an arrow in POV-Ray.
Make a sphere and set it at the origin.
Then translate a copy of that sphere y*5.
Transform vector <0, 1, 0> by rotate -z*30.
draw that as an arrow 20 times as long.
Now translate the sphere along that vector by
translate (transform result)*5

You could also play with the camera vectors - right, up, direction


Sort of a variation on this idea is what I've playing with (for far too long)
here:
http://news.povray.org/povray.binaries.images/message/%3Cweb.5ba14dd7dc5d6572c437ac910%40news.povray.org%3E/#%3Cweb.5ba
14dd7dc5d6572c437ac910%40news.povray.org%3E

The bezier patch curves sort of act like a deformed rubber graph paper.
I only calculate a simple pattern to uv-map, and then the bezier patch splines -
the "local basis vectors" transform those points along its surface.  At least
that's the way I think about it in my head.  :D


Post a reply to this message

From: Alain
Subject: Re: grouping transforms into one final rotation?
Date: 19 Sep 2018 18:44:04
Message: <5ba2d134@news.povray.org>
Le 18-09-17 à 16:38, Kenneth a écrit :
You can replace this :

> #debug concat ("\n","rotate    <",
>            str (......,0,3),str(.......,0,3),str (......,0,3),
>                   ">\n")
> 
With this :
#debug concat("\n","rotate  =  <"vstr(3,.......", ",0,3)">\n>)

Similar to str.
The first paremeter is the numbet of elements to parse.
The third is a string to be used as a separator.

I think that it's clearer and cleaner.


Post a reply to this message

From: Bald Eagle
Subject: Re: grouping transforms into one final rotation?
Date: 19 Sep 2018 20:35:02
Message: <web.5ba2ea5a81dcebf3458c7afe0@news.povray.org>
Alain <kua### [at] videotronca> wrote:

vstr()

> Similar to str.
> The first paremeter is the numbet of elements to parse.
> The third is a string to be used as a separator.
>
> I think that it's clearer and cleaner.

It is, though I find it cumbersome and hard to remember the exact syntax.

I've just started using:

#macro Vector (_Value, _P, _N)
 #local _Result = concat ("<", vstr(3, _Value, ", ", 0, _P), ">");
 #if(_N) #local _Result = concat (_Result, " \n") #end
 _Result
#end

with the last argument a Boolean to select without or with an ending "\n".

If need be it can be edited or copied to another macro "Vector4", etc.

Another link to add to Kenneth's Autumn reading list:

http://www.c-jump.com/bcc/common/Talk3/Math/Matrices/Matrices.html#W01_0150_matrix_by_matrix_mult


Post a reply to this message

From: Kenneth
Subject: Re: grouping transforms into one final rotation?
Date: 19 Sep 2018 22:25:01
Message: <web.5ba303b681dcebf3a47873e10@news.povray.org>
Alain <kua### [at] videotronca> wrote:
> Le 18-09-17 à 16:38, Kenneth a écrit :
> You can replace this :
>
> > #debug concat ("\n","rotate    <",
> >            str (......,0,3),str(.......,0,3),str (......,0,3),
> >                   ">\n")
> >
> With this :
> #debug concat("\n","rotate  =  <"vstr(3,.......", ",0,3)">\n>)
>
> Similar to str.
> The first paremeter is the numbet of elements to parse.
> The third is a string to be used as a separator.
>
> I think that it's clearer and cleaner.

Yes, I'm actually more familiar with your version, but I got a bit lazy and used
the longer one. ;-)  I also sometimes forget what the exact 'cleaner' syntax is.


Post a reply to this message

From: Bald Eagle
Subject: Re: grouping transforms into one final rotation?
Date: 20 Sep 2018 12:20:00
Message: <web.5ba3c79481dcebf3c437ac910@news.povray.org>
Take a look at:

http://www.scratchapixel.com/lessons/3d-basic-rendering/perspective-and-orthographic-projection-matrix/projection-matri
ces-what-you-need-to-know-first

Looks like a great explanation of the topic.

The rest of the site looks excellent as well - I've read several other articles
over there that were very helpful.


Post a reply to this message

From: Kenneth
Subject: Re: grouping transforms into one final rotation?
Date: 20 Sep 2018 13:30:07
Message: <web.5ba3d8b981dcebf3a47873e10@news.povray.org>
"Bald Eagle" <cre### [at] netscapenet> wrote:

> Another link to add to Kenneth's Autumn reading list:
>
http://www.c-jump.com/bcc/common/Talk3/Math/Matrices/Matrices.html#W01_0150_matrix_by_matrix_mult
>
> Take a look at:
>
http://www.scratchapixel.com/lessons/3d-basic-rendering/perspective-and-orthographic-projection-matrix/projection-matri

ces-what-you-need-to-know-first
>
> Looks like a great explanation of the topic.
>
> The rest of the site looks excellent as well - I've read several other articles
> over there that were very helpful.

Thanks for the research. Will do.


Post a reply to this message

<<< Previous 10 Messages Goto Initial 10 Messages

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