This commit is contained in:
Kseninia Mikhaylova 2024-06-05 18:06:30 +03:00
parent 738a621318
commit a7470d997b
3 changed files with 7 additions and 2 deletions

View File

@ -9,6 +9,7 @@ const controlsState = reactive({
maxDistance: 5, maxDistance: 5,
enablePan: false, enablePan: false,
enebleZoom: false, enebleZoom: false,
maxPolarAngle: (Math.PI / 2) - 0.02,
// distance: 3 // distance: 3
}) })

View File

@ -8,7 +8,7 @@ renderer.value.shadowMap.enabled = true
</script> </script>
<template> <template>
<TresMesh :position="[0, -1, 0]" :rotate-x="Math.PI * -0.5" receive-shadow cast-shadow> <TresMesh :position="[0, -1, 0]" :rotate-x="Math.PI * -0.5" receive-shadow cast-shadow>
<TresBoxGeometry :args="[3, 3, 0.05]" /> <TresBoxGeometry :args="[8, 8, 0.05]" />
<TresMeshStandardMaterial color="pink" /> <TresMeshStandardMaterial color="pink" />
</TresMesh> </TresMesh>
<Suspense> <Suspense>

View File

@ -16,10 +16,14 @@ box.getSize(size)
const box_size = [size.x, size.y, size.z] const box_size = [size.x, size.y, size.z]
scene.children.forEach((el:any) => {
el.castShadow = true
el.receiveShadow = true
});
</script> </script>
<template> <template>
<TresGroup> <TresGroup>
<TresMesh :position="center" cast-shadow receive-shadow> <TresMesh :position="center" cast-shadow receive-shadow v-if="false">
<TresBoxGeometry :args="box_size" /> <TresBoxGeometry :args="box_size" />
<TresMeshPhysicalMaterial :opacity="0" color="pink" :transparent="true" /> <TresMeshPhysicalMaterial :opacity="0" color="pink" :transparent="true" />
</TresMesh> </TresMesh>