Closed heoSuKyeong closed 8 months ago
You can multiply the coordinates by a rotation matrix. The math module isn't really documented, but there is a setRotationFromEuler
function if you need assistance creating a rotation matrix.
The rotation matrix was obtained through another method. But I'm not sure how to move the coordinates using that value.
atom.x = 10 atom.y = 20 atom.z = 30
Even if I enter arbitrary values, the atom does not move. Isn't this the way to approach it?
Did you render the scene after changing the coordinates?
I definitely did. I checked the coordinates before and after moving to the console. But it didn't move.
When calling render call it with the regen option set to true to force a rebuild of the geometry (the first argument is a callback function):
viewer.render(null, {regen: true});
Alternatively, if you have multiple models and only want to force a rebuilt on the model you are change, you can call removegl
on only that model.
Wow, it was solved in the same way as above. Thank you so much.
I want to select an atom and rotate it. Is there a function that can move the atom's coordinates?