Hi all, I'm trying to figure out the direction of the normal of a face from an STL file I've loaded using Toxiclibs. I did something very similar with the OBJloader library without issue (but have abandonded that library because it seems to have a lot of problems loading my files, whereas my STLs from Rhino have no issue with Toxiclibs).
Ultimately, the project is sort of a hack of ray-casting, so I need to know if I'm hitting the front or back of a face.
Looking at the normals, they appear to be normalized but I can't figure out how to go from that to direction. It appears that STLs don't store normal's direction: "In most software this may be set to (0,0,0) and the software will automatically calculate a normal based on the order of the triangle vertices using the 'right-hand rule'."
Can this be done within the library (and I've simply missed this)? Anyone implemented something similar or the right-hand rule ( http://en.wikipedia.org/wiki/Right-hand_rule)?
Thanks!
Ultimately, the project is sort of a hack of ray-casting, so I need to know if I'm hitting the front or back of a face.
Looking at the normals, they appear to be normalized but I can't figure out how to go from that to direction. It appears that STLs don't store normal's direction: "In most software this may be set to (0,0,0) and the software will automatically calculate a normal based on the order of the triangle vertices using the 'right-hand rule'."
Can this be done within the library (and I've simply missed this)? Anyone implemented something similar or the right-hand rule ( http://en.wikipedia.org/wiki/Right-hand_rule)?
Thanks!
1