-
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
1 parent
556d0cd
commit 6e527ac
Showing
8 changed files
with
139 additions
and
2 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,71 @@ | ||
import { Environment, Lightformer } from "@react-three/drei"; | ||
import { Canvas, useFrame } from "@react-three/fiber"; | ||
import { Physics } from "@react-three/rapier"; | ||
import { useRef } from "react"; | ||
import { Euler, Vector3, type Mesh } from "three"; | ||
import * as THREE from "three"; | ||
const Earth = () => { | ||
const meshRef = useRef<Mesh>(null); | ||
|
||
useFrame(() => { | ||
if (!meshRef.current) { | ||
return; | ||
} | ||
|
||
meshRef.current.rotation.y += 0.01; | ||
}); | ||
|
||
return ( | ||
<mesh ref={meshRef}> | ||
<sphereGeometry args={[3, 11, 9]} /> | ||
<meshStandardMaterial color="blue" /> | ||
</mesh> | ||
); | ||
}; | ||
|
||
const Airplane = () => { | ||
const meshRef = useRef<Mesh>(null); | ||
|
||
useFrame(({ clock }) => { | ||
if (!meshRef.current) { | ||
return; | ||
} | ||
|
||
const radius = 3.5; | ||
const speed = 1; | ||
const angle = clock.getElapsedTime() * speed; | ||
const x = Math.cos(angle) * radius; | ||
const z = Math.sin(angle) * radius; | ||
meshRef.current.position.set(x, 0, z); | ||
// meshRef.current.rotateOnWorldAxis(new Vector3(0, 1, 0), 0.01); | ||
}); | ||
|
||
return ( | ||
<mesh ref={meshRef} rotation={[0, 0, Math.PI / 2]}> | ||
<coneGeometry args={[0.5, 1.5, 6]} /> | ||
<meshStandardMaterial color="red" /> | ||
</mesh> | ||
); | ||
}; | ||
|
||
export default function Globe() { | ||
return ( | ||
<Canvas | ||
style={{ | ||
height: "500px", | ||
}} | ||
camera={{ position: [0, 0, 5], fov: 120 }} | ||
> | ||
<ambientLight intensity={0.5} /> | ||
<directionalLight | ||
position={[2, 2, -5]} | ||
intensity={1} | ||
castShadow | ||
shadow-mapSize-width={1024} | ||
shadow-mapSize-height={1024} | ||
/> | ||
<Earth /> | ||
<Airplane /> | ||
</Canvas> | ||
); | ||
} |
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,43 @@ | ||
--- | ||
title: "비행기 안에서" | ||
description: "" | ||
author: "Yongseok" | ||
categories: ["life"] | ||
date: "2024-05-10 18:46" | ||
series: "미국 여행기" | ||
--- | ||
import Globe from '../../components/animation/three/Globe' | ||
|
||
|
||
|
||
고도 33,000피트 태평양 상공 어딘가에서\ | ||
와이파이를 쓸 수 있을 줄 몰랐다. 잔뜩 오프라인 저장 해온 유튜브 영상들이 무색해졌다. | ||
|
||
비행중에 커밋 한줄 남겨보고자 글을 써보고 있다. | ||
|
||
<figure> | ||
<img src="/post/images/비행기안에서/airplane_1.jpeg" /> | ||
<figcaption>창문이 닫히기 전</figcaption> | ||
</figure> | ||
|
||
노이즈 캔슬링 까지 장착하고나니. 그냥 고요하고 좁은 카페가 되었다.\ | ||
다만 16인치를 펼치기엔 너무 비좁다. | ||
|
||
방금 앞 자리 사람이 등받이를 젖혀서 노트북을 하기엔 더 비좁아져버렸다. | ||
|
||
<figure> | ||
<img src="/post/images/비행기안에서/airplane_3.jpeg" /> | ||
<figcaption>조만간 닫고 한숨 자야겠다.</figcaption> | ||
</figure> | ||
|
||
|
||
<Globe client:only="react" /> | ||
|
||
좁은 자리에서 지구와 비행기를 표현..해봤다. 너무 힘들어서 한숨 자야겠다. | ||
|
||
|
||
|
||
<figure> | ||
<img src="/post/images/비행기안에서/airplane_2.jpeg" /> | ||
<figcaption>그라데이션이 정말 이쁘다</figcaption> | ||
</figure> |
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 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 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