Is it any way possible to show vertices of a mesh as ie. colored dots?
Thanks.
I'm going to answer part A here, I recommend splitting your question up into two questions makes the site more useful for when other people are searching for the same solutions.
A Mesh has a Geometry and a Geometry has an array of Vertices.
From Mesh documentation.
Properties
.geometry
An instance of Geometry, defining the object's structure.
From Geometry documentation.
Properties
.vertices
Array of vertices. The array of vertices holds every position of points in the model. To signal an update in this array, Geometry.verticesNeedUpdate needs to be set to true.
To draw the vertices you can create a billboard particle at each one. Below is a slight altered version of the billboard particle example.
//editGeometry = the geometry who's vertices we want to show
geometry = new THREE.Geometry();
sprite = THREE.ImageUtils.loadTexture( "textures/sprites/disc.png" );
for ( i = 0; i < editGeometry.vertices.length; i ++ ) {
geometry.vertices.push(editGeometry.vertices[i]);
}
material = new THREE.PointCloudMaterial( { size: 35, sizeAttenuation: false, map: sprite, transparent: true } );
material.color.setHSL( 1.0, 0.3, 0.7 );
particles = new THREE.PointCloud( geometry, material );
particles.sortParticles = true;
scene.add( particles );
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With