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

Examples: Clean up. #21090

Merged
merged 1 commit into from
Jan 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions examples/js/utils/BufferGeometryUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -628,9 +628,9 @@ THREE.BufferGeometryUtils = {
*/
computeMorphedAttributes: function ( object ) {

if ( ! object.geometry.isBufferGeometry ) {
if ( object.geometry.isBufferGeometry !== true ) {

console.error( 'Geometry is not a BufferGeometry' );
console.error( 'THREE.BufferGeometryUtils: Geometry is not of type THREE.BufferGeometry.' );
return null;

}
Expand Down
37 changes: 4 additions & 33 deletions examples/jsm/helpers/VertexNormalsHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import {
var _v1 = new Vector3();
var _v2 = new Vector3();
var _normalMatrix = new Matrix3();
var _keys = [ 'a', 'b', 'c' ];

function VertexNormalsHelper( object, size, hex ) {

Expand All @@ -28,7 +27,8 @@ function VertexNormalsHelper( object, size, hex ) {

if ( objGeometry && objGeometry.isGeometry ) {

nNormals = objGeometry.faces.length * 3;
console.error( 'THREE.VertexNormalsHelper no longer supports Geometry. Use BufferGeometry instead.' );
return;

} else if ( objGeometry && objGeometry.isBufferGeometry ) {

Expand Down Expand Up @@ -75,37 +75,8 @@ VertexNormalsHelper.prototype.update = function () {

if ( objGeometry && objGeometry.isGeometry ) {

var vertices = objGeometry.vertices;

var faces = objGeometry.faces;

var idx = 0;

for ( var i = 0, l = faces.length; i < l; i ++ ) {

var face = faces[ i ];

for ( var j = 0, jl = face.vertexNormals.length; j < jl; j ++ ) {

var vertex = vertices[ face[ _keys[ j ] ] ];

var normal = face.vertexNormals[ j ];

_v1.copy( vertex ).applyMatrix4( matrixWorld );

_v2.copy( normal ).applyMatrix3( _normalMatrix ).normalize().multiplyScalar( this.size ).add( _v1 );

position.setXYZ( idx, _v1.x, _v1.y, _v1.z );

idx = idx + 1;

position.setXYZ( idx, _v2.x, _v2.y, _v2.z );

idx = idx + 1;

}

}
console.error( 'THREE.VertexNormalsHelper no longer supports Geometry. Use BufferGeometry instead.' );
return;

} else if ( objGeometry && objGeometry.isBufferGeometry ) {

Expand Down