mjbWorld program - Extrude Tutorial (without using extrude node)


Extrude is a way to create 3d shapes from 2d shapes. The method shown here creates separate shapes, such as boxes and cylinders. This may not be as efficient, in terms of number of triangles, as using a single extrudeNode, but this method has the advantage of being simpler, and it may be more suitable for games for example, because it is easier to detect collision with these shapes than inside a complex mesh.

For information about the alternative method using the extrudeNode see here.


Start the program (see here for details of how to load the program)

Insert a TransformGoup node. To do this click on to show the 'insert view', then drag a transfornGroupBean from the insert view to the tree view:

Close the insert view and add a 2D view:

It might help to rearrange the views so that they don't overlap:

Setup the 2D view by clicking on its 'info' button. This brings up a dialog window, set the values as follows:

Mode: 3d from plan

Grid size: 20

Show grid - set to enabled.

Snap to grid - set to enabled.

Extrude height: set to 100.

Click on OK

In the 2D view draw some shapes, select the rectangle or circle, using the buttons, and draw these shapes in the 2D view.

These shapes will appear in the tree view, each one under its own transformGroup.

The shapes can also also be seen in the 3D view as they are drawn. In the 3D view select which view you want, also you may need to press fit button to make sure the camera is pointing at the shape.

metadata block
see also:
Correspondence about this page

Book Shop - Further reading.

Where I can, I have put links to Amazon for books that are relevant to the subject, click on the appropriate country flag to get more details of the book or to buy it from them.


Commercial Software Shop

Where I can, I have put links to Amazon for commercial software, not directly related to this site, but related to the subject being discussed, click on the appropriate country flag to get more details of the software or to buy it from them.


This site may have errors. Don't use for critical systems.

Copyright (c) 1998-2015 Martin John Baker - All rights reserved - privacy policy.