Skip to content

Background

Vinicius Reif Biavatti edited this page Oct 14, 2019 · 10 revisions

Background

The background rendering is easy to implement. There is no mistery for it. In this tutorial step we will draw a background image in the projection so, the frist thing to do is get our image.

Our image needs to have the size in relation of the projection size. The background is drawed from the top to the middle height in the screen so, the image height will have the half height of our projection. The width of the image is relationed of the player angle. The value will be 360, because the image will repeat when the player get a full rotate. In this case:

Background image width: 360px Background image height: 120px

Note: For the height, we will not use the screen height because we are using a scale for rendering. The height of the image will be the value of the data.projection.halfHeight attribute.

I create the image below for the tutorial, but you can create your awn background.

File: background.png

Background RayCasting rendering

Clone this wiki locally