On each face select two vectors connection one vertex to the other two...then find their cross product using right hand rule for outward vector!
I have questions about finding outward normal vectors. Below I laid out an example and I am trying to walk through it. Basically the last four lines are questions, but I'm assuming I am correct and continuing to finish. If I am wrong, please point out where I went wrong. And if I'm right, please confirm and/or tweak, add extra insight, etc.
I have a polyhedron with 4 vertices and 4 triangular faces. The vertices are (0,0,0), (1,0,0), (0,1,0), and (0,0,1). So it has a base triangle and looks like a cone type thing with 3 triangles pointing into the z axis.
I need to find the outward normal for a face. Lets take the face that is the easiest to see - vertices (0,0,0), (1,0,0), (0,1,0) with edges [1,0,0], [-1, 1, 0], [0, -1, 0].
To get the normal I can cross product ANY two vectors? Or does it need to be a certain two?
I cross product [1,0,0] and [-1,1,0] giving me [0,0,1]. So the normal (no specification on inward or outward) is [0,0,1]...correct?
When I visualize this, the vector goes into the interior of the polyhedron rather than pointing of it. So [0,0,1] is the INWARD vector?
And to get the OUTWARD vector I just multiply it by -1 to get [0,0,-1] as the outward normal vector.
Is this correct? Any help is very appreciated.
EDIT: Was using [0,1,0] as an edge instead of [-1,1,0]
When I use the right hand rule...it points into the polyhedron instead of out...but maybe I am using the wrong vectors? If I curl my fingers from [1,0,0] to [-1,1,0], my thumb points upward into the positive z. But that doesn't make sense to me because that means its pointing towards the inside of the polyhedron...
You have three points connected by three edges (for that face), but you actually have 6 vectors (if your points are a,b,c, one vector "goes" FROM a TO b, another "goes" FROM b TO a). MaxJasper is saying that when you select the two vectors for your cross product, make sure that they are starting from the same point (in other words, you don't need to get all 6 vectors, you just select one point as your "FROM" point, and get the two vectors by connecting that point to the other two points (in that face)). Although, I'm not sure if this is necessary because vectors can be interpreted as "free-floating", so you would just have to "drag" the vectors so they have the same "starting" point, but it does help with the right hand rule.
As for getting the outward normal vector, what you do is use the right hand rule so that your "z" (in this case your thumb) is pointing outward of the face (i.e. if you want the inner normal, then make your "z" point inward). Once your "z" is pointing outward, "rotate" (but don't break ) your hand so that the "z" is still pointing outward while trying to get both your "x" (index finger) and "y" (middle finger) to match up (as close as possible) to the two vectors you chose above (so, where your index and middle meet is the starting point of the vectors). What you will then do is the vector representing "x" crossed with the vector representing "y" (i.e. x * y). That will give you the outward normal.
Now, just so you see what's going on, let's say you selected two vectors, a and b, (as above) and let's say that you got a*b to get the outward normal vector. If you apply the same procedure to get the inward normal, you will notice that in this case, the b will be the vector representing the "x" and a will be representing the "y", so the inward normal vector is b*a. Recall that a*b = - b*a, that's why in your original attempt, you had to multiply by -1 to get the outward (because you were getting the inward).
As for what you did, technically it's okay. You didn't apply the right hand rule to get the outward normal, instead, what happened was you let your "x"=[1,0,0] and "y"=[-1,1,0] and took x*y as a normal vector, which is okay. Now, to apply the right hand rule, you'll need to drag the vectors around so that their starting point is connected, but once you've done this, you'll see that your thumb points up, which is the inward normal. So, instead of trying to use the computed vector to determine if its inwards or outwards, you can use the right hand rule to help you (i.e., before you compute for the cross product, you can check its direction, and if it's the wrong direction, you can modify the cross product to give you the right direction).