public override Vector3D normal(Vector3D intersectionPoint, Vector3D viewPoint) { Vector3D normal = new Vector3D(ng); if (viewPoint.subNew(intersectionPoint).dot(normal) < 0.0) { normal.neg(); } return(normal); }
public override Vector3D normal(Vector3D intersectionPoint, Vector3D viewPoint) { Vector3D normal = intersectionPoint.subNew(position()); normal.scale(invRadius()); if (viewPoint.subNew(intersectionPoint).dot(normal) < 0.0) { normal.neg(); } return(normal); }