Skip to content

Commit 0dffca8

Browse files
authored
Merge pull request #131 from botmaster/doc/no-ref/Update-content
docs: Add Three.js content
2 parents fd9500c + 76db9a0 commit 0dffca8

4 files changed

Lines changed: 49 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/en/index.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,14 @@ More details on my :Icon{name='logos:linkedin-icon'} [LinkedIn profile](https://
5959
::Sheetelevation
6060
### Last experiments
6161

62+
#### 3D Model glTF animé
63+
[https://pascal-achard.com](https://pascal-achard.com)
64+
65+
::LazyExperienceContentWrapper
66+
::
67+
68+
3D experimentation with [Three.js](https://threejs.org/) and [Tres.js](https://tresjs.org/). Addition of an animated glTF 3D model (husky) to the home page of this site.
69+
6270
#### Zégut PG
6371
[https://zegut-pg.netlify.app/](https://zegut-pg.netlify.app/){target="_blank" rel="noopener"}
6472

content/fr/index.md

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

67+
#### 3D Model glTF animé
68+
[https://pascal-achard.com](https://pascal-achard.com)
69+
70+
::LazyExperienceContentWrapper
71+
::
72+
73+
Expérimentation 3D avec [Three.js](https://threejs.org/) et [Tres.js](https://tresjs.org/). Ajout d'un modèle 3D glTF animé (husky) sur la page d'accueil de ce site.
74+
6775
#### Zégut PG
6876
[https://zegut-pg.netlify.app/](https://zegut-pg.netlify.app/){target="_blank" rel="noopener"}
6977

0 commit comments

Comments
 (0)