Time for action – illuminated opaque textures
In the simplest case, a material loads one image file and slaps it onto the geometry's surface. Let's see what that looks like.
- Make a copy of
Main.java
and name the classTexturesOpaqueTransparent.java
. Remember to also refactor the first line of themain()
method toTexturesOpaqueTransparent app = new TexturesOpaqueTransparent();
. - Copy the provided
assets/Interface/Monkey.png
image to your project'sassets/Interface
directory. This will be our texture. - Replace the blue cube code in the
simpleInitApp()
method with the following:Sphere sphereMesh = new Sphere(16, 16, 1); Geometry sphereGeo = new Geometry("lit textured sphere", sphereMesh); Material sphereMat = new Material(assetManager, "Common/MatDefs/Light/Lighting.j3md"); ...
Get jMonkeyEngine 3.0 Beginner's Guide now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.