To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.cad.devOpen lugnet.cad.dev in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 CAD / Development / 9591
9590  |  9592
Subject: 
Re: surface normals and vertex normals for OpenGL
Newsgroups: 
lugnet.cad.dev
Date: 
Thu, 11 Mar 2004 19:45:09 GMT
Viewed: 
1856 times
  
In lugnet.cad.dev, Don Heyse wrote:
In lugnet.cad.dev, Wayne Gramlich wrote:
There is an interesting property of closed surfaces that can allow you to
determine the normals for all polygons (or triangles) given one correct
normal.

A "well behaved" closed surface can be decomposed into a set of
triangles in 3D space.  Each edge of the closed surface will be a
member of exactly two triangles.  Furthermore, the winding rule for
each triangle will be such that one triangle will traverse the edge
in one direction and the winding rule for the adjacent triangle will
go in the opposite direction.  Thus, given one triangle whose normal
is known, it is possible to keep visiting adjacent triangles until the
normals of all triangles are known.  Yes, this is really true!

A "well behaved" closed surface is 1) non-self intersecting 2) is
completely closed (i.e. no gaps or holes) 3) does not have any
edges that are in more than two triangles.  Two cubes that
share an edge would violate criteria 3).  Two cubes that share
a single point would probably work, but should be avoided as well.
I would postulate that it is the goal of LDRAW part designers to
produce "well behaved" closed surfaces.

I don't know about that goal.  I think it's better to make it easy
to assemble the various primitives into parts.  That way we get more
people volunteering to make the parts.  I don't think the primitives
*can* be closed.  I also think it's much easier to paste a stud
primitive onto a flat surface than to break up the flat surface into
something with a round hole to match the open edges of the stud.
But this violates your "well behaved" principle.

Don

All:

It is dangerous to write technical arguments at 1:30 in the morning,
and I made some serious mistakes in my post above.

1) You are correct that most LDRAW parts are not closed and probably
    never will be.  Optimizing for ease of part creation is clearly the
    correct design choice.

2) The property is only true at the polygon level, not the triangle level.
    A triangle fan with an odd number of triangles provides a trivial
    counter example.

So, let me try again.

If you represent your object as a closed set of polygons, where each
edge of the polygon is only shared with one other polygon, the counter
winding property I describe above is correct.  There is a further
requirement that two polygons in the same plane must not share an
edge.  By the way, for this representation, a polygon can have zero,
one or more holes in it. The holes wind in the opposite direction from
the outer polygon edge.

The technique is still valid for polygonal surfaces that are not closed.
You just need one good normal for every contiguous surface.

So, it may not be as easy as I thought at 1:30 this morning, but it is
certainly is not impossible.  Whether or not it is worth doing is a
separate discussion.

Hopefully, I did a better job or explaining myself this time.

-Wayne



Message has 1 Reply:
  Re: surface normals and vertex normals for OpenGL
 
I won't argue with your clarification, but I will point out that it would be more difficult for a renderer to perform this feat, particularly one that is designed as a real-time renderer, and therefore presumably has rather serious limitations on (...) (21 years ago, 12-Mar-04, to lugnet.cad.dev)

Message is in Reply To:
  Re: surface normals and vertex normals for OpenGL
 
(...) I don't know about that goal. I think it's better to make it easy to assemble the various primitives into parts. That way we get more people volunteering to make the parts. I don't think the primitives *can* be closed. I also think it's much (...) (21 years ago, 11-Mar-04, to lugnet.cad.dev)

9 Messages in This Thread:



Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact

This Message and its Replies on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR