Deciding front and back?

Hi all,

I’m getting back to a problem I had to set aside. I have two goals in mind when dealing with strips, surfaces with holes, or closed volumes (listed in order of priority).

#1. I want to know the front and back sides of my triangles by color coding.

If I have a sphere with a hole in it, it seems tracing would work fine since, when I get to a triangle that has no connectivity or is just an edge, then I just stop there and not search for an adjacent face. This also seems like it would work fine for strips and closed volumes. I think I’d have a problem with joints (edges of a triangle that have more than 1 connecting edge), but that’s ok for now.

#2. I also want to define their regions or volumes.

It seems like calculating the surface normal for each face would give me a front and back of a surface. I’ve got the surface normal calculation done in my code, but I don’t know how to tell what side of a face it’s on which I believe would give me the front or back side info that I need to color fill my triangles.
I’m also not too sure how to visually display a region or volume other than the selection of a group of elements that relate to that region/volume.

Anyone have advice, or comments on how they handle this or which of these is the better way, or maybe how to do some of this?

So I am a touch confused? Is this a Java3D program? Your second question sounds like your writing you own renderer.

if it is the latter its a bit off topic here but yes you are correct. Back facing is done by findin g the surface normal. You then take the dot product v. your view vector. If the result is positive, its a front face, if the result is negaitve its a back face.