Hello.
I have a model that I am loading from a database and some associated markers getting displayed on its surface.
Now I’d like to change the models initial rotation within the scene and also of course the positions of the markers to stay at the correct spot.
However I am already not being able to achieve the first task.
I used
BABYLON.SceneLoader.ImportMesh("", "scenes/", "babylonJS_logo_v3.babylon", scene, function (meshes) {
cube = meshes[0]
cube.rotation = new BABYLON.Vector3(1,0,1);
});
So i was able to rotate the mesh accordingly.
However now I need to rotate the marker positions as well.
I tried to add the rotation_vector to them but that does not work as planned. https://playground.babylonjs.com/#1KF7EW#2
Would I need to mess with the quaternion?
Thanks
One thing I noticed with your code is that you are trying to parent the markers to the cube, but because the mesh hasn’t loaded in yet when you create the sprites, they are actually not being parented. In order to fix this, you will want to create the markers after the mesh loads. Once they are parented, rotating the cube will move the markers around it correspondingly; is this what you’re looking for?
Well, I should have mentioned that I want the markers to always face the camera,
as they do in my example.
I think the parent code was transferred from an older version, sorry. I do not actually set it.
So what I am actually trying to achieve is, that the markers will always be attached to lets say the top left corner of the cube even if the cube’s rotation property has been changed.