0
votes

I'm facing a problem after using THREE.GeometeryUtils.center(geometry) function, Succesfully i center the mesh to screen center position using this function, my problem is, i need to get back the original vertices value that presented in geometry before centering. Please give your valuable suggestion

Thanks in advance.

2
Some code might help. It just might.Overcode

2 Answers

0
votes

you can do this :

  • Compute the center of your geometry.
  • Save this center in a vector3.
  • Center your geometry in the scene.
  • Apply a translation toward saved vector3 to restore its original position
0
votes

How about cloning the vertices before the merge operation ?

var oldVerts = [].concat(geometry.vertices);
THREE.GeometeryUtils.center(geometry);