Transforming Geometry to BufferGeometry

2019-03-09 19:13发布

As I understand it, Geometry stores a javascript object structure of the vertices and faces and BufferGeometry just stores the raw gl data via Float32Arrays, etc.

Is there any way to turn standard Geometry into BufferGeometry, which is a lot more memory compact with less objects? For example if I create a new SphereGeometry, is there a way to easily transform that to a BufferGeometry?

1条回答
Ridiculous、
2楼-- · 2019-03-09 19:48

You are in luck.

var bufferGeometry = new THREE.BufferGeometry().fromGeometry( geometry );

EDIT: updated to three.js r.76

查看更多
登录 后发表回答