What is a volumetric density field ? Voxes?

Gary Leyrn's icon

Hello,

I am trying to understand how jit.gl.isosurf and how jit.gl.volume work.

In both cases the reference article mention the term "volumetric density field".


"The jit.gl.volume object creates a transparent volume from a volumetric density field."
https://docs.cycling74.com/max5/refpages/jit-ref/jit.gl.volume.html

"The jit.gl.isosurf object creates a geometric surface from a volumetric density field. "
https://docs.cycling74.com/max5/refpages/jit-ref/jit.gl.isosurf.html

I looked for this term in Google with not results. Only very complex math books talk mention the term.

Does it has to do with Voxels and Regular grids?

Could someone please explain what that mean? I would like to understand in deep how jit.gl.isosurf and jit.gl.volume work

Thank you.

Martin Beck's icon

This here is similar to jit.gl.isosurf:

[jit.gl.isosurf] plots a surface along a function f(x,y,z) = const, by using matrix input meaning the function is not known as analytic equation but as values stored in a [jit.matrix 1 float32 xdim ydim zdim]. const is defined by attribute @isolevel

f is a function in 3D space and assigns a value to each position vector (x,y,z). It is called volumetric density field in the help file.

Example with analytic function f(x,y,z) = x^2 + y^2 + z^2.

Let's say we want an isosurface for f(x,y,z) = 9.

x^2 + y^2 + z^2 = 9 or we can also write

x^2 + y^2 + z^2 = 3^2

or better known as a sphere in 3D space with radius 3.

f(x,y,z) = x^2 + y^2 + z^2 is something like the description of a property of 3D space that is isotropic (not dependent on direction) and grows with the square of the distance.

The sphere with radius 3 represents all points in space where this property has value 9.

A more relevant example from physics is

f(x,y,z) = 1 / (x^2 + y^2 + z^2) whose isosurfaces are also spheres.

The property of 3D space described by this equation e.g. is something like gravity 1/r^2 (https://en.wikipedia.org/wiki/Gravity).

For implemenation details see e.g. Marching Cubes

jit.gl.volume does not draw a surface of constant value but renders f as something that could be described as fog and i think the term volume rendering is associated with this. The density of the fog is described by f.

Gary Leyrn's icon

Wow!

Thanks so much Martin! I do appreciate it.