// © XlXi 2021
// Graphictoria 5
import React, { useRef } from 'react';
import { Canvas, useFrame } from '@react-three/fiber';
import { Instances, Instance, PerspectiveCamera } from '@react-three/drei'
import SetTitle from "../Helpers/Title.js";
const randomVector = (r) => [r / 2 - Math.random() * r, r / 2 - Math.random() * r, r / 2 - Math.random() * r];
const randomEuler = () => [Math.random() * Math.PI, Math.random() * Math.PI, Math.random() * Math.PI];
const randomData = Array.from({ length: 500 }, (r = 100) => ({ random: Math.random(), position: randomVector(r), rotation: randomEuler() }));
let Buttons = [];
let ButtonsAlreadyTemplated = false;
function MakeButtons()
{
if(!ButtonsAlreadyTemplated)
{
ButtonsAlreadyTemplated = true;
let name = "Graphictoria";
for (var i = 0; i < name.length; i++) {
Buttons.push({id: i, value: name.charAt(i)});
}
}
}
function DoButton(position)
{
console.log(position);
}
function Box({ random, ...props }){
const ref = useRef()
useFrame((state) => {
const t = state.clock.getElapsedTime() + random * 10000
ref.current.rotation.set(Math.cos(t / 4) / 2, Math.sin(t / 4) / 2, Math.cos(t / 1.5) / 2)
ref.current.position.y = Math.sin(t / 1.5) / 2
});
return (