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
Alright, Slime and the rest of you vector-heads. Gonna toss this out there. Text right now, maybe some specific resources later. Back when I was more into 3d, I had some tricks for baking custom normal maps and then taking them in Photoshop for more post work. My own home brew of techniques for adding faux lighting, highlights, reflection layers, and other things. Gave up 3d for awhile. Then got sucked into Second Life. Over on the SL forums, the subject of normals came up. So, I'm trying to resurrect my old 2d/3d techniques for the SL crowd. Maybe even toss in a few new tricks. The normal maps that I'm baking are full 3d in local space (screenish). By full 3d, I mean that the vectors go all the way around instead of half way around like in pure screen space. R == 0=left, 255=right G == 0=top, 255=bottom B == 0=away, 255=towards I'm grabbing these values in Photoshop and turning them into a unit vector. When you look at these maps in Photoshop, V(0,0,1) is facing. And V(0,0,-1) is the backside of the model. And V(-1,0,0) is to the left. And so on. Using that system right there is already pretty good. In Photoshop, I can set one vector as a faux lightsource, and then get theta between that vector and V. That theta can then be used for faux lighting. So far so good. The next step is to add a bump map. Using Sobel, not to hard to turn a greyscale bump into a vector. G Gx = Sobel left/right Gy = Sobel up/down GZ = Pythagoras Now for the hard part. If I add G and V, everything is fine for when facing. However, everything is backwards on the backside. For V(0,0,1) + G, they add fine. For V(0,0,-1) + G, everything is rotated 180 degrees. This is because I'm adding vectors from a sphere and vectors from a plane. That is, the plane needs to be wrapped to the sphere, so to speak. The G vector needs to be spherified or brought to beer, or normalized, or whatever you want to call it. Enter a few more vectors. B(x,y,z) This the the base vector that G has to be rotated to. For my custom normal maps, this would be B(0,0,1). U(x,y,z) This is the vector to rotate about. The way I see this problem in my head, this vector is the perpendicular between V and B. - Get V and G and make sure B is set properly. - Get U, which is the perpendicular between V and B. - Get theta between B and V. - Rotate G around U using theta (-theta). That is where I'm at and how I'm trying to accomplish my task. There is either something wrong with my thinking, or something stupid in the code. I keep running into a rotation problem in the final result. I've been running this through my head for weeks now and I can't see what is wrong. I can rotate like a madman with a Hit-or-Miss Stick, but nothing proper. If you want to go the extra mile and grab Filter Meister, I'll post some sample maps and the code that is driving me nuts. I don't know. Nuts. ~kicks the dirt again~
Loading...
Options:
Enable Slimies
Enable Linkwords
« Backwards
—
Onwards »