Hello,
I am using Image targets to place a Depthkit object in 8th wall, but my object does not stay at the same place when I move my device, it changes position around the image when I move my phone.
I am using a script similar to the following project:
three.js: Image Targets Flyer | 8th Wall | 8th Wall
When I replace the Depthkit object by the jelly fish model from the above template in my project, everything works fine and the object does not move when I move the device.
Here is a part of my code:
" const showTarget = ({detail}) => {
if (detail.name === ‘video-target’) {
depthkit.position.copy(detail.position)
depthkit.quaternion.copy(detail.rotation)
depthkit.scale.set(detail.scale = 20, detail.scale = 20, detail.scale = 20)
depthkit.video.muted = false
depthkit.visible = true
depthkit.video.play()
}
}"
I noticed that on the line “depthkit.scale.set”, when I update the last parameter as follows:
“depthkit.scale.set(detail.scale = 20, detail.scale = 20, detail.scale = 1)”, there is no issue anymore and the object stops moving when moving the device (but the object looks flat).
Is there a way to prevent the object from moving, without getting a flat object?
I posted my issue in the 8th wall forum, but didn’t get a resolution so far, so I am also posting here for help to solve this issue. The issue seems related to the Depthkit object because the project works well with other objects.
Thank you.