POV-Ray : Newsgroups : povray.advanced-users : A couple of questions about matrix transformations : A couple of questions about matrix transformations Server Time
29 Jul 2024 02:25:56 EDT (-0400)
  A couple of questions about matrix transformations  
From: Johannes Dahlstrom
Date: 1 Apr 2003 15:25:13
Message: <web.3e89ee318267de92f7cbce3c0@news.povray.org>
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.