Preliminaries

Object space algorithms are computed on the CPU, in contrast to image space and hybrid algorithms, which are computed on the GPU. This may make them unsuitable for larger objects, unless they can be precomputed.

Note that object space algorithms are only implemented for models loaded from .obj files, as they would otherwise be too costly.
Note furthermore, that object space algorithms currently only work for triangle models. If the model is not a triangle model, a warning will be displayed.

A threshold controls how many lines are detected. It is set by

void setThreshold(float threshold)

With object space algorithms hidden lines can be drawn using

void drawHiddenLines(boolean drawHiddenLines)

The color for hidden lines can be set with the following methods:

void setHiddenColor(int gray)
void setHiddenColor(int gray, int alpha)
void setHiddenColor(int r, int g, int b)
void setHiddenColor(int r, int g, int b, int a)
void setHiddenColor(float gray)
void setHiddenColor(float gray, float alpha)
void setHiddenColor(float r, float g, float b)
public void setHiddenColor(float r, float g, float b, float a)

The int versions expect values between 0 and 255, while the float versions expect values between 0.0 and 1.0.

Creases

Creases are sharp angles in a boxy model. As they are not view dependent, they can be precomputed and do not need further processing at run time, which makes them extremely fast, despite being object-space algorithms. Creases can be either ridges or values. To create an instance of each, use

BoxyRidges()

and

BoxyValleys()

respectively.

Hidden lines can be stippled using

void stippleHiddenLines(boolean stippleHiddenLines)

The example below shows a result for using hidden, stippled lines:

Note that creases have the same problems with gaps at the corners with very wide lines as wireframe contours. If you need large line width with boxy objects, you are probably better of with Sobel edge detection and a dilation filter.

Ridges and Valleys

This algorithm is suitable for smooth objects. Like Creases, they can be precomputed.

To create an instance of Ridges or Valleys use

SmoothRidges()

and

SmoothValleys()

Ridges and valleys can be drawn faded.

void drawFaded(boolean drawFaded)


Apparent Ridges

Apparent Ridges are view-dependent ridges. Therefore, they cannot be precomputed.

To create an instance of apparent ridges use

ApparentRidges()

Apparent ridges can be drawn faded.

void drawFaded(boolean drawFaded)