2023-06-16 16:32:28 +02:00
|
|
|
/*********
|
|
|
|
* ZOGICE *
|
|
|
|
*********/
|
|
|
|
|
2023-06-28 17:55:44 +02:00
|
|
|
let zogice = 0
|
|
|
|
|
2023-06-16 16:32:28 +02:00
|
|
|
var barvaKrogleO = new THREE.Color();
|
|
|
|
barvaKrogleO.setHSL(Math.random(), 0.8, 0.5);
|
|
|
|
function novaKrogla () {
|
|
|
|
//var barvaKrogle = barvaKrogleO.clone();
|
|
|
|
var bId = IZBRAN == 0 ? 2 : 3
|
2023-06-28 17:55:44 +02:00
|
|
|
//console.log('id barve:', bId);
|
2023-06-16 16:32:28 +02:00
|
|
|
var barvaKrogle = new THREE.Color(barvnePalete[bId][barvnePaleteIdx[bId]]);
|
|
|
|
var mat = new THREE.MeshBasicMaterial({
|
|
|
|
color: barvaKrogle,
|
|
|
|
wireframe: true,
|
|
|
|
transparent: true
|
|
|
|
});
|
|
|
|
var velikost = 1 + Math.random() * 5;
|
|
|
|
var kroglaGeo = new THREE.SphereGeometry(velikost, 12, 12);
|
|
|
|
var krogla = new THREE.Mesh(kroglaGeo, mat);
|
|
|
|
|
|
|
|
krogla.position.x = (Math.random() - 1) * 200;
|
|
|
|
krogla.position.y = (Math.random() - 1) * 10;
|
|
|
|
krogla.position.z = (Math.random() - 1) * 300;
|
|
|
|
|
|
|
|
krogla.position.y -= 100;
|
|
|
|
krogla.position.x += 150;
|
|
|
|
krogla.position.z += 230; // gor/dol
|
|
|
|
|
|
|
|
|
|
|
|
//krogla.position.y += 200;
|
|
|
|
|
|
|
|
scene.add(krogla);
|
|
|
|
krogle.push(krogla);
|
2023-06-28 17:55:44 +02:00
|
|
|
|
|
|
|
setTimeout(() => {
|
|
|
|
scene.remove(krogla)
|
|
|
|
krogle.shift()
|
|
|
|
}, 4000)
|
2023-06-16 16:32:28 +02:00
|
|
|
}
|