Skip to content

cpp-toolbox/textured_model_loading

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Info

Code which loads in obj models with textures using assimp to be rendered with opengl.

WARNING: You must following the variable naming guidelines defined in the shaders submodule or else nothing will be rendered as the code that binds to the vertex attributes will get the wrong variable

Dependencies

  • glad - glad opengl function loader
  • glm - to hold vertex data
  • shader pipeline - for drawing with opengl
  • assimp - for loading obj files
  • stb - for loading images

CMake

...

# GLM: opengl mathematics
include_directories(external_libraries/glm)
add_subdirectory(external_libraries/glm)

# ASSIMP: Asset Importer
# only use obj to speed up compilation
set(ASSIMP_INSTALL OFF CACHE BOOL "" FORCE)
set(BUILD_SHARED_LIBS OFF CACHE BOOL "" FORCE)
set(ASSIMP_BUILD_TESTS OFF CACHE BOOL "" FORCE)
set(ASSIMP_NO_EXPORT OFF CACHE BOOL "" FORCE)
set(ASSIMP_BUILD_ALL_EXPORTERS_BY_DEFAULT OFF CACHE BOOL "" FORCE)
set(ASSIMP_BUILD_ALL_IMPORTERS_BY_DEFAULT OFF CACHE BOOL "" FORCE)
set(ASSIMP_BUILD_OBJ_IMPORTER ON CACHE BOOL "" FORCE)
include_directories(external_libraries/assimp/include)
add_subdirectory(external_libraries/assimp)

# STB_H: single file libraries
include_directories(external_libraries/stb)

... 

target_link_libraries(your_project_name ... assimp)

Releases

No releases published

Packages

No packages published

Languages