www.jpct.net

jPCT - a 3d engine for Java => Support => Topic started by: klimmtjaques on July 12, 2015, 05:41:03 pm

Title: 3DObject Material/Surface
Post by: klimmtjaques on July 12, 2015, 05:41:03 pm
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?
Title: Re: 3DObject Material/Surface
Post by: klimmtjaques on July 12, 2015, 05:48:28 pm
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.
Title: Re: 3DObject Material/Surface
Post by: klimmtjaques on July 12, 2015, 06:26:17 pm
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.
Title: Re: 3DObject Material/Surface
Post by: EgonOlsen on July 12, 2015, 07:58:40 pm
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.