Create vector from distance and vector
问题 How can I create vector from another vector and a distance? For example, with a vector3d(1,1,2) and distance 12, create another vector that has the same direction but is longer by 12 units. 回答1: You want to find the unit vector in the direction you want; in XNA this is given by Vector3.Normalize . Then you can scalar multiply that unit vector (which has, by definition, length = 1) by the final distance. Ex.: var originalVector = new Vector3(1, 1, 2); var finalLength = originalVector.Length +