0

I'm having difficulty changing the camera rotation within my project.

https://glitch.com/~camera-experiment

I need the camera to rotate to face a different direction each time the user moves to a new "area". These areas are just with a different background image.

Ideally I would like to rotate just the background image of each entity however I cant do that either.

Has anyone got any suggestions? Any help would be greatly appreciated!

Sparky
  • 1

1 Answers1

0

Use a camera rig / wrapper entity and change its rotation. aframe - Set camera position at runtime

<a-entity id='cameraRig'>
  <a-camera></a-camera>
</a-entity>

document.querySelector("#cameraRig").object3D.rotation.set(x, y, z);  // Radians. Can use setAttribute for degrees or convert manually.
ngokevin
  • 12,980
  • 2
  • 38
  • 84