Created
March 2, 2021 12:26
-
-
Save BABAK0T0/0a073bad5746ca3f081cf0aa8f5d1d43 to your computer and use it in GitHub Desktop.
Revisions
-
BABAK0T0 created this gist
Mar 2, 2021 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,22 @@ const objs = new THREE.Group(); const minRadius = 3; const maxRadius = 6; for(let i = 0; i < 50; i++) { const angle = Math.random() * Math.PI * 2; // Random angle const radius = minRadius + Math.random() * maxRadius; // Random radius between [3,9] const x = Math.cos(angle) * radius; // Get the x position using cosinus const z = Math.sin(angle) * radius; // Get the z position using sinus // Create the mesh const mesh = new THREE.Mesh(objGeometry, objMaterial); // Position mesh.position.set(x, 0, z); // Add to the graves container objs.add(mesh) } scene.add(objs)