I am trying to import the obj model into libgdx and apply one color to it - without shading at all, only one color on all faces.
this is what i use in my create method:
modelBatch = new ModelBatch();
ObjLoader loader = new ObjLoader();
model = loader.loadModel(Gdx.files.internal("data/test.obj"));
model.materials.add( new Material(ColorAttribute.createDiffuse(Color.GREEN)));
instance = new ModelInstance(model);
and in my rendering method:
Gdx.gl.glClearColor(52 / 255f, 152 / 255f, 219 / 255f, 1.0f);
Gdx.gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT);
modelBatch.begin(perspCam);
modelBatch.render(instance);
modelBatch.end();
As a result, the model is white / gray - why is it not green?
source
share