Question about cam behavior & rotation (Quaternion)

Actually I am experimenting to get a better understanding of Babylon’s camera behavior. In my scene i have a Mesh (simple cone) that is rotatable and I added a Face as a texture to it. Now I try to let my camera’s perspective (flycam as cone ‘actioncam’) look in the way my cone “looks” :smiley:

I tried the following:
var actioncam = new BABYLON.FlyCamera(“ActionCam”, new BABYLON.Vector3(myMesh.position.x, value, myMesh.position.z), scene);

 var abcQuaternion = BABYLON.Quaternion.RotationAlphaBetaGamma(myMesh.rotationQuaternion.x, myMesh.rotationQuaternion.y, myMesh.rotationQuaternion.z);

  actioncam.setTarget(new BABYLON.Vector3(abcQuaternion.x,abcQuaternion.y,-180+abcQuaternion.y));

However, still I get something wrong here, for I do not understand the idea of the Quaternion :smiley: I do actually not see any relation of my MeshesQuaternion and it’s actual rotation :))

Mesh rotates via:

var axis = new BABYLON.Vector3(0, shiftAxisParam, 0);
                    var angle = 0.09;
                    currentMesh.rotate(axis, angle, BABYLON.Space.LOCAL);

Any advice would be appreciated :slight_smile:

Well I actually solved it with this simple solution:

  actioncam.parent = myMesh;
               actioncam.position.y = 1;
               actioncam.position.z = -2;
               actioncam.position.x = 1;

:smiley: great, I like Babylon each day more :smiley: :slight_smile:

1 Like

Fantastic :wink:

1 Like