How to make object always look at / rotate towards camera?

Hi I am new to react-native / functional programming and just started using Viro. I have experience using the Unity game engine and manipulating vectors.

I have some ViroText objects that are instantiated upon scanning an ViroARImageMarker, so their positions are local to that marker.

I want to have those Text objects always rotated towards the camera.
I saw that .getCameraOrientationAsync() is used to get the camera position.

But can I have some suggestions on how to go about doing this?
My current idea for a approach is to…

  1. Get global position of viro-text object
  2. Get position of camera
  3. Manually calculate the rotation of the viro-text object with vector math in relation to the camera’s position
  4. apply the rotation to the viro-text object

Please help thanks

Author: Fantashit

1 thought on “How to make object always look at / rotate towards camera?

  1. You can use the transformBehaviors -> billboard prop to have you component always face the camera

Comments are closed.