Hi folks,
I'm trying to calculate a polygon's normal. I've read CreatePhongNormals() can return an array of (vertices point?) normals if there's a Phong tag. How do I use that to calculate a normal at poly UV?
// psuedo code
po = (PolygonObject*)obj;
SVector *norms = po->CreatePhongNormals();
if(norms)
{
int ply = 4; // let's get normal for polygon 4(5), points abc
Vector uv; // the uv spot of the normal to get, on ply
Vector normal = (norms->operator[](ply*4) + norms->operator[](ply*4+1) + norms->operator[](ply*4+2)) / 3;
// do something with normal, etc.
GeFree(norms);
}
Would like to include blending across the polygon if possible (i.e. the normal at spot uv). Not worried about speed, just learning.
WP.