|
|
|
|
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Can someone please explain how the MTransNormal() function works? I'm
implementing a ray tracer but I am getting strange reflections when I apply
non-uniform transformations to spheres. I guess this is because of how I am
applying transformations to normals when transforming from object space
(containing an origin centered unit sphere) to world space. And I suspect
this seperate function is the key to solving my problems... but I just
can't quite make sense of it all yet. Is this why the function is
different??? Am I even on the right track? (I know, I know: I need to brush
up on my matrix math big-time.)
Cheers in advance!
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Ok, more specific details:
Any time I non-uniformly scale an object (at least if I end up with scaled
normals that are not aligned with the axis) I get screwy surface normals
(in reflections, and for use with shading).
I am currently using a 'm->tranformDirection(Vector * v)' method which does
a full transform using the matrix 'm' except that it ignores the fourth row
or the matrix (ie: the translation row).
I tried using the MTransNormal() code from povray (in a fairly shameful
manner) but didn't have any luck. I'm still as confused as ever.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
On Tue, 27 Jul 2004 12:18:35 EDT, "Nigglefish" <nomail@nomail> wrote:
> I'm still as confused as ever.
It's pretty hard to explain function written in a few lines with only
assignments and 3-step iteration. Since problem is in your code then you are
best placed to solve it.
When similar black hole occur to me usually it helps when I start to write
_detailed_ post with question. Near middle of writing I find where my broken
thinking is just because I rereaded what I wrote.
ABX
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Hehe I agree, my questions were very general.
I was fairly sure it wasn't my code, but something I was missing
conceptually. And that's what it was... I've solved the problem at last
(it's only 3am). I was using the same transform for directions and normals,
when what I really needed was a transposed, inverted transformation for the
normals. For many cases the standard and transposed inverse transformation
were the same which didn't help me work out what was happening at all. I
finally started thinking about normals and how they behave when non-uniform
scaled (I have about a million scribbled triangles in front of me) and it
all fitted into place.
My renders are looking the same as the same scenes in POV-Ray again, which
is my benchmark of success. Makes me sooo proud! Thanks for your fast
reply! Next time I will try to have more direct questions and less babble
;)
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |