Sign in to follow this  
Scar

Line troubles..

Recommended Posts

Hey all, I need to make a line algorithm that will chew a line down, or make it shorter on both ends in 3D. I was thinking about having a normal that points from point x to point y and from there I could move it along that normal but I have no idea how to get it. Could I multiply the 2 vectors then normalize the result? Am I even on the right track?

Share this post


Link to post
Share on other sites
To find a point along a line you can use Lerp (See: Vector3.Lerp()/D3DXVec3Lerp). For your problem just call it twice with the ends of your lines as the two vector params and two different interpolater values to get two new points for a shorter line. To cut 10% of each end use values like 0.1 and 0.9.

Hope this helps.

Share this post


Link to post
Share on other sites

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