Beispiel #1
0
        public override void create()
        {
            Gdx.app.log("Game", "Create");


            _batch           = new ModelBatch();
            _camera          = new PerspectiveCamera(67, Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
            _camera.position = new Vector3(10f, 10f, 100f);
            _camera.lookAt(0f, 0f, 0f);
            _camera.near = 1;
            _camera.far  = 300;
            _camera.update();

            var loader = new ObjLoader();
            var data   = loader.loadModelData("brown_wall.obj");

            _model = new Model(data);

            for (int i = -10; i < 10; i++)
            {
                var modelInstance = new ModelInstance(_model, Matrix4.Identity, null);
                _modelInstances.Add(modelInstance);
            }
            Gdx.app.debug("TestModel", $"V: {Gdx.graphics.getWidth()}:{Gdx.graphics.getHeight()}  Models: {_modelInstances.Count}");
        }