3DObject Material/Surface

Started by klimmtjaques, July 12, 2015, 05:41:03 PM

Previous topic - Next topic

klimmtjaques

So I decided to use JPCT for a project at uni and so far it's great.

I have a little issue with materials, though. I built a model of a doll in Blender, exported it as a 3ds file for JPCT and it was a little dark and matte. I couldn't get specular lights to work on it to make the surface look like shiny plastic.

After experimenting I figured out that I could remove the material in Blender. The doll finally looked the way I wanted it to, but there was a problem with the culling. JPCT couldn't tell which face was in the front, so the doll's joints were flickering.

Any idea on how I can fix this?

klimmtjaques

Okay, now I feel stupid for creating an account for this question.
The basic material in Blender is gray, that's why it looked so bad. I switched the color to white and now it looks fine.

So I guess this can be closes/ignored.

klimmtjaques

Well it seems I'm confused about it after all.

My solution was to turn the material white in Blender, and then to call setAdditionalColor with the color I actually wanted it to be.

Then I could turn the ambient Light and my light way down and it looked the way I wanted it to.

There surely must be a smarter way to do this though, right? I'm new to 3D programming so I'm a little confused.

EgonOlsen

The importer reads the material's color from the file, but it ues it only if you don't assign a texture as well. The color set by setAdditionalColor(..) gets multiplied with the object's base color, which is either the material's color or the texture's color at that point. I don't see a problem with your solution. It's actually fine.