Computer Graphics II - HW 2 - Dynamic Cube Mapping
Hi everyone, in this post, I will talk about my second assignment in CENG469 course, which is cubemapping. Firstly, I will explain how I implement the homework, then I will talk about issues that I faced during the implementation. So, let's begin!
Flight Simulator |
In this assignment, we were expected to implement environment mapping and reflection capabilities using cubemaps in OpenGL. Normally, the expected end product of this assignment is a drivable car. However, I want to fly an airplane, because why not :) It is also mentioned in the homework text that we are free to implement our own design choices. Then, I start to create the flight simulator.
Firstly, as a challenge to myself, I want to build an abstract renderer like a mini-game engine, not just a single file program. Since I am dealing with an application with a renderer in my senior project, I wanted this homework codebase to look like this. :)
Then, I created corresponding classes:
- Camera.h: helps to show our scene :)
- Mesh.h: store mesh data in buffers
- Shader.h: create shaders, and send uniform data to corresponding shaders
- Renderer.h: bind those buffers as shader attributes, and render with index buffers, load textures
- UAV.h: whole flight mechanisms calculated here
- SkyBox.h whole skybox calculations done here
Secondly, I started to search suitable 3D obj files to my scene. However, since the obj file parser from the given SampleGL codebase only render faces with 3 vertices, whenever I found a mesh has more than that so I cannot use it. It is again a design decision, should I change my obj file parse or should I edit 3D meshes that I found on the internet. Of course, the easy way is that editing the mesh files :D. I solved this problem by using MeshLab. (Oh god, I love MeshLab) As a note, by using MeshLab you can also swap axises of meshes pretty easily. When you choose "export as mesh" option in MeshLab, and choose obj file, you will see this exporting window. Once you disable "Polygonal" option, the mesh you exported will be suitable for SampleGL obj parser.
Thirdly, since I wanted to create a flight simulation, I should learn some aircraft mechanics formulation. I spent some time on learning flight mechansim then I found this beautiful resource https://aircraftflightmechanics.com/AircraftPerformance/GlidingFlight.html which gives you very detail about aircraft system. Since I am not going create a real flight simulator :D I just need to learn very basic terms like lift, drag, thrust etc.
Aircraft Flight Mechanics |
Flight Movement |
Issues:
- I rendered mesh with red color. I couldn't understand first, after 2 days I figured it out.
Reddish mesh |
- I think I have a problem with creating dynamic cubemap. However, I couldn't find it where the problem is :( Since today is the deadline I leave it as it is.
Comments
Post a Comment