Sign in to follow this  

Calculating right vector for decals

This topic is 4110 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! I'm following this tutorial: http://www.flipcode.com/articles/article_decals.shtml to add decals to my game. I've got to the point where it says "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." But the link to the demo no longer works :-( So could someone tell me how to do build the right vector? (I've got all the code implemented but the cross product IS equallying zero so of course I have a problem. and I can't figure it out myself!) Thankyou, Dan

Share this post


Link to post
Share on other sites
I don't have a face or edge, just the normal and point of intersection (given from ODE).

If the special case is simple as suggested... then tell me it :)

Or any other suggestions of course.

Share this post


Link to post
Share on other sites
Quote:
Original post by xDan
I don't have a face or edge, just the normal and point of intersection (given from ODE).
Oh, I see. In that case, I think the tutorial you linked to has it backwards. You want to cross the face normal with the cardinal axis with which it is least aligned, not most aligned. This will be the axis that corresponds to the component of the normal with the smallest magnitude. With this method there are (again) no special cases, and the resulting basis will always be valid.

Share this post


Link to post
Share on other sites

This topic is 4110 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