Elyg
9/12/2017 - 4:55 PM

Camera clipping

Run Over: POINTS camera clipping

vector ndc = toNDC(chs("cam"), @P);

vector2 x = set(chv("x").x, chv("x").y);
vector2 y = set(chv("y").x, chv("y").y);
vector2 z = set(chv("z").x, chv("z").y);

f@ndc= ndc.z;

if((ndc.x < x.x) || (ndc.x > x.y) || (ndc.y < y.x) || (ndc.y > y.y)) removepoint(0, @ptnum);
if((ndc.z>z.x) || (ndc.z<z.y)) removepoint(0, @ptnum);