Author Topic: loading obj model  (Read 1984 times)

Offline ashunkhs

  • byte
  • *
  • Posts: 24
    • View Profile
loading obj model
« on: May 16, 2013, 08:03:48 am »
hi

  i am trying to load object (car.obj)model on surface . its loading but the model become transparent. please check out
  my attached image. we need to set any property ?

[attachment deleted by admin]
« Last Edit: May 16, 2013, 08:05:35 am by ashunkhs »

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: loading obj model
« Reply #1 on: May 16, 2013, 08:27:43 am »
If the file's data says that the model is transparent, the loader enables transparency. Some exporters seem to set this value wrong, so that actual opaque models will be loaded as transparent ones. Just do

Code: [Select]
obj.setTransparency(-1);

Offline ashunkhs

  • byte
  • *
  • Posts: 24
    • View Profile
Re: loading obj model
« Reply #2 on: May 16, 2013, 09:20:16 am »
Hi sir ,

  I did it but no effect .


      car = loadModel();
      car.strip();
      car.build();
      car.rotateX(180);
      car.rotateY(180);
      car.rotateZ(0);
      car.setTexture("texture");
      car.setTransparency(-1);
      car.setCollisionMode(Object3D.COLLISION_CHECK_OTHERS);
      
there is any more things ...

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: loading obj model
« Reply #3 on: May 16, 2013, 09:53:23 am »
Check your code. If you disable transparency, then there won't be any. If there still is, you haven't disabled it correctly or enabled it afterwards.