Re: view-frustum culling implementation with jit.gen & matrices

Forums > Jitter > view-frustum culling implementation with jit.gen & matrices
Jun 16 2012 | 11:43 pm

so here is where I went.

I have that huge jit.gen (finally not that big)
It takes some parameters as input:
– position of the cam
– a point on the view direction of the cam (lookat)
– the up vector

It takes also cam parameters like:
– lens angle
– ratio of the view (w/h)
– nearClip distance
– farClip distance

it processes the whole parameters to render the 8 points of the view frustum.
As shown there:

The calculation is there:

first question:
I need to normalize a vector inside the codebox.
I did the basic calculation including sqrt()
does it exist a better way inside GenExpr / codebox ?

Now, I have my eight point defining my view.
They defines my 6 planes too.

I have to "test" all my object according to those planes in order to have a list of objects I have to inactivate and activate, according to the position & orientation of my cam.

That part is done in the second codebox and has to be done for the 6 planes.

Knowing I have a matrix with all my objects' positions, how can I test each one against those 6 planes ??

any help would be appreciate.
I don't know if this is the best implementation I could make of that concept.


  1. viewfrustumCulling.PNG


Subscribe to the Cycling ’74 Weekly Newsletter

Let us tell you about notable Max projects, obscure facts, and creative media artists of all kinds.

* indicates required