Impossible scenarios : rotating a Vector3 ? Possible !

Greetings,

We got a Vector3 (A) in a static referential.
We want a Vector3 (B) so that Vector3 A and B make an angle of a certain value (in degree).

Well :?:

Additional precisions : Y component is not used in both Vector3, they are coplanar.

should the vectors be in the same plane (x-z as in the picture above) or do you want a result in 3D-space?

Both Vector3 are in the same plane XZ.

Vector3 B = Quaternion.Euler(0,angle,0) * A;

Replace Vector3 by var if you’re using JS. There are two vectors that meet your criteria, the other one can be found using -angle.

First, I got :

but I inverted them, and it … works.

I would be curious to know where you read you could multiply a Quaternion by a Vector3 ? :slight_smile:

Anyway, good job ! Thanks you both for your answer. :wink:

Check the operator* function. There you can also see that they only defined a function for QV and not for VQ. I don’t know why V*Q isn’t implemented.