Skip to content

Commit

Permalink
Bump build
Browse files Browse the repository at this point in the history
  • Loading branch information
dmarcos committed Mar 27, 2021
1 parent a21a039 commit 11faeab
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
10 changes: 4 additions & 6 deletions components/atlas-uvs/dist/aframe-atlas-uvs-component.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,9 @@ AFRAME.registerComponent('atlas-uvs', {
var uvs = getGridUvs(data.row - 1, data.column - 1, data.totalRows, data.totalColumns);

var geometry = this.el.getObject3D('mesh').geometry;
geometry.faceVertexUvs[0][0][0].copy(uvs[0]);
geometry.faceVertexUvs[0][0][1].copy(uvs[1]);
geometry.faceVertexUvs[0][0][2].copy(uvs[3]);
geometry.faceVertexUvs[0][1][0].copy(uvs[1]);
geometry.faceVertexUvs[0][1][1].copy(uvs[2]);
geometry.faceVertexUvs[0][1][2].copy(uvs[3]);

var float32Array = new Float32Array([uvs[0].x, uvs[0].y, uvs[3].x, uvs[3].y, uvs[1].x, uvs[1].y, uvs[2].x, uvs[2].y]);
geometry.setAttribute('uv', new THREE.BufferAttribute(float32Array, 2));
geometry.uvsNeedUpdate = true;
}
});
Expand Down Expand Up @@ -169,6 +166,7 @@ function getGridUvs(row, column, totalRows, totalColumns) {
var columnWidth = 1 / totalColumns;
var rowHeight = 1 / totalRows;

// create a Map called `uvs` to hold the 4 UV pairs
uvs[0].set(columnWidth * column, rowHeight * row + rowHeight);
uvs[1].set(columnWidth * column, rowHeight * row);
uvs[2].set(columnWidth * column + columnWidth, rowHeight * row);
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 11faeab

Please sign in to comment.