|
|
|
|
|
|
| |
| |
|
|
|
|
| |
| |
|
|
I was unable to figure out from the POV-Ray source code exactly how this was
done.
Let's say I have an object. I know of a point A on this object. I happen to
know the normal of the object at point A.
Now, I apply a matrix transformation to the object. Point A has been mapped
to point B. How do I figure out the normal of the transformed object at
point B?
I thought, at first, that I could apply the inverse of the matrix
transformation to the normal, but then I realized that this wouldn't work in
all cases.
How is it done?
- Slime
[ http://www.slimeland.com/ ]
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
In article <3dd5ac26$1@news.povray.org>, "Slime" <slm### [at] slimelandcom>
wrote:
> I thought, at first, that I could apply the inverse of the matrix
> transformation to the normal, but then I realized that this wouldn't work in
> all cases.
You are correct. The answer is pretty simple: transform the normal by
the transpose of the inverse of the transformation matrix.
Ok, it's simple assuming you know some matrix math. ;-)
This should explain things a bit more thoroughly:
http://www1.acm.org/pubs/tog/resources/RTNews/html/rtnews1a.html#art4
--
Christopher James Huff <cja### [at] earthlinknet>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: chr### [at] tagpovrayorg
http://tag.povray.org/
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
> You are correct. The answer is pretty simple: transform the normal by
> the transpose of the inverse of the transformation matrix.
> Ok, it's simple assuming you know some matrix math. ;-)
The *transpose* of the inverse?!? OMG! Wow. I'm going to think about that
for a while. Thanks! And thanks for the link =)
- Slime
[ http://www.slimeland.com/ ]
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Christopher James Huff wrote:
>In article <3dd5ac26$1[at]news.povray.org>, "Slime" <slm### [at] slimelandcom>
>wrote:
>
>> I thought, at first, that I could apply the inverse of the matrix
>> transformation to the normal, but then I realized that this wouldn't work in
>> all cases.
>
>You are correct. The answer is pretty simple: transform the normal by
>the transpose of the inverse of the transformation matrix.
>...
If the column or row vectors in his transformation
matrix forms an orthonormal basis, then the
transpose of the inverse of that transformation
matrix should be the transformation matrix itself.
I have not given transformation of normals much
thought, but I think that a consequence of the
above must be that:
As long as his transformation matrix does not scale
or shear the object in any way, he can just use this
matrix for the normals as well.
Tor Olav
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
In article <web.3dd645beb3508d7038149fba0@news.povray.org>,
"Tor Olav Kristensen" <tor### [at] hotmailcom> wrote:
> As long as his transformation matrix does not scale
> or shear the object in any way, he can just use this
> matrix for the normals as well.
Equal scaling is possible, only unequal stretching needs the transpose.
But detecting this case takes more processing power than using the
transpose of an existing inverse matrix, implementing it that way is a
waste of time. It is easy to make a function that transforms by the
transpose instead of the matrix without actually going through the
trouble of transposing the matrix, it is no more computationally
expensive than an ordinary direction vector transformation.
--
Christopher James Huff <cja### [at] earthlinknet>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: chr### [at] tagpovrayorg
http://tag.povray.org/
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |