Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
syui committed Oct 26, 2023
1 parent b7ff7ab commit 6e9df07
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions src/worker/scene/lights.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@ scene.background = new Color(bgColor);
scene.fog = new Fog(bgColor, 3, 10);

var targetIntensity = 1;
let card_time = 2.2;
let card_time = 17;
let date = new Date();
var num_h = date.getHours() * 0.1;
var num_hh = date.getHours();
var targetIntensity = num_h;

export let currentIntensity = 0;
Expand All @@ -24,7 +25,7 @@ scene.add(light);

// 紙吹雪
import * as THREE from 'three';
if (card_time == num_h){
function tick() {
let s_rot = 0;
let s_xp = 600;
let s_yp = 20;
Expand All @@ -35,7 +36,8 @@ if (card_time == num_h){
var color = "0x" + Math.floor(Math.random() * 16777215).toString(16);
let geometry = new THREE.PlaneGeometry( s_plane_scale, s_plane_scale );
let material = new THREE.MeshBasicMaterial({
color: Number(color),
color: 0x000000,
//color: Number(color),
opacity: 0.8,
transparent: true,
side: THREE.DoubleSide
Expand All @@ -46,6 +48,17 @@ if (card_time == num_h){
s_plane[i].position.z = s_yp * (Math.random() - 0.5);
scene.add(s_plane[i]);
}
//for(let i=0; i<s_length; i++){
// s_plane[i].rotation.y += (Math.random()*0.1);
// s_plane[i].rotation.x += (Math.random()*0.1);
// s_plane[i].rotation.z += (Math.random()*0.1);
//}
//requestAnimationFrame(tick);
}

console.log(card_time, num_h);
if (card_time == num_hh){
tick();
}

export function init(updater: Observable<number>) {
Expand Down

0 comments on commit 6e9df07

Please sign in to comment.