-
-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: render html from tres back to vue app * feat: correct objectScale and calculatePosition * feat: transform html * feat: add px to style transforms * feat: first attempt of occlussion * feat: fixed occlussion * feat: update html to new `useContextProvider` * feat: occlude works 🥳🎉 * docs: html page * docs: html examples * chore: update lock * chore: updated lock with docs * fix: build issue Stats * fix: add will change trasnform to force GPU * chore: lock update * docs: scroll control demo remove console * docs: temp * docs: why is broken idg * chore: remove console logs * docs: add client only again * docs: props table * chore: updated lint * chore: added rule override and fix Sky * chore: move html transform utils to its own file * chore: fixed lint issue on utils * chore: html shaders to glsl files * chore: disposal of shaderMaterial * chore: added vite-plugin-glsl for build * chore: install correct deps * chore: fix lint misc routes * docs: added geometry and material props to html * chore: components playground dts
- Loading branch information
1 parent
16710ca
commit 3a488f0
Showing
27 changed files
with
1,545 additions
and
857 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<script setup lang="ts"> | ||
import { TresCanvas } from '@tresjs/core' | ||
import { BasicShadowMap, SRGBColorSpace, NoToneMapping } from 'three' | ||
import { OrbitControls, Html } from '@tresjs/cientos' | ||
import { reactive } from 'vue' | ||
const gl = { | ||
clearColor: '#82DBC5', | ||
shadows: true, | ||
alpha: false, | ||
shadowMapType: BasicShadowMap, | ||
outputColorSpace: SRGBColorSpace, | ||
toneMapping: NoToneMapping, | ||
} | ||
</script> | ||
|
||
<template> | ||
<TresCanvas v-bind="gl"> | ||
<TresPerspectiveCamera :position="[3, 3, 8]" /> | ||
<OrbitControls /> | ||
<TresMesh :position="[1, 1, 1]"> | ||
<TresBoxGeometry /> | ||
<TresMeshNormalMaterial /> | ||
<Html | ||
center | ||
transform | ||
:distance-factor="4" | ||
:position="[0, 0, 0.65]" | ||
:scale="[0.75, 0.75, 0.75]" | ||
> | ||
<h1 class="bg-white dark:bg-dark text-xs p-1 rounded"> | ||
I'm a Box 📦 | ||
</h1> | ||
</Html> | ||
</TresMesh> | ||
<TresGridHelper /> | ||
<TresAmbientLight :intensity="1" /> | ||
</TresCanvas> | ||
</template> |
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,61 @@ | ||
<script setup lang="ts"> | ||
import { TresCanvas } from '@tresjs/core' | ||
import { BasicShadowMap, SRGBColorSpace, NoToneMapping } from 'three' | ||
import { OrbitControls, Html, useGLTF, Levioso, ContactShadows } from '@tresjs/cientos' | ||
const gl = { | ||
clearColor: '#241a1a', | ||
shadows: true, | ||
alpha: false, | ||
shadowMapType: BasicShadowMap, | ||
outputColorSpace: SRGBColorSpace, | ||
toneMapping: NoToneMapping, | ||
} | ||
const { nodes } | ||
= await useGLTF('https://vazxmixjsiawhamofees.supabase.co/storage/v1/object/public/models/macbook/model.gltf', | ||
{ draco: true }, | ||
) | ||
</script> | ||
|
||
<template> | ||
<TresCanvas v-bind="gl"> | ||
<TresPerspectiveCamera :position="[-5, 4, 3]" /> | ||
<OrbitControls /> | ||
|
||
<primitive :object="nodes.Macbook"> | ||
<Html | ||
transform | ||
wrapper-class="webpage" | ||
:distance-factor="11" | ||
:position="[0, 10.5, -13.6]" | ||
occlude | ||
:rotation-x="-0.256" | ||
> | ||
<iframe | ||
class="rounded-lg w-[1024px] h-[670px]" | ||
src="https://tresjs.org" | ||
frameborder="0" | ||
/> | ||
</Html> | ||
</primitive> | ||
|
||
<ContactShadows | ||
:blur="3.5" | ||
:resolution="512" | ||
:opacity="1" | ||
/> | ||
<TresAmbientLight :intensity="1" /> | ||
<TresDirectionalLight | ||
:intensity="2" | ||
:position="[2, 3, 0]" | ||
:cast-shadow="true" | ||
:shadow-camera-far="50" | ||
:shadow-camera-left="-10" | ||
:shadow-camera-right="10" | ||
:shadow-camera-top="10" | ||
:shadow-camera-bottom="-10" | ||
/> | ||
</TresCanvas> | ||
</template> |
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,57 @@ | ||
<script setup lang="ts"> | ||
import { TresCanvas } from '@tresjs/core' | ||
import { BasicShadowMap, SRGBColorSpace, NoToneMapping } from 'three' | ||
import { OrbitControls, Html } from '@tresjs/cientos' | ||
import { reactive, ref } from 'vue' | ||
const gl = { | ||
clearColor: '#82DBC5', | ||
shadows: true, | ||
alpha: false, | ||
shadowMapType: BasicShadowMap, | ||
outputColorSpace: SRGBColorSpace, | ||
toneMapping: NoToneMapping, | ||
} | ||
const sphereRef = ref(null) | ||
</script> | ||
|
||
<template> | ||
<TresCanvas v-bind="gl"> | ||
<TresPerspectiveCamera :position="[3, 3, 8]" /> | ||
<OrbitControls /> | ||
<TresMesh :position="[1, 1, 1]"> | ||
<TresBoxGeometry /> | ||
<TresMeshNormalMaterial /> | ||
<Html | ||
center | ||
transform | ||
:occlude="[sphereRef]" | ||
:distance-factor="4" | ||
> | ||
<h1 class="bg-white dark:bg-dark text-xs p-1 rounded"> | ||
Move camera | ||
</h1> | ||
</Html> | ||
</TresMesh> | ||
<TresMesh | ||
ref="sphereRef" | ||
:position="[3, 1, 1]" | ||
> | ||
<TresSphereGeometry /> | ||
<TresMeshNormalMaterial /> | ||
<Html | ||
center | ||
transform | ||
:distance-factor="4" | ||
> | ||
<h1 class="bg-white dark:bg-dark text-xs p-1 rounded"> | ||
Sphere | ||
</h1> | ||
</Html> | ||
</TresMesh> | ||
<TresGridHelper /> | ||
<TresAmbientLight :intensity="1" /> | ||
</TresCanvas> | ||
</template> |
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
Oops, something went wrong.