first commit

This commit is contained in:
2024-03-20 00:12:01 +03:00
commit 1e0ab27b74
148 changed files with 12934 additions and 0 deletions

View File

@@ -0,0 +1,19 @@
import * as THREE from 'three';
export type InitThreeOptions = {
width: number;
height: number;
};
export function initThree(
canvas: HTMLCanvasElement,
{ width, height }: InitThreeOptions
) {
const renderer = new THREE.WebGLRenderer({ canvas, antialias: true });
renderer.setSize(width, height);
renderer.setPixelRatio(window.devicePixelRatio);
const clock = new THREE.Clock();
return { renderer, clock };
}