www.jpct.net

jPCT-AE - a 3d engine for Android => Support => Topic started by: Argeel on December 10, 2015, 12:20:32 pm

Title: Object become transparent when rotating
Post by: Argeel 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
Title: Re: Object become transparent when rotating
Post by: EgonOlsen 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.
Title: Re: Object become transparent when rotating
Post by: Argeel 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