Once again, thank you, Manuel.
I had to do a few changes and it is working now.
I even made it select the faces that are within a certain angle from the camera.
Here is my code:
for i,poly in enumerate(faces):
a,b,c,d = poly.a,poly.b,poly.c,poly.d
pta = points[a]*mg
ptb = points[b]*mg
ptc = points[c]*mg
ptd = points[d]*mg
v1 = pta-ptb
v2 = ptb-ptc
normal = v1.Cross(v2)
normal.Normalize()
if c != d:
center = c4d.Vector((pta.x+ptb.x+ptc.x+ptd.x)/4.0,(pta.y+ptb.y+ptc.y+ptd.y)/4.0,(pta.z+ptb.z+ptc.z+ptd.z)/4.0)
else:
center = c4d.Vector((pta.x+ptb.x+ptc.x)/3.0,(pta.y+ptb.y+ptc.y)/3.0,(pta.z+ptb.z+ptc.z)/3.0)
direction = cam_off - center
norm_dir = direction.GetNormalized()
angle = NINETY - normal.Dot(norm_dir)
if (angle > 0.0 and angle < max_ang):
selection.Select(i)