CS 480/680 Class Projects
PA5 - Assimp and Model Loading
Objective:
- Use Assimp to load models (and then display them)
- Note: Grad students are to do colors as well.
Assimp: Open Asset Import Library
- Assimp Source and Documentaiton can be found at http://assimp.org/
Assimp Tutorials:
- http://ogldev.atspace.co.uk/www/tutorial22/tutorial22.html
- http://nickthecoder.wordpress.com/2013/01/20/mesh-loading-with-assimp/
Notes:
- After Assimp is installed, in your makefile, you will need to add the path to Assimp. At the end of your library declarations, add: -lassimp
- To include Assimp in your project, use:
- #include <assimp/Importer.hpp> //includes the importer, which is used to read our obj file
- #include <assimp/scene.h> //includes the aiScene object
- #include <assimp/postprocess.h> //includes the postprocessing variables for the importer
- #include <assimp/color4.h> //includes the aiColor4 object, which is used to handle the colors from the mesh objects
- To read an object file, use the Assimp::Importer::ReadFile
function:
- Assimp::Importer importer;
- importer.ReadFile(/*File Name*/, aiProcess_Triangulate);
- This function returns the Assimp class
aiScene. An aiScene contains materials, meshes,
and textures and more, and when assigned the
output from the Importer::ReadFile function, it
will contain everything from the object file that
you will need. (You can check the documentation
to see the names and types of the aiScene object
members)
The aiScene object contains the member mMeshes, which contains the vertices (mVertices and mNumVertices), faces (mFaces and mNumFaces), and colors (mColors) that you will need to populate your model matrices.
- Assigned: Week 5
- Due: Wednesday Week 6
- A clone of your GitHub repository will be made at 6:00am on
the due date. Don't forget to push your code by that time.
This clone will be evaluated and your grade posted.
- Since this is a group project there needs to be a listing of your team in the project
README.md on EACH member of the project's repository along with info about which repository
has the project code.