|
@@ -60,9 +60,7 @@ class OBJExporter {
|
|
|
|
|
|
for ( let i = 0, l = vertices.count; i < l; i ++, nbVertex ++ ) {
|
|
for ( let i = 0, l = vertices.count; i < l; i ++, nbVertex ++ ) {
|
|
|
|
|
|
- vertex.x = vertices.getX( i );
|
|
|
|
- vertex.y = vertices.getY( i );
|
|
|
|
- vertex.z = vertices.getZ( i );
|
|
|
|
|
|
+ vertex.fromBufferAttribute( vertices, i );
|
|
|
|
|
|
// transform the vertex to world space
|
|
// transform the vertex to world space
|
|
vertex.applyMatrix4( mesh.matrixWorld );
|
|
vertex.applyMatrix4( mesh.matrixWorld );
|
|
@@ -80,8 +78,7 @@ class OBJExporter {
|
|
|
|
|
|
for ( let i = 0, l = uvs.count; i < l; i ++, nbVertexUvs ++ ) {
|
|
for ( let i = 0, l = uvs.count; i < l; i ++, nbVertexUvs ++ ) {
|
|
|
|
|
|
- uv.x = uvs.getX( i );
|
|
|
|
- uv.y = uvs.getY( i );
|
|
|
|
|
|
+ uv.fromBufferAttribute( uvs, i );
|
|
|
|
|
|
// transform the uv to export format
|
|
// transform the uv to export format
|
|
output += 'vt ' + uv.x + ' ' + uv.y + '\n';
|
|
output += 'vt ' + uv.x + ' ' + uv.y + '\n';
|
|
@@ -98,9 +95,7 @@ class OBJExporter {
|
|
|
|
|
|
for ( let i = 0, l = normals.count; i < l; i ++, nbNormals ++ ) {
|
|
for ( let i = 0, l = normals.count; i < l; i ++, nbNormals ++ ) {
|
|
|
|
|
|
- normal.x = normals.getX( i );
|
|
|
|
- normal.y = normals.getY( i );
|
|
|
|
- normal.z = normals.getZ( i );
|
|
|
|
|
|
+ normal.fromBufferAttribute( normals, i );
|
|
|
|
|
|
// transform the normal to world space
|
|
// transform the normal to world space
|
|
normal.applyMatrix3( normalMatrixWorld ).normalize();
|
|
normal.applyMatrix3( normalMatrixWorld ).normalize();
|
|
@@ -180,9 +175,7 @@ class OBJExporter {
|
|
|
|
|
|
for ( let i = 0, l = vertices.count; i < l; i ++, nbVertex ++ ) {
|
|
for ( let i = 0, l = vertices.count; i < l; i ++, nbVertex ++ ) {
|
|
|
|
|
|
- vertex.x = vertices.getX( i );
|
|
|
|
- vertex.y = vertices.getY( i );
|
|
|
|
- vertex.z = vertices.getZ( i );
|
|
|
|
|
|
+ vertex.fromBufferAttribute( vertices, i );
|
|
|
|
|
|
// transform the vertex to world space
|
|
// transform the vertex to world space
|
|
vertex.applyMatrix4( line.matrixWorld );
|
|
vertex.applyMatrix4( line.matrixWorld );
|