The FBX SDK ships with the following sample programs that run on all platforms supported by FBX SDK.
Brief sample program | Description |
---|---|
Common | Functions used by other sample programs to initialize objects, destroy objects, load scenes, and save scenes. |
MyOwnWriterReader | Functions used by other sample programs to write and read files in a custom file format. |
Animation | Shows how to create animation and how to evaluate a scene containing animation. Illustrates the use of animation stacks, animation layers, animation curves and animation curve nodes. |
ExportScene01 | Creates and exports an animated scene containing a cylinder deformed by a skeleton made of two segments. |
ExportScene02 | Creates and exports an animated scene containing a sphere morphed by two shapes. |
ExportScene03 | Creates and exports an animated scene containing a textured cube, and a pyramid with materials mapped on its faces. |
ExportScene04 | Creates and exports a scene containing a group of lights, a marker, and a camera. The animation rotates the lights and moves the camera. |
ExportScene05 | In FBX, the position of a node is expressed in coordinates relative to the node’s parent. This example shows how to convert between FBX coordinates and a global coordinate system. |
ImportScene | Displays the content of any FBX file. |
Instances | Creates several instances of the same cube mesh and animates them using animation curves. |
Layers | Creates a scene containing a cube with layered textures and materials mapped on each of the cube’s faces. Illustrates how to use layers. |
UserProperties | Illustrates how to create user properties, attach the properties to a cube, and then animate the properties; how to create a constraint between a pyramid and a cube. |
ViewScene | Shows how to evaluate the animation data and compute deformations. This is necessary for displaying the content of any FBX SDK-supported file in a graphical window. Uses the OpenGL Utility Toolkit (GLUT). A menu lets you select the view, the current camera, the current animation stack, etc. |
Folders for each of these programs are located in <yourFBXSDKpath>\examples\. Each folder contains Visual Studio project files (Windows only) or makefiles (Mac OS or Linux) to help you build and run the program.
The Common folder does not contain a standalone example.
It contains a common.cxx file, which shows how to use FBX SDK to perform basic operations such as creating and initializing scenes, destroying scenes, loading scenes, and saving scenes. The other sample programs call the functions defined in this file.
This sample program creates a scene containing only one property, a few animation curves, and the data structures that animate the property by connecting the curves to the property. The program then shows how to evaluate the scene using KFbxEvaluator.
This sample program illustrates how to:
This sample code shows how to use the FBX SDK to write and read files in a custom file format, i.e., a file format not directly supported by the FBX SDK. The sample code reads and writes “CustomWriter” files.
The MyOwnWriterReader folder does not contain a standalone sample program. Instead, it contains sample functions that support CustomWriter files. The sample functions are in turn used by other sample programs (ExportScene05, ImportScene, and ViewScene) to write and read CustomWriter files.
For more information, see Customizing the FBX SDK.
The scene created in this example is a cylinder linked to a skeleton made of two segments. Two animation stacks show the influence of the skeleton segments over the cylinder.
This sample program illustrates how to:
The scene created in this example is a sphere morphed by two shapes. An animation stack shows the influence of the shapes over the sphere.
This sample program illustrates how to:
The scene created in this example is a textured cube and a pyramid with materials mapped on its faces. The animation displays six different angles of both models.
This sample program illustrates how to:
The scene created in this example contains a group of lights, a marker, and a camera. The animation rotates the lights and moves the camera.
This sample program illustrates how to:
The scene created in this example contains a skeleton made of three segments. The position of a node in an .fbx file is expressed in coordinates relative to its parent. This example shows how to convert to and from a global position.
This sample program illustrates how to:
This example illustrates how to detect if a scene is password protected, and how to import and browse the scene to access node and animation information. This example displays the contents of an .fbx file that is passed as program argument. It shows how to traverse an FBX scene graph and retrieve its contents. You can try this example using any of the .fbx files outputted by the export examples above.
This example illustrates how to instantiate meshes and curves. The example creates a scene with several instances of the same cube and animates them using an animation curve.
In this example, a scene is created containing a cube with layered textures and materials mapped on each of the cube’s faces. This example illustrates how to use texture layers.
In this example, a scene is created containing a cube, a pyramid, and user properties.
This sample program illustrates how to:
This example illustrates how to display the contents of a .fbx or a .obj file in a graphical window. This program is based on the OpenGL® Utility Toolkit (GLUT). Start the program on the command line by providing the name of any FBX SDK-supported file. A menu will open letting you select the current camera and the current animation stack.
This sample program illustrates how to: