Documentation on rotation refers to "Vector" but it doesn't exist

The documentation on rotation refers to the ability to use world axes to describe rotation. However the example provided refers to “Vector” which doesn’t exist.

mesh.rotation = new BABYLON.Vector(alpha, beta, gamma);

Yup it should be Vector3 :slight_smile:

Adding @PirateJC

Is this a bug then?

It is a typing error in the docs not a bug in babylon.js.

1 Like

How does BJS then distinguish between the syntactically identical

mesh.rotation = new BABYLON.Vector3(pitch, yaw, roll);

(with order YXZ) and

mesh.rotation = new BABYLON.Vector3(alpha, beta, gamma);

(with order ZXY)?

They would have totally the same meaning defined those ways and used in the same functions: Mesh Rotation | Babylon.js Documentation

How can they have the same meaning when the order of axis rotations are different in each case?

Typo fixed:

1 Like

It all depends on your frame of reference.

From the docs

the order YXZ using local axes

the order ZXY in world space

BJS is consistent in applying Vector3(x, y, z) it is only how you decide to view the rotations (observer on earth or pilot observer) that changes the order you think the rotations are being applied.

1 Like