Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import com.jme3.app.SimpleApplication;
- import com.jme3.light.DirectionalLight;
- import com.jme3.material.Material;
- import com.jme3.math.Quaternion;
- import com.jme3.math.Vector3f;
- import com.jme3.scene.Geometry;
- import com.jme3.scene.Node;
- import com.jme3.scene.control.LodControl;
- public class TestLodClone extends SimpleApplication {
- public static void main(String[] args) {
- TestLodClone app = new TestLodClone();
- app.start();
- }
- public void simpleInitApp() {
- DirectionalLight dl = new DirectionalLight();
- dl.setDirection(new Vector3f(-1, -1, -1).normalizeLocal());
- rootNode.addLight(dl);
- Node teapotNode = (Node) assetManager.loadModel("Models/Teapot/Teapot.mesh.xml");
- Geometry teapot = (Geometry) teapotNode.getChild(0);
- Material mat = new Material(assetManager, "Common/MatDefs/Light/Lighting.j3md");
- mat.setFloat("Shininess", 16f);
- mat.setBoolean("VertexLighting", true);
- teapot.setMaterial(mat);
- teapot.addControl(new LodControl());
- rootNode.attachChild(teapot.clone());
- cam.setLocation(new Vector3f(-1.0748308f, 1.35778f, -1.5380064f));
- cam.setRotation(new Quaternion(0.18343268f, 0.34531063f, -0.069015436f, 0.9177962f));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement