LDraw.org Discussion Forums
Question on faces - Printable Version

+- LDraw.org Discussion Forums (https://forums.ldraw.org)
+-- Forum: Models and Parts (https://forums.ldraw.org/forum-18.html)
+--- Forum: Parts Authoring (https://forums.ldraw.org/forum-19.html)
+--- Thread: Question on faces (/thread-6973.html)



Question on faces - Nicola - 2012-11-22

Hi, i have a question: are faces considered double sided in parts that are not "BFC certified"?
For example i'm rendering part 6595 and it renders wrong, it's not certified as far as i can see.


Re: Question on faces - Steffen - 2012-11-22

triangles and quads which are not BFC-enabled (e.g. in non-certified files, or in a section of a file enclosed in
0 BFC NOCLIP
...
0 BFC CLIP
must be treated non-oriented, i.e., it cannot be derived an "inside" and "outside" facing surface of them.
They must be rendered from whatever side you look at them.
In OpenGL as far as I remember, there's a global rendering option by which you can turn on and off the logic
if to render such a surface or not. I don't think that you can turn and off it for individual quads or triangles, though.

Thus, the only solution that comes to my mind is: if you encounter such data, you will probably be forced to turn off
the CW/CCW optimization logic of your OpenGL renderer for the _whole_ scene...


Re: Question on faces - Philippe Hurbain - 2012-11-23

Quote:Thus, the only solution that comes to my mind is: if you encounter such data, you will probably be forced to turn off
the CW/CCW optimization logic of your OpenGL renderer for the _whole_ scene...
Or use two overlapping but opposite winding elements? BCFed parts are more and more frequent nowadays...


Re: Question on faces - Steffen - 2012-11-23

yes, that's of course a MUCH better solution


Re: Question on faces - Travis Cobbs - 2012-11-25

In OpenGL, there are two settings to get the "back" side of faces to render. Two-sided lighting must be enabled if using OpenGL's lighting, and GL_CULL_FACE must be disabled. LDView does this for non-BFC geometry. However, Philo's suggestion of drawing the triangle twice with opposite windings is probably a better solution, and if I were doing things over again, that's probably what I would do.


Re: Question on faces - Nicola - 2012-11-26

yes, thanks, i'll go with this solution


Re: Question on faces - Nicola - 2012-11-26

Another thing, i've found that some parts in standard library (ie 6595a.dat) have quads in an "hourglass" configuration, not ccw or cw. As stated here it's a bad configuration. Have i stumbled on a broken part or should i implement some kind of quad correction software? IIRC LDView render it correctly.


Re: Question on faces - Philippe Hurbain - 2012-11-26

You may indeed encounter such quads ("bow-tie" in LDraw jargon) in old, non-BFCed files. You must indeed provide some correction if you want to display them correctly Sad


Re: Question on faces - Nicola - 2012-11-26

Ok... I'm almost afraid to ask but: what if one wants to correct the part? after all is just switching a couple of vertices.
What's the iter to correct a part ?


Re: Question on faces - Magnus Forsberg - 2012-11-26

Hi Nicola , I love your web rendering tool.

I made a quick review of that part, 6595.dat, and indeed, it badly needs some corrections.
All files, main and sub-files, are missing a bfc-statement.
All quads, in all four sub-files, are bowtie-quads.
All sub-files are missing many of the needed cond-lines.

Correcting bfc is easy with DatHeader, and the missing cond-lines could be made with Edger2.
It should also be renamed to follow the new nomenclature for wheel rims.

If you wanna have a go at it, correct all files and send them to Admin
but I think that you first have to register as an author.

If not, let me know, and I'll do it.


Re: Question on faces - Nicola - 2012-11-26

Thanks, i think i'll pass on correcting the part. Also i don't really need it, it was just a test case for the renderer. So don't feel obliged to correct it Smile