Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accessing Geometry Data from OBJLoader #5775

Closed
ekatzenstein opened this issue Dec 17, 2014 · 5 comments
Closed

Accessing Geometry Data from OBJLoader #5775

ekatzenstein opened this issue Dec 17, 2014 · 5 comments
Labels

Comments

@ekatzenstein
Copy link

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.

@WestLangley
Copy link
Collaborator

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.

@mrdoob
Copy link
Owner

mrdoob commented Dec 17, 2014

If you really need Geometry you can do this:

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

@mrdoob mrdoob closed this as completed Dec 17, 2014
@ekatzenstein
Copy link
Author

Thanks gents. Sorry for the false alarm.

@ekatzenstein
Copy link
Author

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 notifications@github.com wrote:

Closed #5775 #5775.


Reply to this email directly or view it on GitHub
#5775 (comment).

@ekatzenstein
Copy link
Author

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 <
erick.katzenstein@gmail.com> 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 notifications@github.com wrote:

Closed #5775 #5775.


Reply to this email directly or view it on GitHub
#5775 (comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants