-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
100 additions
and
66 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { FC, useRef } from "react"; | ||
import * as THREE from "three"; | ||
import { StructureModel } from "./models/StructureModel"; | ||
import { EnvelopeModel } from "./models/EnvelopeModel"; | ||
import { UIPanelModel } from "./models/UIPanelModel"; | ||
import { PizzaIconModel } from "./models/PizzaIconModel"; | ||
import { CheeseBurgerIconModel } from "./models/CheeseBurgerIconModel"; | ||
|
||
const baseXPosition = 0; | ||
const baseYPosition = 0; | ||
|
||
const rotation = new THREE.Euler(0, Math.PI / 5, 0); | ||
|
||
let position: THREE.Vector3, scale: number; | ||
|
||
export const TechStack: FC = () => { | ||
const ref = useRef<THREE.Group>(null!); | ||
position = new THREE.Vector3(baseXPosition, baseYPosition, 0); | ||
scale = 10; | ||
|
||
return ( | ||
<group ref={ref} position={position} rotation={rotation} scale={scale}> | ||
<StructureModel /> | ||
<UIPanelModel /> | ||
<PizzaIconModel /> | ||
<CheeseBurgerIconModel /> | ||
<EnvelopeModel /> | ||
</group> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { FC } from "react"; | ||
|
||
import { useGLTF } from "@react-three/drei"; | ||
|
||
export const CheeseBurgerIconModel: FC = () => { | ||
const { scene } = useGLTF("/assets/cheeseburger-icon.glb"); | ||
|
||
return <primitive object={scene} />; | ||
}; | ||
|
||
useGLTF.preload("/assets/cheeseburger-icon.glb"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { FC } from "react"; | ||
|
||
import { useGLTF } from "@react-three/drei"; | ||
|
||
export const EnvelopeModel: FC = () => { | ||
const { scene } = useGLTF("/assets/envelope.glb"); | ||
|
||
return <primitive object={scene} />; | ||
}; | ||
|
||
useGLTF.preload("/assets/envelope.glb"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { FC } from "react"; | ||
|
||
import { useGLTF } from "@react-three/drei"; | ||
|
||
export const PizzaIconModel: FC = () => { | ||
const { scene } = useGLTF("/assets/pizza-icon.glb"); | ||
|
||
return <primitive object={scene} />; | ||
}; | ||
|
||
useGLTF.preload("/assets/pizza-icon.glb"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { FC, useEffect } from "react"; | ||
import { useThree } from "@react-three/fiber"; | ||
import { useGLTF } from "@react-three/drei"; | ||
|
||
export const StructureModel: FC = () => { | ||
const { scene, cameras } = useGLTF("/assets/structure.glb"); | ||
const { set, camera } = useThree(); | ||
|
||
useEffect(() => { | ||
if (cameras.length > 0) { | ||
const glbCamera = cameras[0] as any; | ||
set({ camera: glbCamera }); | ||
} | ||
}, [cameras, set, camera]); | ||
|
||
return <primitive object={scene} />; | ||
}; | ||
|
||
useGLTF.preload("/assets/structure.glb"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { FC } from "react"; | ||
|
||
import { useGLTF } from "@react-three/drei"; | ||
|
||
export const UIPanelModel: FC = () => { | ||
const { scene } = useGLTF("/assets/ui-panel.glb"); | ||
|
||
return <primitive object={scene} />; | ||
}; | ||
|
||
useGLTF.preload("/assets/ui-panel.glb"); |