File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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 >
Original file line number Diff line number Diff 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 >
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments