replace primitive to object 3d in model item

This commit is contained in:
Kseninia Mikhaylova 2024-06-28 09:25:07 +03:00
parent b88823cb6e
commit be33ea5dd1
1 changed files with 2 additions and 6 deletions

View File

@ -37,7 +37,7 @@ type vectorType = 'x' | 'y' | 'z';
onLoop(() => {
if (model.value && target.value) {
axis.forEach(element => {
if(target.value) {
if (target.value) {
const point = model.value.position[element.axis]
let step = stepbase * target.value[element.axis as vectorType]
if (step !== 0) {
@ -60,10 +60,6 @@ watch(props, () => {
</script>
<template>
<Suspense>
<TresGroup>
<TresGroup :position="(props.position || [0, 0, 0])" ref="model">
<primitive :object="scene.children[0]" />
</TresGroup>
</TresGroup>
<TresObject3D :object="scene.children[0]" :position="(props.position || [0, 0, 0])" ref="model" />
</Suspense>
</template>