Generating C++ Code from Mesh Data
 
 
 

If you create a mesh using 3ds Max and wish to capture the data as a sequence of C++ instructions for manually constructing the mesh can be very time consuming if the object contains a large number of vertices.

The MAXScript script found here can be used to write all the mesh generating instructing information to a header (.h) file that you can include in your project. The script can be found Here is how to use the script:

  1. Open the script and evaluate it. This will compile the script and create an action entry in the 3dsmax action system.
  2. In the Customize > Customize User Interface ... dialog, look up the command Mesh2CPP under the 'SDK Tools" category.
  3. Assign this command to a button or hotkey.
  4. Select your object in the viewport.
  5. Run the script. A Save As dialog will appear.
  6. Specify the header filename and select Save.

This will generate a header (.h) file that you can copy or include into the source of your plug-in.