Line troubles..

Started by
1 comment, last by Scar 18 years, 5 months ago
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?
Advertisement
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.
It does help, exactly what I was looking for. Thanks man.

This topic is closed to new replies.

Advertisement