Author Topic: Object become transparent when rotating  (Read 353 times)

Offline Argeel

  • byte
  • *
  • Posts: 2
    • View Profile
Object become transparent when rotating
« on: December 10, 2015, 12:20:32 pm »
Hi,

First of all i would like to thank jPCT team for their great work.
I'm new to jPCT and 3d modeling for android so please don't blame me for my incompetence.

I have a problem with some of my objects
Mainly what i do is loading a .obj within the demo application (for Android). They are well display except that when I rotate them, they become transparent when i'm watching the "back" of the object
(see : https://www.youtube.com/watch?v=5TSbpx_eM2k)

Thanks in advance for the help

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11777
    • View Profile
    • http://www.jpct.net
Re: Object become transparent when rotating
« Reply #1 on: December 10, 2015, 01:29:46 pm »
That's normal behaviour. It's called backface culling. Polygons have an order (defined by the order of the vertices in the edge definitions), that defines what's the front and what's the back. By default, the graphics hardware culls away the polygons that are backfacing and for most models, this is exactly what you want. In your case, not so much. You can toggle this behaviour be using setCulling(false); on the object. But keep in mind that the vertex normals that are used for lighting and such are also pointing away from the front side of the polygons, so your model's backside will be visible, but not lit.
« Last Edit: December 10, 2015, 03:12:17 pm by EgonOlsen »

Offline Argeel

  • byte
  • *
  • Posts: 2
    • View Profile
Re: Object become transparent when rotating
« Reply #2 on: December 10, 2015, 02:08:50 pm »
Thanks you very much for the fast answer  :)

Thanks for the explanation, helps a lot.
And finally, thanks for the solution of my problem, it's "working" (rendering the back) now

Keep up the good work