ASSIMP -> Documentation -> How to: load basic shapes

How to get basic shapes (sphere, cube, ...) easily

You can simply use the NFF (Neutral File Format) for this task. NFF is quite a simple, text-based format that allows you to create spheres, cones and cylinders with just a single line. To get a sphere with position (x,y,z) and radius r, use a file with this contents:

testsphere.nff

--- begin of file
s x y z r
--- end of file

The full specification of the NFF format can be found here. However, ASSIMP extends this specification and supports more basic shapes, including all platonic solids ('#' starts a comment line):

testplatonicsolids.nff

--- begin of file
# A tetrahedron at -10 0 0 with a 'radius' of 2
tet -10 0 0 2
# A cube at -7 0 0 with a 'radius' (a/2) of 2
hex -7 0 0 2
# An octahedron at -4 0 0 with a 'radius' of 2
hex -4 0 0 2
# A dodecahedron at -1 0 0 with a 'radius' (a/2) of 2
hex -1 0 0 2
# An icosahedron at 2 0 0 with a 'radius' (a/2) of 2
# This is a non-tesselated sphere. 'tess' sets the number of subdivisions.
# The default value for spheres is 4.
tess 0 s 2 0 0 2
--- end of file
(the 'radius' is the radius of the respective circumscribed sphere)

Get Open Asset Import Library at SourceForge.net. Fast, secure and Free Open Source software downloads