How to use the GeometryUtils function from three

Find comprehensive JavaScript three.GeometryUtils code examples handpicked from public code repositorys.

185
186
187
188
189
190
191
192
193
194
// // sphere geometry
// var sphereGeometry = new THREE.SphereGeometry(5, 10, 10);

// // point cloud of models
// var particleCount = 1000;
// var points = THREE.GeometryUtils.randomPointsInGeometry( sphereGeometry, particleCount );

// var data = new Float32Array( particleCount * 4 );
// for ( var i = 0, j = 0, l = data.length; i < l; i += 4, j += 1 ) {
//     data[ i ] = points[ j ].x;
fork icon5
star icon23
watch icon3

+ 2 other calls in file

100
101
102
103
104
105
106
107
108
MeshFactory.mergeMeshes = function(geoms) {
  var geometry;

  geometry = new THREE.Geometry();
  _(geoms).each(function(geom) {
    return THREE.GeometryUtils.merge(geometry, geom);
  });
  return geometry;
};
fork icon0
star icon2
watch icon3

100
101
102
103
104
105
106
107
108
109
/*var meshMaterial = new THREE.MeshBasicMaterial( {color: 0x0000ff} );
var mesh  = new THREE.Mesh(textGeo, meshMaterial );
scene.add( mesh );*/
var data = new Float32Array( fboWidth * fboHeight * 3 );
//var points = THREE.GeometryUtils.randomPointsInGeometry( textGeo, data.length / 3 );
var points = THREE.GeometryUtils.randomPointsInGeometry( textGeo, data.length / 3 );
for ( var i = 0, j = 0, l = data.length; i < l; i += 3, j += 1 ) {
    data[ i ] = points[ j ].x;
    data[ i + 1 ] = points[ j ].y;
    data[ i + 2 ] = points[ j ].z;
fork icon0
star icon0
watch icon2

+ 7 other calls in file

71
72
73
74
75
76
77
78
79
80

});

textGeo.applyMatrix( new THREE.Matrix4().makeTranslation( -0.9, 0, 0.2 ) );

points = THREE.GeometryUtils.randomPointsInGeometry( textGeo, data.length / 3 );

for ( var i = 0, j = 0, l = data.length; i < l; i += 3, j += 1 ) {

  data[ i ] = points[ j ].x;
fork icon0
star icon0
watch icon2

Other functions in three

Sorted by popularity

function icon

three.Vector3 is the most popular function in three (22341 examples)