Author Topic: when i load obj file without mtl definition  (Read 814 times)

Offline penprakash

  • byte
  • *
  • Posts: 26
    • View Profile
when i load obj file without mtl definition
« on: September 05, 2013, 03:00:19 pm »
Hi,

  I'm loading obj file which is not having mtl definition in android, it rendered 3d model colored with white. But when i render same obj model in IOS it renders 3d model with gray color. what could be the problem?. Should i add any properties for the 3d model?

Prakash V

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11910
    • View Profile
    • http://www.jpct.net
Re: when i load obj file without mtl definition
« Reply #1 on: September 05, 2013, 05:16:23 pm »
I don't see any problem. The obj file has no color information. If some others renderer renders that in gray, then so be it. So can try setAdditionalColor on the object or give it a small gray  texture.

Offline penprakash

  • byte
  • *
  • Posts: 26
    • View Profile
Re: when i load obj file without mtl definition
« Reply #2 on: September 05, 2013, 05:37:56 pm »
It doesn't have any texture information and i applied the additional color as

model.setAdditionalColor(new RGBColor(190, 190, 190));

but, still it is displaying in white color.

Prakash V

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11910
    • View Profile
    • http://www.jpct.net
Re: when i load obj file without mtl definition
« Reply #3 on: September 05, 2013, 06:15:21 pm »
An additional color has no effect if the ambient color is white already. That's caused by the way in which GL's lighting pipeline works. It doesn't matter if the model has texturing information or not, you can assign a small colored texture anyway. The Texture class has a constructor to create such things.