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