# Bending normals 45 degrees

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

## 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

1. 1
2. 2
3. 3
4. 4
Rutin
21
5. 5

• 9
• 13
• 19
• 14
• 9
• ### Forum Statistics

• Total Topics
632936
• Total Posts
3009314
• ### Who's Online (See full list)

There are no registered users currently online

×