POV-Ray : Newsgroups : povray.advanced-users : Tranformation matrix to change coordinate spaces : Re: Tranformation matrix to change coordinate spaces Server Time
6 May 2024 10:06:56 EDT (-0400)
  Re: Tranformation matrix to change coordinate spaces  
From: Chris Huff
Date: 11 May 2001 16:51:40
Message: <3afc50db@news.povray.org>
John VanSickle <van### [at] erolscom> wrote:
> The advice that the others give is sound.  You need to calculate
> the inversion of the first matrix, and then multiply this inversion
> by the second matrix.

> This is, by the way, the manner in which the Reorient() macro works.

> The following macro will invert it.  It cheats a bit, BTW,
> in that it undoes the translation component (the vecl part),
> and then undoes the rotation, scaling, and shearing that
> is done by vecz, vecy, vecz.

If you are using MegaPOV, it would be much easier to use:

transform {matrix <...> inverse}

This is even more useful, since you can specify any series of
transforms, and use declared transforms...however, it can't be used to
get the matrix, as your macro can be modified to do.

Or maybe it can...it should be possible by using vtransform() to
"scan" a matrix, using x, y, and z to get the first 3 columns, and
< 0, 0, 0> to get the fourth...right?


> If you want to understand this sort of thing better (useful
> for things outside of POV-Ray, too!), go find "matrix inversion"
> and "matrix multiplication" on the Web, and find a page that
> makes sense to you.

www.google.com is very helpful here...For POV-specific pages, try the
links page on povray.org, but the ones I've found don't explain
inversion and stuff, just how to use the matrix transform.

This is a good POV-specific page: ;-)
http://enphilistor.users4.50megs.com/matrix.htm

Also:
http://davidf.faricy.net/povre.html
http://www.shipbrook.com/jeff/raytrace/matrix.html
http://www.cix.co.uk/~gbreed/matritut.htm


-- 
Christopher James Huff - chr### [at] maccom
Home Page: http://homepage.mac.com/chrishuff/
POV-Ray TAG e-mail: chr### [at] povrayorg
POV-Ray TAG web site: http://tag.povray.org/


Post a reply to this message

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