We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hi,
I'm exporting my 3D scene to PDF/DXF, but EVERYTHING in that scene is included in the output, including everything that is not visible to the camera. This makes sense I guess, but is there anyway of excluding shapes that are not visible to the camera view?
I could simply not draw certain shapes if I knew if something was in camera view or not I guess, so is there a way to test if a PVector is in view?
Thanks!
Answers
OK, so it turns out this is Frustum Culling... and has been discussed here: https://forum.processing.org/two/discussion/5830/how-to-implement-frustum-culling-in-processing
A simpler, but less accurate answer is just to check a PVector(X,Y,Z) is at least within the screen bounds using screenX(X,Y,Z) and screenY(X,Y,Z). This doesn't account for z depth, but actually goes along way to solving the problem...
Thanks to @_calx & @wblut on Twitter!