olivia3
(Olivia)
1
Hi
I have created a code pen to illustrate my problem : https://codepen.io/odecharette/pen/ExpNPpX
I need to clone several objects in the same session
I want to have :
1 object Left
5 object Front (this is parametric, can be from 1 to 20)
1 object Right
1 manage to clone and place Left and front Object
But when I clone the last object, then it goes somewhere I don’t want…
Questions :
1/ How to place correctly my last object?
2/ How to hide the first object that was used only for clone?

Hope you can understand my issue 
Thanks
Olivia
snabela
(Alexander Schiftner)
2
The problem seems to be in how you use quaternions. You might be better off using the fromEuler function.
Hiding showing a node: ITreeNode | Viewer
olivia3
(Olivia)
3
Thanks
Can you give me an example on how to use fromEuler ?
I tried
clonedNode.transformations.push({
id: "transformation",
matrix: mat4.fromRotationTranslation(
mat4.create(),
quat.fromEuler(quat, 0, 0, 90),
vec3.fromValues(x, y, 0)
)
})
clonedNode.transformations.push({
id: "transformation",
matrix: mat4.fromEuler(quat, 0, 0, 90)
})