100 likes | 330 Views
Assimp. Assimp Website. http://assimp.sourceforge.net/index.html for Assimp documentation, go to: http://assimp.sourceforge.net/lib_html/index.html. Assimp includes. To include Assimp in your project, you will need to use these includes: #include <assimp/Importer.hpp>
E N D
Assimp Website http://assimp.sourceforge.net/index.html for Assimp documentation, go to: http://assimp.sourceforge.net/lib_html/index.html
Assimp includes To include Assimp in your project, you will need to use these includes: #include <assimp/Importer.hpp> includes the importer, which is used to read our obj file #include <assimp/scene.h> includes the aiScene object
Assimp includes cont. #include <assimp/postprocess.h> includes the post-processing variables for the importer #include <assimp/color4.h> includes the aiColor4 object, which is used to handle the colors from the mesh objects
aiScene The main class Assimp uses is aiScene. The aiScene class holds the data for the meshes, textures, materials, lights, etc. Using the importer's ReadFile function returns an instance of the aiScene class filled with all the data present in your obj file. (for ease of use, set the aiProcess_Triangulate flag when using ReadFile)
Useful aiScene Members aiMesh** mMeshes - contains a 2-dimensional array of object meshes aiTexture** mTextures - contains a 2-dimensional array of textures int mNumMeshes and mNumTextures - contain the number of the respective objects in the scene
Useful aiScene Members Cont. bool HasMeshes() bool HasTextures() bool HasMaterials() etc Return whether or not the instance of the aiScene object contain any of the respective object.
aiMesh Contains the vertices, faces, colors, normals, and more that relate to an object Members: aiVector3D* mVertices (and mNumVertces) aiVector3D* mFaces (and mNumFaces) aiVector3D* mNormals aiColor4D* mColors bool HasFaces() bool HasNormals()
Tutorials http://ogldev.atspace.co.uk/www/tutorial22/tutorial22.html http://www.lighthouse3d.com/cg-topics/code-samples/importing-3d-models-with-assimp/