Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 2 of 2

Thread: C loading and rendering models (SDL2, glew, OpenGL 3.3)

  1. #1
    Newbie Newbie
    Join Date
    Sep 2017
    Posts
    1

    Question C loading and rendering models (SDL2, glew, OpenGL 3.3)

    Hi

    I'm new to learning OpenGL and still learning C. I'm using SDL2, glew, OpenGL 3.3, linmath and stb_image.
    I started following through learnopengl.com and got through it until I had to load models. The problem is, it uses Assimp for loading models. Assimp is C++ and uses things I don't want in my program (boost for example) and C support doesn't seem that good.
    Things like glVertexAttribPointer and shaders are still confusing to me, but I have to start somewhere right?

    I can't seem to find any good loading/rendering tutorials or source code that is simple to use and easy to understand.
    I have tried this for over a week by myself, searching for solutions but so far no luck. With tinyobjloader-c and project that uses it, FantasyGolfSimulator, I was able to actually load the model with plain color (always the same color no matter what I do) on screen and move it around, but cannot figure out how to use textures or use its multiple textures with it.
    I don't ask much: I just want to load models with textures in them, maybe have lights affect them (directional spotlight etc). Also, some models have multiple parts and multiple textures in them, how can I handle those?

    Are there solutions anywhere?

    Thank you for your time. Sorry if this is a bit confusing, English isn't my native language

  2. #2
    Member Regular Contributor
    Join Date
    Jul 2012
    Posts
    418
    You can use lib3ds for 3DS files, which is a C library. If I remember well, there are several tutorials and examples provided with it.

    I also quickly found this C library to read obj files. I never used it so I cannot tell much more about it. Since you are in a learning process, this might be interesting for you to do your own obj loader.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •