Given 2 points A(x0,y0,z0) and C(x2,y2,z2) forming a segment of length "k", what is the equation to find a point C(x1,y1,z1) placed at "k-1" distance from A?
相关问题
- Is GLFW designed to use without LWJGL (in java)?
- How to determine +/- sign when calculating diagona
- Union of many (more than two) polygons without hol
- How does gl_ClipVertex work relative to gl_ClipDis
- Is there a way to rotate text around (or inside) a
相关文章
- Algorithm for partially filling a polygonal mesh
- Robust polygon normal calculation
- Algorithm for maximizing coverage of rectangular a
- Keep constant number of visible circles in 3D anim
- How do I remove axis from a rotation matrix?
- How to smooth the blocks of a 3D voxel world?
- Mayavi: rotate around y axis
- SVG circle starting point
This is basic maths. If you already have classes handling vectors and points, you should be able to do something like this:
You just need
difference between points (gives a vector)
scalar product of a float with a vector (gives a new vector)
addition of a point and a vector (gives a new point)
Smells like homework, so, general idea, but no code:
Get the slope of AC for each coordinate set (x, y, and z). Then progress k-1 units from A at each of the calculated slope to get the coordinates of the new point.