Skip to content
Branch: master
Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
..
Failed to load latest commit information.
ref
textures
README.md
index.html
points.js

README.md

day 015


No Interactions for this one

project link

three.js, GLSL

怒发冲冠,凭栏处,潇潇雨歇。

The tension is palpable.
Our hearts best steadily for now
But are our minds at ease?

learned today

Mar 27th 2017

Found the relationship in the array data structure in three js geometry object.


var positions = new Float32Array(vertices.length * 3);
var colors = new Float32Array(vertices.length * 3);
var sizes = new Float32Array(vertices.length);

Main Code I use in this code

  • In the loop function, using gap to iterate through the particles in series.

var gap = 100;
for (var i = 0; i < attributes.size.array.length; i++) {
    if (i >= counter * gap && i <= (counter + 1) * gap) {
        attributes.size.array[i] = PARTICLE_SIZE * 2.1;
        attributes.size.needsUpdate = true;
    }else{
      attributes.size.array[i] = PARTICLE_SIZE * 0.5;
      attributes.size.needsUpdate = true;
    }

}
  • Using javaScript concat() method with BoxGeometry in three js, creating multiple layers of points.

var vertices = geometry1.vertices.concat(geometry2.vertices.concat(geometry3.vertices));
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.