Skip to content

Commit

Permalink
Add stats
Browse files Browse the repository at this point in the history
  • Loading branch information
mbodge committed Oct 3, 2024
1 parent 059836b commit c17b31d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 42 deletions.
45 changes: 4 additions & 41 deletions apps/web/src/components/ThreeHero/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import * as THREE from 'three';
import { useRef, useMemo, useCallback, useState, useEffect, Suspense } from 'react';
import { Canvas, useFrame, useThree } from '@react-three/fiber';
import { Lightformer, Environment, Html, Center } from '@react-three/drei';
import { Lightformer, Environment, Html, Center, Stats } from '@react-three/drei';
import {
Physics,
RigidBody,
Expand Down Expand Up @@ -113,6 +113,7 @@ export default function Scene(): JSX.Element {
<Everything />
</Physics>
</Suspense>
<Stats />
</Canvas>
</div>
);
Expand Down Expand Up @@ -201,7 +202,6 @@ export function Everything(props) {
<Spikey />
<Play />
<Blobby />
<Blobby />
</group>
);
}
Expand All @@ -210,7 +210,7 @@ function Boxes({ count = 10 }) {
const instancedApi = useRef(null);
const { viewport } = useThree();
const vec = useMemo(() => new THREE.Vector3(), []);
const gravityEffect = 0.003;
const gravityEffect = 0.001;

const instances = useMemo(() => {
const temp = [];
Expand Down Expand Up @@ -258,48 +258,11 @@ function Boxes({ count = 10 }) {
);
}

/*
function Boxes({ count = 10 }: { count?: number }) {
const boxes = useMemo(
() =>
new Array(count).fill(null).map((_, index) => {
return (
<PhysicsMesh scale={0.5} gravityEffect={0.03} key={index}>
<Box />
</PhysicsMesh>
);
}),
[count],
);
return <group>{boxes}</group>;
}
function Balls({ count = 10 }: { count?: number }) {
const boxes = useMemo(
() =>
new Array(count).fill(null).map((_, index) => {
return (
<PhysicsMesh scale={0.25} gravityEffect={0.004} key={index}>
<mesh castShadow receiveShadow>
<sphereGeometry args={[0.25, 64, 64]} />
<meshPhysicalMaterial color={blue} />
</mesh>
</PhysicsMesh>
);
}),
[count],
);
return <group>{boxes}</group>;
}*/

function Balls({ count = 20 }) {
const instancedApi = useRef(null);
const { viewport } = useThree();
const vec = useMemo(() => new THREE.Vector3(), []);
const gravityEffect = 0.00005;
const gravityEffect = 0.00003;

const instances = useMemo(() => {
const temp = [];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import Card from 'apps/web/src/components/base-org/Card';
import Button from 'apps/web/src/components/base-org/Button';
import { ButtonVariants } from 'apps/web/src/components/base-org/Button/types';
import Link from 'next/link';
import { useCallback, useState, useRef, useEffect } from 'react';
import { useCallback, useRef } from 'react';
import cubes from './assets/cubes.webm';

export default function BuildAndRewardSection() {
Expand Down

0 comments on commit c17b31d

Please sign in to comment.