ok… I’ve been cracking my head this day on this but I couldn’t find any solution, so please help me!

Imagine you have a radius-vector (the one that goes from the beginning of coordinates (0;0;0) and ends in some point (x;y;z). Wiki. ).

The coordinates of it’s point are known in 3d space, let’s say they are (x1;y1;z1). The beginning of it is in the (0;0;0), because it’s radius vector.

Now I need to “make it longer” by “a” points, and find it’s new coordinates. If represent it in 2d space, schematically it can be so:

If the coordinates before it's prolongation are known (x1;y1;z1) and I need to make it longer by "a" points, how do I find it's new coordinates after prolongation (x?;y?;z?)????

I draw a picture representing it in 2d space, but I need to get formulas for 3d space. Maybe in jME there's some kind of function for this?

The only solution I see it to calculate the angle of this vector and sin/cos to find new vector's projections on each coordinate axe...

public static Vector3f IncreaseVectorBy(Vector3f base, float i)
{
// base - base vector that needs to be prolonged by "i" points
Vector3f rez = new Vector3f();
float vlen = (float) Math.sqrt(base.x*base.x + base.y*base.y + base.z*base.z);
float ab = vlen + i;

rez.x = ab * base.x / vlen;
rez.y = ab * base.y / vlen;
rez.z = ab * base.z / vlen;

hm lol, that spam bot even said somthing partly helpfull :-o :-o

To change the lenght of a vector multiply each element with the scalar.
In case of a one unit vector (normalize()) this leads to a vector with the lenght of the scalar.

By the way of "normalize()" what is the difference from "normalizeLocal()"?

Pratically I was trying to solve the inverse of the problem proposed on the thread, that is finding a point on a vector having only its distance from the origin:

Vector3f vOrigin = new Vector3f();
Vector3f vTarget = node.getLocalTranslation();

Vector3f direction = vTarget.subtract(vOrigin);
[b]direction.normalizeLocal();[/b]
Vector3f mul = direction.mult(distance);
Vector3f position = vOrigin.add(mul);

I am really more than a beginner with math vectors so I don't understand why using "normalizeLocal()" all works as expcted, while using "normalize()" the position moves more far...

normalize() returns the normalized vector, as a new Vector3f object.

normalizeLocal() changes the values of the existing Vector3f, to be normalized.

So if you used direction.normalize() in that code, it wouldn't do anything - nothing gets done with the return value so the next line would multiply the original value of direction.

The way you would do it with that method is condense the two lines into one:

Vector3f mul = direction.normalize().mult(distance);