public Vec3f Normal(int edgeIdx) { Vec3f d1 = GetEdgeDelta(edgeIdx); Vec3f d2 = GetEdgeDelta(Next(edgeIdx)); Vec3f norm = Vec3f.Cross(d1, d2); return(norm.Normalized()); }
public static Vec3f ClosestPointToPoint(float planeDistance, Vec3f planeNormal, Vec3f point) { float distance; Vec3f translationVector; distance = -SignedDistanceToPoint(planeDistance, planeNormal, point); translationVector = planeNormal.Normalized() * distance; return(point + translationVector); }
public Vec3f Normal(int vIdx1, int vIdx2, int vIdx3) { var v1 = Points[vIdx1]; var v2 = Points[vIdx2]; var v3 = Points[vIdx3]; Vec3f d1 = v2 - v1; Vec3f d2 = v3 - v1; Vec3f norm = Vec3f.Cross(d1, d2); return(norm.Normalized()); }
public void SetLightDirection(Vec3f direction) { SunDirection = -direction.Normalized(); }
public void SetNormal(Vec3f direction) { Normal = direction.Normalized(); }