You can use a direct approach by directly assigning objects,
object.position = position;
object.rotation = rotation;
or with an array and keys with iteration of properties.
['x', 'y', 'z'].forEach(function (k) {
object.position[k] = position[k];
object.rotation[k] = rotation[k];
});
source
share