O'Reilly logo

jMonkeyEngine 3.0 Cookbook by Rickard Edén

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating a dynamic skybox with a moving sun

We covered how to create static skyboxes in Chapter 1, SDK Game Development Hub. While they are fine for many implementations, some games require day and night cycles.

Getting ready

This recipe will show us how to create a moving sun, which can be superimposed on a regular skybox. In this case, a neutral skybox without any protruding features such as mountains will work best. We'll also learn how to make a sky that changes color during the day. In this case, no skybox is required.

We will also need a texture that should have a transparent background with a filled, white circle in it, as shown in the following figure:

How to do it...

  1. We begin by creating a new application class extending SimpleApplication ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required