Generating new vectors from an original vector
Hi math gurus,
Not sure if my question is in the right section of this forum, but here it goes. I have a normalized 3D vector (a normal from a 3D model), and now I'd like to generate 4 vectors around this original one, under an angle of 45 degrees. Something like this:
Code:
< looking on top of the normal vector (notated as o) >
< Rotation does not matter, as long as vector 1/2/3/4 form a cross around o >
2
|
1---o---3
|
4
< Looking at the side of the normal vector >
< You can't see it here, but there should be 45 degrees between the vector1/2/3/4 and vector o>
o
1 | 2
\ | /
\ | /
\45 | /
\ | /
The normal vector could point any direction, and is normalized (the values are between -1..+1). The rotation of the 4 vectors around the normal (as in the "top" view) does not matter, as long as it forms a cross. So, the question is, how to calculate these 4 vectors? Or how to calculate at least 1 vector, and then rotate it around vector o?
Ow, and to be more specific, the calculations need to be done in a shader program for computer graphics.
Excuse me for the "ASCII art" (hope its not screwed up) :)
Greetings,
Rick