POV-Ray : Newsgroups : povray.advanced-users : A couple of questions about matrix transformations : Re: A couple of questions about matrix transformations Server Time
29 Jul 2024 02:32:53 EDT (-0400)
  Re: A couple of questions about matrix transformations  
From: Tim Nikias v2 0
Date: 1 Apr 2003 16:13:49
Message: <3e8a010d@news.povray.org>
The inverse of a matrix is always the array which
multiplied with the original array results in an
array with 1 on the upper-left to lower-right diagonal.

Here's a (german) link I found while searching for my
math examn:

http://miss.wu-wien.ac.at/~leydold/MOK/HTML/node31.html

Basically, what you do is write the uniform matrix aside the
original one:

original | uniform

1 2 5 | 1 0 0
4 6 7 | 0 1 0
8 3 5 | 0 0 1

And then solve the rows and trying to get
1 0 0
0 1 0
0 0 1
at the left side. The right side would then be the inverse
matrix.

Creating an algorithm which tries to solve the left side to get
the uniform matrix shouldn't be too difficult, but I espect that
there is some better method for that.

About how to go along with this on your raytracer: don't know.
But I thought perhaps the inverse-matrix thingy could help...

Regards,
Tim

--
Tim Nikias v2.0
Homepage: http://www.digitaltwilight.de/no_lights
Email: Tim### [at] gmxde

> I was implementing a cylinder primitive to my little pet project, a
> raytracer, when I run into some problems.
>
> The cylinder is defined the same way as in POV, by two vectors and a
float,
> representing the base and apex points and the radius, respectively.
Writing
> an intersection finder and other needed stuff for such a general case
would
> be rather difficult, so I reasoned that it would be easiest (and perhaps
> most efficient, too?) to make the cylinder always lie along a coordinate
> axis (say, the Y axis) in object space, and then provide an appropriate
> transformation from object space to world space.
>
> The problem is, how would I go about constructing such a transformation? I
> took a look at the relevant part of the POV source code, but didn't quite
> figure out how it does the trick. I could of course just grab the code,
but
> I'd rather understand the algorithm behind it.
>
> I'd also like some insight into how to invert a transformation (4x4)
matrix.
> I did a bit googling but didn't come by anything too relevant.
>
> Thanks in advance,
>
> -Johannes
>
>
>


Post a reply to this message

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