On 12-Aug-05, at 12:23 AM, Lo Saeteurn wrote:
Animations play perfectly and share much of the data. The problem
now is with the lighting. If the animated object is rotated, the
lighting does not change on the object. I suspect the normals
have something to do with it. If so, how do I extract the normal
list from a trimesh object and interpolate between the two frames?
Normals are stored in the vertex attributes of the trimesh data
(same place you find the texture uvs).
So it is the normals that are causing this lighting issue? If so,
it shouldn't be too difficult to find.
Most likely...
I can't recall the exact details involved with getting at them but
it might help to check out the Trimesh3D.GetVertexNormals method
in the Quesa Wrappers.
Now I'm guessing there's no way to share just the VertextNormals.
It looks like it is mixed between the UV and the other vertex
information. If this is the case, there may be performance issues
going though them all?
It's a little messy but you can share the normals without touching
the other data. Check out the Trimesh3D.GetAttributeDataPtr method in
the the Quesa Wrappers - it shows how to dig through the vertex
attribute data to find a pointer to a particular lump. Once you have
that pointer you can copy your data into that memory or assign a
local memoryblock. Things get tricky when a model is missing normals,
but you probably won't have to worry about that.
Frank.
–––––––––––––––––––––––––––––––––
Open Source RB Goodies and Shareware
<http://developer.chaoticbox.com/>
<http://www.chaoticbox.com/>
–––––––––––––––––––––––––––––––––
_______________________________________________
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>
|