Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

136 Neutral

About MyNiceDisplayName

  • Rank
  1. MyNiceDisplayName

    Vectors and Matrices: A Primer

  2. MyNiceDisplayName

    Problem with texturing using Assimp (C++/OpenGL)

    Thank you :) I downloaded Open3Mod, and I think it will be very helpful for me in future.
  3. MyNiceDisplayName

    Problem with texturing using Assimp (C++/OpenGL)

    Thank you, you are absolutely right! It was the textures. After reading your comment, I checked the IMG_Load function once more: glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, surface->w, surface->h, 0, GL_RGB, GL_UNSIGNED_BYTE, surface->pixels); As you see, this will only work for GL_RGB. I simply changed GL_RGB to GL_RGBA(when image is 32bit), and now it's displaying the 3D model perfectly. Thank you for recommending me Open3Mod. I will be using that one from now on : )
  4. Recently I've been following some turorials trying to learn how to import textured 3D models using Assimp. I am now able to load and display (single- or multitextured) 3D models, in both .obj and .m2d format. However, there are some models I am not able to display properly, such as this one: http://static.tf3dm.com/models/3dregenerator/Game%20Packs/Final%20Fantasy%20X/FFX%20Tidus.7z I can load it using Blender, but when I try to ty display it using my program, it looks like this: AssimpViewer.exe also fails to load it (the program crashes) so I was hoping I could blame assimp for it, but when I checked the data loader aiScene in my program it seemed like it had imported all textures and texture coords properly. (I have uploaded my  class header file together with this post, in case you want to see the whole code). Basically, what I do is to load the vertices, indices and texture coordinates from each aiMesh into some buffers, and display it using glDrawElements:   for (MeshEntry mesh : meshEntries) {                 // VBO             glEnableVertexAttribArray(0);             glBindBuffer(GL_ARRAY_BUFFER, mesh.VBO);             glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 0, 0);                      // TBO             glEnableVertexAttribArray(2);             glBindBuffer(GL_ARRAY_BUFFER, mesh.TBO);             //glVertexAttribPointer(2, 3, GL_FLOAT, GL_FALSE, 0, (const GLvoid*)20);             glTexCoordPointer(3, GL_FLOAT, 0, 0);             glBindTexture(GL_TEXTURE_2D, textures[mesh.materialIndex]);             // Bind indices             glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, mesh.IBO);             glDrawElements(GL_TRIANGLES, mesh.indices * 3, GL_UNSIGNED_INT, 0);         }         SDL_GL_SwapWindow(mainWindow); VBO = Vertex buffer TBO = Texture buffer IBO = Index buffer This works perfectly fine for most 3D models I try to load, but not for all. All 3D models that I have failed to display properly until now, also made AssimpViewer crash. Any suggestion what I am doing wrong? (If the above link doesn't work, you can download the model from here: http://tf3dm.com/download-page.php?url=tidus-77545)
  5. MyNiceDisplayName

    Game framework / Game state engine

    Thank you! I got some ideas from watching this tutorial. The book seems very  interesting too.
  6. MyNiceDisplayName

    Game framework / Game state engine

    Ok, thank you very much!
  7. 0 down vote favorite I want to try make an RPG game(in Java), and have encountered some questions regarding the framework of the game. I have very little experience with game framework, and the only tutorials I've found on this don't seem to work well for a largert RPG.   The post ended up being quite long, so if you don't feel like reading all of it I'd be grateful if you could share some links if you know about any good tutorials on this!   Since there is going to be a lot of code I suppose I will need to create separate classes for the different "game states", such as Main Menu, World Map, Local Map, Start Screen, etc. To handle these different states of the game, I decided that I will make a "game state" class (or "framework" class if you want) which has a variable "GameState(enum)" and. Furthermore, I do not want to create a new screen to draw on for each of these classes, so I should also create a separate class for the screen.   My question is: How do I go about putting all this together? The first thing that came to mind was to start the actual game in the "game state" class. The Screen class extends JFrame, and classes that will draw on the screen extend Canvas. If the game state changes from "Loading" to "Main Menu", the "game state" class says something like "Screen.add(MainMenu)", so that everything drawn in the Main Menu class will be showed on the Screen. The "game state" class will be the core of the game, and can controll all the different classes. Does this sound like a good idea? If the player leaves the "local map" and needs to enter "world map", somehow I need to tell the State Engine to change the state. Should I simply declare an instance of "StateEngine" in the local map class, so that the local map class has access to its state engine? (and let the state engine class set it to "LocalMap.StateEngine = this"?)   I'm very sorry if my questions seem confusing. I am quite confused about this, so any suggestions for a good game framework are more than welcome!  
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!