mCard Posted May 2, 2017 Share Posted May 2, 2017 I need to create a Vector3 that is a certain distance away from another Vector3, which is on a line. Basically, I am trying to create a tube that ends in the middle of a cone to create an arrow. However, I already changed the pivot matrix to be the point of the cone and the cone has already been aligned along an axis between two spheres. Is there an easy way to find a Vector3 to serve as the tube's endpoint in Babylon or do I have to solve all of the calculus by hand. So far, the closest I've gotten is a calculus equation. I know two Vector3 that are on the line, and the distance that the third Vector3 must be from the second Vector3. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted May 3, 2017 Share Posted May 3, 2017 Hello you may need something along these lines: // Pseudo code var dist = vec2.subtract(vec1); dist.normalize(); dist.scaleInPlace(10);// the distance you want from vec2 var vec3 = vec2.add(dist); Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.