This repository was archived by the owner on Feb 1, 2026. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathon-demand.vue
More file actions
53 lines (45 loc) · 1.28 KB
/
on-demand.vue
File metadata and controls
53 lines (45 loc) · 1.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<script setup lang="ts">
import { OrbitControls } from '@tresjs/cientos'
import { TresCanvas } from '@tresjs/core'
import { EffectComposerPmndrs, PixelationPmndrs } from '@tresjs/post-processing'
import { ref } from 'vue'
import GraphPane from '../../components/GraphPane.vue'
import { useState } from '../../composables/state'
const { renderingTimes } = useState()
function onRender() {
renderingTimes.value = 1
}
const canvas = ref<InstanceType<typeof TresCanvas>>()
</script>
<template>
<GraphPane />
<TresCanvas
ref="canvas"
render-mode="on-demand"
clear-color="#c0ffee"
>
<TresPerspectiveCamera
:position="[5, 5, 5]"
:look-at="[0, 0, 0]"
/>
<OrbitControls />
<TresMesh
:position="[-3.5, 1, 0]"
>
<TresConeGeometry :args="[1.25, 2, 4, 1, false, Math.PI * 0.25]" />
<TresMeshNormalMaterial />
</TresMesh>
<TresMesh :position="[0, 1, 0]">
<TresBoxGeometry :args="[2, 2, 2]" />
<TresMeshNormalMaterial />
</TresMesh>
<TresMesh :position="[3.5, 1, 0]">
<TresSphereGeometry />
<TresMeshNormalMaterial />
</TresMesh>
<TresGridHelper />
<EffectComposerPmndrs @render="onRender">
<PixelationPmndrs :granularity="10" />
</EffectComposerPmndrs>
</TresCanvas>
</template>