Skip to content

Commit 9e40ce7

Browse files
committed
docs: Add Three.js content
1 parent fd9500c commit 9e40ce7

3 files changed

Lines changed: 38 additions & 1 deletion

File tree

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<script setup lang="ts">
2+
import { TresCanvas } from '@tresjs/core'
3+
import {Mesh} from "three";
4+
const boxRef = ref<Mesh>()
5+
6+
function onRender() {
7+
if (boxRef.value) {
8+
boxRef.value.rotation.y += 0.01
9+
boxRef.value.rotation.x += 0.01
10+
}
11+
}
12+
</script>
13+
14+
<template>
15+
<div class="w-full aspect-video">
16+
<TresCanvas :clear-alpha="0" :antialias="false" @render="onRender">
17+
18+
<TresPerspectiveCamera
19+
:position="[4.3, 3.2, 6]"
20+
:look-at="[0, 2.5, 0]"
21+
/>
22+
<TresAmbientLight :intensity="1" />
23+
<TresDirectionalLight :position="[5, 10, 5]" :intensity="2" />
24+
<TresDirectionalLight :position="[-5, 5, 0]" :intensity="1.2" color="blue" />
25+
<TresMesh ref="boxRef" :position="[0, 3, 0]">
26+
<TresBoxGeometry :args="[2.5,2.5,2.5]" />
27+
<TresMeshNormalMaterial />
28+
</TresMesh>
29+
<ContactShadows :opacity="0.5" :scale="10" :blur="2" :far="10" />
30+
</TresCanvas>
31+
</div>
32+
</template>

components/tres/TheExperience.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ import TheDog from './TheDog.vue'
1515
<Environment preset="sunset" :background="false" :blur="1" />
1616
</Suspense>
1717
<TheDog />
18-
<!-- Render the animated model here -->
18+
<ContactShadows :opacity="0.5" :scale="10" :blur="2" :far="10" />
1919
</template>

content/fr/index.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,11 @@ Plus de détails sur mon profil :Icon{name='logos:linkedin-icon'} [LinkedIn](htt
6464
::Sheetelevation
6565
### Dernières expérimentations
6666

67+
#### Three.js + Tres.js + Vue 3 + Vite
68+
69+
::LazyExperienceContentWrapper
70+
::
71+
6772
#### Zégut PG
6873
[https://zegut-pg.netlify.app/](https://zegut-pg.netlify.app/){target="_blank" rel="noopener"}
6974

0 commit comments

Comments
 (0)