Using the Quaternion.Transform seems to give the same results as
using the rotation matrix from your code. The problem with the
lighting was because I didn't recalculate/transform the vertex normals.
Regenerating the vertex normals like you did in 3DMF Workshop seems
expensive and destructive. It seems destructive because it does not
use the original normals instead it generates new ones. So if I have
objects that had normals generated for hard edges, wouldn't they be
lost? Or does the limiting angle fix this?
I read an article (http://www.gignews.com/realtime020100.htm) saying
that transforming vertex normals using the same approach as the
vertex points was okay as long as the transformation was "a series of
rotations, translations, and uniform scalings, the normal can be
safely transformed by this same matrix".
Can anyone confirm this or am I reading it wrong?
Not sure you'll be able to do this using Quaternion.Transform -
IIRC, that rotates around the origin and is generally only useful
when dealing with unit direction vectors. The "proper" way to do
this is to run the rotated geometry (or a copy of it) through an
appropriate matrix transform in software (i.e. rotate the vertexes/
triangles, then recalculate the normals). You might be able to take
some shortcuts but I can't think of anything at the moment. The
3DMF Workshop source has some software transform routines you might
be able to adapt (Generic3DModel.RotateX/Y/Z in particular).
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>
|