|
|
In article <7k739u4hvrtp1um8nhc8n77d554ohj92ch@4ax.com>,
Peter Popov <pet### [at] vipbg> wrote:
> Well, what I do is inverse-transform the point of intersection
> (accounting for translation) so that it is in the object's own
> coordinate sphere, then use a simple formula to determine the normal
> of a unit object,
This is the usual way of doing this part.
> then transform that normal back to global space (ignoring
> translation, of course). This works. And of course it might just turn
> out that I am doing what you're doing, only slower <g>. I need to
> explore this better.
It doesn't work. Think about what it's doing...
Assume the translation is scale < 1, 0.5, 1>. When you transform the
normal back into the global space as a direction, you end up halving the
y component, making it more perpendicular to the y axis. This is the
opposite of what you want to do...the normal should point *more* along
the y axis.
And again with the sheared box...say you shear the +y axis in the +x
direction. You inverse-transform the intersection point and compute the
normal of an intersection on the top of the box as < 0, 1, 0>. Your
method will shear this vector, when it should remain < 0, 1, 0>.
I don't fully understand why using the transpose here works, but it does
in my own experiments, and POV seems to use it.
--
Christopher James Huff <chr### [at] maccom>
POV-Ray TAG e-mail: chr### [at] tagpovrayorg
TAG web site: http://tag.povray.org/
Post a reply to this message
|
|