GENERATE/PREV.gifGENERATE/NEXT.gif

Point3 : Value

Points in 3D space. Also known as 3D vectors. Coordinates are floating point numbers. All the coordinates passed to and from MAX are in these values.

literals

[x, y, z]

[10, 10, 10]

[sin x, cos y, tan z]

x_axis

y_axis

z_axis

properties

<point3>.x      -- returns the x coordinate as a Float

<point3>.y      -- returns the y coordinate as a Float

<point3>.z      -- returns the z coordinate as a Float

operators

<point3> + <point3_or_number>

<point3> - <point3_or_number>

<point3> * <point3_or_number>

<point3> / <point3_or_number>

- <point3>

standard vector arithmetic. If the second operand is a number it does scalar arithmetic on vector.

<point3> == <point3>

<point3> != <point3>

methods

length <point3>      -- length of the vector

dot <point3> <point3>      -- vector dot product

cross <point3> <point3>      -- vector cross product

normalize <point3>      -- normalize vector length

distance <point3> <point3>      -- distance: length of (p2 - p1)

random <point3> <point3>      -- generates a psuedo-random point

-- MAX 3D noise functions:

noise3 <point3>

A floating point noise function over 3D space, implemented by a pseudo-random tricubic spline. The return value is in the range -1.0 to +1.0.

noise4 <point3> <phase_float>

The same function as noise3 in which the phase can be varied using the 2nd parameter. The return value is in the range -1.0 to +1.0.

turbulence <point3> <frequency_float>

This is a simple fractal-loop turbulence built on top of the noise3 function. The second parameter controls the frequency of the turbulence. The return value is in the range 0.0 to +1.0.

fractalNoise <point3> <H_float> <lacunarity_float> \

<octaves_float>

This is a fractal function of 3D space implemented using fractional Brownian motion. The function is homogeneous and isotropic. It returns a float.

The parameters are as follows:

<point3> - the point in space at which the noise is computed.

<H_float> - the fractal increment parameter in the range [0,1]. When H is 1 the function is relatively smooth; as H goes to 0, the function approaches white noise.

<lacunarity_float> - The gap between successive frequencies, best set at 2.0.

<octaves_float> - The number of frequencies in the function.

In a later release, the 1D and 2D noise functions will also be exposed. All the noise functions are based on code and algorithms in the book:

"Texturing and Modelling: A Procedural Approach", Musgrave, Peachey, Perlin & Worley. Academic Press, ISBN: 0-12-228760-6.