Sign in to follow this  

Bending normals 45 degrees

This topic is 3588 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, A short while ago I asked about creating new normals by bending an original normal 45 degrees. I did'nt fix the problem though, so I'd like to ask it again. I need to take multiple samples from a cubeMap texture. Normally I take only 1, depending on the (world) normal. But I need to gather some extra data around that point. I think the best way to do this, is bending the normal 45 degrees (when looking aside from it). I'd like to do this 4 times (or maybe more). So if you look at a top view of the original normal, you get something like this:
N = original normal, from right above
1,2,3,4 are bended normals, there is 90 degrees between them when looking at top
     2 
     |
  1--N--3
     |
     4
Someone at a non-programming math forum helped me: >>If you 'move' all your vectors (you can always 'move' them back later) so that, looking at an xyz-coordinate system (a 3-d coordinate system) the vector n runs from the origin along the positive z-axis (ie. n = k), then unit vectors 1, 2, 3 and 4 (you can re-length all vectors later) are: 1 = i/sqrt{2} + k/sqrt{2} 2 = -i/sqrt{2} + k/sqrt{2} 3 = j/sqrt{2} + k/sqrt{2} 4 = -j/sqrt{2} + k/sqrt{2} i, j, k are the usual unit vectors in the x, y and z directions. << How to translate that into a shader? I think I understand the last part, but how do you 'move' a vector along with the positive Z axis? Keep in mind that the original normal can point into any direction. Greetings, Rick

Share this post


Link to post
Share on other sites

This topic is 3588 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this