Fill Settings for 3D Objects
This section covers how to configure fill settings for standard models and polygons.
By changing these settings, you can disable filling for polygon surfaces and render only their edges. This allows you to render models in wireframe style, for example.
Fill Settings
Fill settings determine whether the surfaces inside the edges of polygons -- used to form 3D models -- should be filled when rendering.
By default, filling is enabled, so 3D models appear as a collection of filled surfaces. However, if you disable this setting, 3D models will be rendered as collections of lines instead, giving them a wireframe appearance often seen in sci-fi works and debugging tools.
Fill Settings for Models
To configure fill settings for an entire model, use the setModelFill(...) function.
- Function Format -
Arguments:
- modelID: Specifies the ID of the model to configure.
- fill: Specifies whether all polygons that make up the model should be filled when rendered.
Fill Settings for Polygons
To configure fill settings for a specific polygon, use the setPolygonFill(...) function.
- Function Format -
Arguments:
- polygonID: Specifies the ID of the polygon to configure.
- fill: Specifies whether the polygon should be filled when rendered.
Example Program
Let's actually create a sphere model and disable its fill setting to render it in wireframe style. Try entering and running the following program:
import graphics3d.Graphics3DFramework;
import Graphics3D;
// Function called at the start of the program
void onStart ( int rendererID ) {
// Optional: set window size and background color
setWindowSize( 800, 600 );
setBackgroundColor( 0, 0, 0, 255 );
// Create and mount a coordinate axis model
int axis = newAxisModel( 3.0, 3.0, 3.0 );
mountModel( axis, rendererID );
// Create and mount a sphere model
int sphere = newSphereModel( 2.0, 2.0, 2.0, 10, 8 );
mountModel( sphere, rendererID );
// Disable fill setting to render as wireframe
setModelFill( sphere, false );
}
Sample.vcssl
When you run this program, a white sphere will be rendered in wireframe on a black background.

Normally, the inner faces of a model are not rendered, since they are typically not visible. However, when rendering in wireframe mode as shown in the example above, the absence of inner faces might look unnatural. If you also want to render the inner sides, add the following line after creating the sphere model in the program above:
This disables the backface culling feature, allowing the back sides of polygons to be rendered as well.
- 3D Computer Graphics
- Setting Up the Foundation
- Mouse Control and Animation
- Using the Framework
- Creating and Placing Light Sources (and Adjusting Their Properties)
- Creating and Placing Models / Standard Models
- Creating and Placing Polygons, and Various Types of Polygons
- Moving 3D Objects
- Rotating 3D Objects
- Scaling 3D Objects
- Flipping 3D Objects
- Setting Colors for 3D Objects
- Configuring the Shape of 3D Objects
- Fill Settings for 3D Objects
- Material Settings for 3D Objects
- Understanding Coordinate Systems: Concepts, Creation, and Placement
- Moving Coordinate Systems
- Walking Coordinate Systems
- Controlling the Origin Position of a Coordinate System
- Rotating Coordinate Systems
- Spinning a Coordinate System
- Euler Angle-Based Attitude Control of Coordinate Systems
- Camera Work
- Creating, Placing, and Performing Basic Operations on Vectors
- Coordinate Transformations
- Screen Projection
- Collision Detection