O'Reilly logo

jMonkeyEngine 3.0 Beginner's Guide by Ruth Kusterer

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

Time for action – take a swim

Beautifully designed 3D landscapes invite the player to explore and interact. You couldn't hold it against a player if he or she tried to take a closer look at your water. Maybe a body of water is an important element in your game. Maybe some parts of the game story are even set underwater. For these cases, we need to pull out all the stops and show off what the engine is capable of, by using the com.jme3.water.WaterFilter class.

  1. Make a copy of WaterSimple.java and name the class WaterTerrainSky.java. Remember to also refactor the first line of the main() method to the following:
    WaterTerrainSky app = new WaterTerrainSky();
  2. Keep the class field for the node that groups the reflected scene.
     private Node reflectedScene; ...

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