java - Light and textures in Java3D -
my problem difference between this: and this: i'm trying create nice looking solar system java3d when apply texture lighting effect disappears , 3d effect (when not looking @ planet top-down) goes it. how can have kind of shading on textured surfaces? the code used earth example available below. texture downloadable here . import com.sun.j3d.utils.geometry.primitive; import com.sun.j3d.utils.geometry.sphere; import com.sun.j3d.utils.image.textureloader; import com.sun.j3d.utils.universe.simpleuniverse; import javax.imageio.imageio; import javax.media.j3d.*; import javax.vecmath.color3f; import javax.vecmath.point3d; import javax.vecmath.vector3d; import java.awt.*; import static java.lang.math.pi; import static java.lang.math.cos; import static java.lang.math.sin; public class hello3d { public hello3d() { simpleuniverse universe = new simpleuniverse(); branchgroup group = new branchgroup(); for(double i=0; i<2*pi; i+=pi/5)...