From db0bc36c52a223f96bf0b517ef1053ba6b6b16d9 Mon Sep 17 00:00:00 2001 From: sanine Date: Thu, 22 Sep 2022 01:02:12 -0500 Subject: add uv loading --- src/import/import.c | 48 ++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 46 insertions(+), 2 deletions(-) (limited to 'src/import/import.c') diff --git a/src/import/import.c b/src/import/import.c index 73075d4..d58de0f 100644 --- a/src/import/import.c +++ b/src/import/import.c @@ -42,6 +42,8 @@ void push_aistring(lua_State *L, struct aiString str) * mNumVertices * mTangents * mVertices + * mNumUVComponents + * mTextureCoords * * TODO: * mAnimMeshes @@ -52,9 +54,7 @@ void push_aistring(lua_State *L, struct aiString str) * mName * mNumAnimMeshes * mNumBones - * mNumUVComponents * mPrimitiveTypes - * mTextureCoords * mTextureCoordsNames */ void push_mesh(lua_State *L, struct aiMesh mesh) @@ -92,6 +92,33 @@ void push_mesh(lua_State *L, struct aiMesh mesh) pop_count += 2; } + /* uvs */ + int uvs = 0; + int uv_components = 0; + int uv_channels[AI_MAX_NUMBER_OF_TEXTURECOORDS]; + for (int i=0; i