Skip to content

Play With Billboard


In VR applications there are some elements that needs to always facing the user, such as text, menus. Here we're going to introduce an easy way to implement it using SXRBillboard component.


Billboard in 3D graphics term is something always facing the camera.

Create Project

Create an SXR project by copying the template project

Perform the following steps to make sure your project runs correctly

  1. (if developing for Gear VR) Copy your Oculus signature file to app/src/main/assets folder.
  2. Change the applicationId in build.gradle to a unique name to avoid naming conflict when you test the app later
  3. Change the app_name in res/values/strings.xml to avoid confusion when you debug the app.


Before we start, there is a 3D T-rex model and it's texture we're going to use for this tutorial.

How to use Billboard

Make sure to copy both files into app/src/main/assets folder

You can learn how to load 3D models with following play with 3D models tutorial, here we'll just highlight the code for billboard

mTrexObj = sxrContext.getAssetLoader().loadModel("trex_mesh.fbx", sxrContext.getMainScene());
mTrexObj.attachComponent(new SXRBillboard(sxrContext, new Vector3f(0f,1f,0f)));


The second parameter of SXRBillboard is the up vector of the billboard, it indicates which direction is up so the billboard will rotate accordingly.

Source Code

Complete Source Code for this sample