Skip to content

Commit

Permalink
clean up sketch
Browse files Browse the repository at this point in the history
  • Loading branch information
setsun committed Jun 29, 2023
1 parent 4315212 commit 8d44be9
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 16 deletions.
41 changes: 26 additions & 15 deletions components/hero-scenes/WireframePlanet.tsx
Original file line number Diff line number Diff line change
@@ -1,33 +1,44 @@
import { PerspectiveCamera } from '@react-three/drei';
import { DoubleSide } from 'three';
import { useTurntable } from '../../hooks/useTurntable';

const WireframePlanet = () => {
const ringOneTurntable = useTurntable({ speed: 0.0001 });
const ringTwoTurntable = useTurntable({ speed: 0.0001 });
const planetTurntable = useTurntable({ speed: 0.0001, reverse: true });
const ringOneTurntable = useTurntable({ speed: 0.001, axis: 'x' });
const ringTwoTurntable = useTurntable({ speed: 0.001, axis: 'x', reverse: true });
const ringThreeTurntable = useTurntable({ speed: 0.001, axis: 'y' });
const ringFourTurntable = useTurntable({ speed: 0.001, axis: 'y', reverse: true });
const planetTurntable = useTurntable({ speed: 0.0025, axis: 'x', reverse: true });

return (
<>
{/* <PerspectiveCamera
makeDefault
args={[75, window.innerWidth / window.innerHeight, 0.01, 5000]}
position={[550, 325, -500]}
/> */}

<mesh rotation={[0, Math.PI / 2, 0]} ref={ringOneTurntable}>
<ringGeometry args={[15.5, 16, 100, 100]} />
<mesh rotation={[Math.PI / 2, 0, 0]} ref={ringOneTurntable}>
<ringGeometry args={[15.95, 16, 100, 100]} />
<meshBasicMaterial attach="material" color="white" side={DoubleSide} />
</mesh>

<mesh ref={ringTwoTurntable}>
<ringGeometry args={[15.5, 16, 100, 100]} />
<mesh rotation={[-Math.PI / 2, 0, 0]} ref={ringTwoTurntable}>
<ringGeometry args={[15.95, 16, 100, 100]} />
<meshBasicMaterial attach="material" color="white" side={DoubleSide} />
</mesh>

<mesh rotation={[0, -Math.PI / 2, 0]} ref={ringThreeTurntable}>
<ringGeometry args={[15.95, 16, 100, 100]} />
<meshBasicMaterial attach="material" color="white" side={DoubleSide} />
</mesh>

<mesh rotation={[0, Math.PI / 2, 0]} ref={ringFourTurntable}>
<ringGeometry args={[15.95, 16, 100, 100]} />
<meshBasicMaterial attach="material" color="white" side={DoubleSide} />
</mesh>

<mesh rotation={[0, 0, Math.PI / 2]}>
<ringGeometry args={[15.95, 16, 100, 100]} />
<meshBasicMaterial attach="material" color="white" side={DoubleSide} />
</mesh>


<mesh ref={planetTurntable}>
<dodecahedronGeometry args={[10, 10]} />
<meshBasicMaterial attach="material" color="#fff" wireframe />
<meshNormalMaterial attach="material" wireframe />
</mesh>
</>
)
Expand Down
7 changes: 6 additions & 1 deletion pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,12 @@ const Blog: React.FC<Props> = (props) => {
return (
<Layout>
<main>
<Canvas className="w-full aspect-video">
<Canvas
className="w-full aspect-video"
camera={{
position: [0, 0, -30]
}}
>
<WireframePlanet />
</Canvas>

Expand Down

1 comment on commit 8d44be9

@vercel
Copy link

@vercel vercel bot commented on 8d44be9 Jun 29, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

setsun-xyz – ./

www.setsun.xyz
setsun.xyz
setsun-xyz-git-main-setsun.vercel.app
setsun-xyz-setsun.vercel.app

Please sign in to comment.