Back face front face?
-
hello.
I have created a sketchup importer for opengl 2 in c++.
My problem is that i wish recognize if a face is front face or backface.
I'm ispired from the skpToXml demo , and i read about outer loop and inner loop.
When I'm import simple models all work , but for certain models i don't see part of the scene or textures are flipped.
then:1)is possible recognize a front/back face from the importer(not in the shader)?How?
2)is possible that a complex face ( nLoops>1 like the example skpToXml)is a back face? because i read that outer loop are always in ccg order or always cw i dont remember.I'm trying to flip all the backface or flip all the front face for reach an uniformity(all front face or all back face), this clearly is all to do only in importation phase , then i create a custom xml or serialize all in binary for speed up the loading.
In the shader i see if a face is a front face or back face with the FACE semantic (is automatic and already done), in cg for example FACE return < 0 if the face is a backface and > 0 if the face is a front face.
Thanks.
-
Try posting to the C++ SDK forum:
http://groups.google.com/group/su-sdk-fileshare/topics -
Your importer will have to handle faces on the world plane as SU always reflips these on import.
http://forums.sketchucation.com/viewtopic.php?f=180&t=31887
Advertisement