8thwall / web

8th Wall Web projects and resources.
518 stars 326 forks source link

positioning is different depending on OS #210

Open jtsiaperas opened 1 year ago

jtsiaperas commented 1 year ago

The positioning of ar objects in 8th wall seems to be different whether the device is android or any other os. See code below for how the positioning is set. The values are for android currently. for ios the y values are 0.2, 0.35, and 0.85. the z values are all setZ.

frameObj.position.set(detail.position.x, detail.position.y + 0.2, detail.position.z - setZ) frameObj.quaternion.copy(detail.rotation) frameObj.scale.set(detail.scale setScale, detail.scale setScale, detail.scale * setScale)

  // video
  // videoObj.position.set(detail.position.x, detail.position.y + 0.35, detail.position.z - (setZ + 0.25))
  videoObj.position.set(detail.position.x, detail.position.y + 0.2, detail.position.z - (setZ-0.1))
  videoObj.quaternion.copy(detail.rotation)
  videoObj.scale.set(detail.scale * setScale, detail.scale * setScale, detail.scale * setScale)

  // textbox
  textboxObj.position.set(detail.position.x, detail.position.y + 0.7, detail.position.z - (setZ-0.2))
  textboxObj.quaternion.copy(detail.rotation)
  textboxObj.scale.set(detail.scale * setScale, detail.scale * setScale, detail.scale * setScale)