You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
930 B
JavaScript

/* Copyright (C) 2024 Sebastián Santisi <ssantisi@fi.uba.ar>, CSC-CONICET */
// Unused module, wind cone.
var geometry = new THREE.CylinderGeometry(0.09, 0.03, 0.5, 10, 5, true);
geometry = geometry.toNonIndexed();
var colors = new three.BufferAttribute(new Float32Array(geometry.attributes.position.array.length), 3);
geometry.setAttribute('color', colors);
for(var i = 0; i < colors.count; i++) {
if((Math.trunc(i / 6) + Math.trunc(i / 30) % 2) % 2)
colors.setXYZ(i, 1, 1, 1);
else
colors.setXYZ(i, 1, 0.3, 0);
}
var material = new THREE.MeshBasicMaterial({vertexColors: true, side: THREE.DoubleSide});
var mesh = new THREE.Mesh(geometry, material);
mesh.position.z = 1;
mesh.position.x = 9.5;
mesh.position.y = 0.5;
mesh.rotation.z = -Math.PI / 2;
var cone = mesh;
scene.add(mesh);
/*
cone.rotation.y = 0.1 * Math.sin(Date.now() / 1000);
cone.rotation.x = 0.08 * Math.sin(Date.now() / 5000);
*/