cnr-isti-vclab / nexus

Nexus is a c++/javascript library for creation and visualization of a batched multiresolution mesh
GNU General Public License v3.0
218 stars 89 forks source link

gemtory.center not works #28

Closed dragonpoint closed 6 years ago

dragonpoint commented 6 years ago

When the NexusObject is created I want to center the model to (0,0,0) position so I called nexus_obj.geometry.center() function and it's not work as I expected. If I use threejs default obj loader and center the geometry after the obj is loaded every thing is ok

ponchio commented 6 years ago

geometry.center() function modify the data in the BufferGeometry Since nexus loads and unloads remote geometry, the function won't work (and I would rather change the object matrix anyway).

Use position and scale to center the object.

I have modified the code with an example (and changed the constructor a bit).

dragonpoint commented 6 years ago

Thanks a lot