pandafulmanda / brainbrowser-minimal-example

Minimal BrainBrowser example, BrainBrowser -- https://brainbrowser.cbrain.mcgill.ca
0 stars 4 forks source link

Displacement map example #4

Open akeshavan opened 7 years ago

akeshavan commented 7 years ago

Would be great to do something like this! Try sliding the second-to-the bottom slider and see what happens to the shape!

https://threejs.org/examples/#webgl_materials_displacementmap

akeshavan commented 7 years ago

Ok, in theory I know how to do this.

mesh.geometry.dynamic = true;
mesh.geometry.vertices.forEach(function(val, idx, arr){
                        val.x = new_x_value
                        val.y = new_y_value
                        val.z = new_z_value
                      });
mesh.geometry.verticesNeedUpdate = true;

Where new_value is a linearly interpolate point between timepoint A & timepoint B. Its just a matter of generating the data & figuring out where to call this in BB