How to identify normal of certain face of mesh?

Hello,
I try to determine which side 10 sided dice landed on, I managed to do it for normal 6 sided one, the problem is, I’m not really sure how can I detect normal of specific face for such complex mesh. I attached image of my mesh.

alt text

Thank everyone for help, I was able to do it using method giulio wrote about earlier, I created small editor to save normal<->number pairs to xml files, And then after dice stops moving I use raycast from top of dice and compare them, however using DOT product is probably faster and more straight forward method, I’ll modify my script to use that method.
Thanks again everyone.

Like others have said above this problem isn’t really about detecting which face / triangle / normal faces upwards, but about how you identify that face. Of course you have to decide at some point which side represents what and this information need to be stored somewhere.

If the mesh doesn’t change, it would be possible to iterate through all triangles of your mesh and store which triangles belong to which face. From each triangle you can calculate the normal by using the cross product of two edges. However i would go with a more Unity-like approach ^^.

Just add 10 empty gameobjects as childs to your dice and positioning them at the center of each face. Those gameobjects has to be linked into an array in the correct order so you know which gameobject represents which side.

To detect which side is the top side you just have to check the y-world-position of each of your child objects and the one with the largest value is your upper side. You could simply define a threshold where the wanted gameobject is always over that limit and all others below. This threshold should be relative to the center of your dice.

//C#
public Transform[] sides; // assign in the inspector
public float topThreshold = 1.2f;

int GetUpperSideIndex()
{
    float limit = transform.position.y + topThreshold;
    for(int i = 0; i < sides.Length; i++)
    {
        if(sides*.position.y > limit)*

return i;
}
return -1; // this should never happen if the topThreshold is set correctly
}