com.badlogic.gdx.graphics.g3d.utils.CameraInputController Java Examples
The following examples show how to use
com.badlogic.gdx.graphics.g3d.utils.CameraInputController.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: GLTFPostProcessingExample.java From gdx-gltf with Apache License 2.0 | 5 votes |
@Override public void create() { sceneManager = createSceneManager(); sceneManager.camera = camera = new PerspectiveCamera(); camera.fieldOfView = 50; camera.near = 0.01f; camera.far = 10f; camera.position.set(1, 1, 1).scl(.1f); camera.up.set(Vector3.Y); camera.lookAt(Vector3.Zero); camera.update(); // load user scene SceneAsset asset = new GLTFLoader().load(Gdx.files.internal("models/BoomBox/glTF/BoomBox.gltf")); sceneManager.addScene(new Scene(asset.scene)); cameraController = new CameraInputController(camera); cameraController.translateUnits = .1f; Gdx.input.setInputProcessor(cameraController); viewport = new FitViewport(1000, 500, camera); // post processing if(postProcessingEnabled){ fbo = new FrameBuffer(Format.RGBA8888, Gdx.graphics.getWidth(), Gdx.graphics.getHeight(), true); effectShader = new ShaderProgram(Gdx.files.classpath("shaders/effect.vs.glsl"), Gdx.files.classpath("shaders/effect.fs.glsl")); batch = new SpriteBatch(); } }