Three.js: Accessing Geometry Data from OBJLoader

Created on 17 Dec 2014  ·  5Comments  ·  Source: mrdoob/three.js

For some reason, I'm unable to access geometry data (geometry.face, geometry.vertices, etc) using OBJLoader. This data is available using OBJMTLLoader, but when I log the object to the console with OBJLoader, the properties aren't there are on the javascript object.

Question

Most helpful comment

Alright, I simply had to put "new" in front of "THREE.Geometry()":

var geometry = new THREE.Geometry().fromBufferGeometry( bufferGeometry );

On Wed, Dec 17, 2014 at 6:19 PM, Erick Katzenstein <
[email protected]> wrote:

This method seems to not be working, as I'm getting this error " Uncaught
TypeError: Cannot redefine property: id"

I assume I need to take this to stack overflow, just a heads up

On Wed, Dec 17, 2014 at 5:13 PM, Mr.doob [email protected] wrote:

Closed #5775 https://github.com/mrdoob/three.js/issues/5775.


Reply to this email directly or view it on GitHub
https://github.com/mrdoob/three.js/issues/5775#event-209249318.

All 5 comments

three.js is slowly transitioning from Geometry to BufferGeometry, which is more memory efficient and results in faster load times. Geometries returned by OBJLoader are now of type BufferGeometry.

If you really need Geometry you can do this:

var geometry = new THREE.Geometry().fromBufferGeometry( bufferGeometry );

Thanks gents. Sorry for the false alarm.

This method seems to not be working, as I'm getting this error " Uncaught
TypeError: Cannot redefine property: id"

I assume I need to take this to stack overflow, just a heads up

On Wed, Dec 17, 2014 at 5:13 PM, Mr.doob [email protected] wrote:

Closed #5775 https://github.com/mrdoob/three.js/issues/5775.


Reply to this email directly or view it on GitHub
https://github.com/mrdoob/three.js/issues/5775#event-209249318.

Alright, I simply had to put "new" in front of "THREE.Geometry()":

var geometry = new THREE.Geometry().fromBufferGeometry( bufferGeometry );

On Wed, Dec 17, 2014 at 6:19 PM, Erick Katzenstein <
[email protected]> wrote:

This method seems to not be working, as I'm getting this error " Uncaught
TypeError: Cannot redefine property: id"

I assume I need to take this to stack overflow, just a heads up

On Wed, Dec 17, 2014 at 5:13 PM, Mr.doob [email protected] wrote:

Closed #5775 https://github.com/mrdoob/three.js/issues/5775.


Reply to this email directly or view it on GitHub
https://github.com/mrdoob/three.js/issues/5775#event-209249318.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Horray picture Horray  ·  3Comments

makc picture makc  ·  3Comments

boyravikumar picture boyravikumar  ·  3Comments

seep picture seep  ·  3Comments

ghost picture ghost  ·  3Comments