bulding a triangles right vector

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
grunt
Posts: 96
Joined: Tue Aug 17, 2004 9:14 pm
Contact:

bulding a triangles right vector

Post by grunt »

I am following the code here http://www.flipcode.com/archives/Decals_Explained.shtml to do a decal. I am getting (0, 0, 0) for my right vector and I am doing it just as explained in the tutorial. The tutorial says:
e largest, then the major axis is X, the same applies for the Y and Z components. Calculating the Right vector seems easy, but there is one problem with this calculation. When the face normal is equal to the major axis the result of the cross product between them is (0, 0, 0), not what we want. The solution to this problem is a simple one. When the face normal is equal to the major axis, the Right vector needs to be built by hand. Building the Right vector by hand is very simple, see the demo source code if you are unsure about how to build it.
Except the sites demo source code link is broken. Can anybody tell me how to build the right vector by hand?
Post Reply