Author Topic: Polygons flipped the wrong way  (Read 4125 times)

Offline zammbi

  • float
  • ****
  • Posts: 361
    • View Profile
Polygons flipped the wrong way
« on: March 04, 2010, 10:59:16 am »
I'm currently loading a 3ds landscape and it seems to have flipped the polygons(water is on top of the hills). I have never seen this problem before.
When I load it in blender it appears correctly. I don't know what's causing this, maybe some silly error on my part.

Anyone else get the same issue? http://www.2shared.com/file/11834275/23195093/Models.html

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Polygons flipped the wrong way
« Reply #1 on: March 04, 2010, 11:02:39 am »
Do you have a screen shot?

Offline zammbi

  • float
  • ****
  • Posts: 361
    • View Profile
Re: Polygons flipped the wrong way
« Reply #2 on: March 04, 2010, 11:30:43 am »

Offline zammbi

  • float
  • ****
  • Posts: 361
    • View Profile
Re: Polygons flipped the wrong way
« Reply #3 on: March 04, 2010, 12:40:19 pm »
Well seems I can solve the problem giving a negative number:

Code: [Select]
Object3D[] objs = Loader.load3DS(Main.class.getResource("/Models/"),"3ds2.3ds", -400);

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Polygons flipped the wrong way
« Reply #4 on: March 04, 2010, 12:41:37 pm »
So...is this actually rotated compared to the original or is just the y-axis flipped?

Offline zammbi

  • float
  • ****
  • Posts: 361
    • View Profile
Re: Polygons flipped the wrong way
« Reply #5 on: March 04, 2010, 12:51:38 pm »
The polygons are flipped on the wrong side.

Usually I flip the model (X axis) by -PI/2 but this one I had to flip by PI/2 so I could see something.

Which yeah in a way the y-axis has been flipped.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Polygons flipped the wrong way
« Reply #6 on: March 04, 2010, 03:50:40 pm »
No idea then. Maybe there is some transformation stored in the file that jPCT's loader ignores. There are such things in 3DS, which is why the loader fails on some files. Maybe this is one of them. Try to convert it into OBJ-format and see if that helps.
If it doesn't, try to do something like:

Code: [Select]
mesh.getRotationMatrix().set(1,1,-1);
mesh.rotateMesh();
mesh.getRotationMatrix().setIdentity();

to flip y.