Line troubles..
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?
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.
Hope this helps.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement