Detect when 3D object visible

ven's icon

Hi,
I'm trying to detect when a 3D object is visible respect my camera or it's outside the camera.
I would like to do it with simple math just using 3D objects coords and no computer vision.

Could it be a valid path to work with polar x/y calculation? How can I compensate the z plane in this case?

Thanks so much

Rob Ramirez's icon

you can get the jit.gl objects object space bounds via the bounds attribute (getbounds).

Spa's icon

I'm trying to determine the bounds of the gl text
error...

var card_textcut = new JitterObject("jit.gl.text", ctx);
card_textcut.text("AAAA");
...
var card_text_bounds = card_textcut.getbounds();
outlet(outlet_info,"card_text_bounds:", card_text_bounds);

ven's icon

Thanks Rob,

I just need the basic math behind this calculation, do you have any specific resource or formula?