Object become transparent when rotating

Started by Argeel, December 10, 2015, 12:20:32 PM

Previous topic - Next topic

Argeel

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

EgonOlsen

#1
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.

Argeel

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