OZONE Asylum
Forums
OZONE
Help with Rotation Matrix
This page's ID:
28781
Search
QuickChanges
Forums
FAQ
Archives
Register
Edit Post
Who can edit a post?
The poster and administrators may edit a post. The poster can only edit it for a short while after the initial post.
Your User Name:
Your Password:
Login Options:
Remember Me On This Computer
Your Text:
Insert Slimies »
Insert UBB Code »
Close
Last Tag
|
All Tags
UBB Help
Actually, after thinking about your problem more, I'm pretty sure this is what you're trying to do (and I was touching on this in my previous post): You have a nicely normal mapped 3D model. The normals are in 3D space, so you don't have to transform them to be tangent to the polygons: you just use the normals directly. Here's a bump map, which you've UV-mapped onto the model. If you view the bump map on the model, the white spots are places you want to pop "up" more than usual. Every pixel on the bump map can be turned into a normal G, as you've described. This normal, if it were transformed into tangent space on the polygons, would be a good normal map. However, instead of just transforming it into tangent space on the polygons, you want to transform it into tangent space on the *original* normal map, thus combining the two normal maps. The best way to do this is probably to (1) first transform it into tangent space on the polygons, and then (2) transform it from there into the direction of the original normal map. (1) can be done only by using the UV coordinates of the polygon in question. You want to find which direction in 3D space on the polygon is "up" (0,1) on the texture, and which direction is "right" (1,0) on the texture. We'll work out the math for this if I'm correct about what you're going for. Once you have these "up" and "right" directions, and you have "out" as the triangle's normal, you can get the transformation of G into 3D space as G' = G.x * right + G.y * up + G.z * out. (2) can be done, as you were doing, by a rotation from the triangle's normal towards the original normal map's value of V. Find U which is perpendicular to the triangle's normal and V, as well as the angle between them, and rotate G' around it by that angle. This is basically the "camera" approach I described above, but by starting in the triangle's tangent space we avoid the "pole" problem at (0,0,-1) because we've moved the pole to the opposite of the triangle's normal, and V is never close to that.
Loading...
Options:
Enable Slimies
Enable Linkwords
« Backwards
—
Onwards »