Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package de.puffeldings.collaboration.core;
- import java.util.logging.Level;
- import java.util.logging.Logger;
- import com.jme3.app.SimpleApplication;
- import com.jme3.light.AmbientLight;
- import com.jme3.material.Material;
- import com.jme3.math.Vector2f;
- import com.jme3.math.Vector3f;
- import com.jme3.renderer.RenderManager;
- import com.jme3.scene.Geometry;
- import com.jme3.scene.Node;
- import com.jme3.scene.shape.Box;
- import com.jme3.system.AppSettings;
- public class FlickerProblem extends SimpleApplication
- {
- private static final Logger LOGGER = Logger.getLogger("com.jme3");
- private static final int MAX_OBJECTS = 500000;
- private static boolean ONCE = true;
- public static FlickerProblem app;
- public Node world;
- public static Geometry geom;
- public static void main(String[] args)
- {
- LOGGER.setLevel(Level.SEVERE);
- AppSettings settings = new AppSettings(true);
- settings.setTitle("Puffeldings");
- settings.setResolution(1280, 720);
- // settings.setFullscreen(true);
- settings.setFrequency(60);
- settings.setVSync(true);
- // settings.setSamples(8); // AA
- settings.setBitsPerPixel(32);
- settings.setRenderer(AppSettings.LWJGL_OPENGL_ANY);
- app = new FlickerProblem();
- app.setSettings(settings);
- app.setShowSettings(false);
- app.start();
- }
- @Override
- public void simpleInitApp()
- {
- cam.setFrustumPerspective(55f, (float) cam.getWidth() / cam.getHeight(), 0.01f, 1024f);
- cam.setLocation(new Vector3f(500000, 0.5f, 1));
- flyCam.setMoveSpeed(200);
- world = new Node("World");
- Material mat_normals = new Material(assetManager, "Common/MatDefs/Misc/ShowNormals.j3md");
- for (int objectsIdx = 0; objectsIdx < MAX_OBJECTS; objectsIdx++)
- {
- Box box = new Box(0.5f, 0.5f, 0.5f);
- Geometry geom = new Geometry(box.toString(), box);
- geom.setLocalTranslation(objectsIdx, 0, 0);
- geom.setMaterial(mat_normals);
- world.attachChild(geom);
- }
- rootNode.attachChild(world);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement