I’m trying to generate individual ice floes for a small low-poly game. I thought I could do this based on a cylinder, but unfortunately I don’t have the experience to know what values I need to use.
Or is there a better way?
let icefloeGeometry = new THREE.CylinderGeometry(0.3, 0.3, 0.5);
// some code to deform???
//
let icefloeMaterial = new THREE.MeshStandardMaterial({ color: 0xdfe0f2, shading: THREE.FlatShading,});
let icefloeBase = new THREE.Mesh(icefloeGeometry, icefloeMaterial);
icefloeBase.position.y = 0.25;
let icefloe = new THREE.Object3D();
icefloe.add(icefloeBase);
let icefloeGeometry = new THREE.CylinderGeometry(0.3, 0.3, 0.5,12,12);
let vertices = icefloeGeometry.attributes.position.array;
for(let i=0;i<vertices.length;i++)
vertices[i]+=(Math.random()*.1)-.05; //Add some randomness to all verts
icefloeGeometry.computeVertexNormals();
I’m not sure whether there are tutorials, maybe there are some somewhere. Most people learn by experimenting. Later on, I might draft a quick demo with the cylinder. Meanwhile, it might be possible to use convex geometry instead of cylinder.
Edit: here it is with a cylinder, the low-poliness can be controlled by LOW_POLY_COUNT in line 44: