Relative Content

Tag Archive for copenglsdl

Why this book uses 28 vertices to make a cube?

I was using the book “Game Programming in C++: Creating 3D Games (Game Design)” to learn how to program a game with C++, SDL and Opengl. I was trying to make a simple cube, but beforehand I searched in the internet about it and find out that you need to use 24 vertices to make a cube, but then I went to see in the book how they did it and I stumbled upon this.

Why does my quad not render as I expect it to?

I’m learning about how OpenGL and 3D rendering works and I’ve been following this tutorial. I’m doing some things slightly differently (using C instead of C++ and using my own matrix calculation implementation instead of GLM). My program is supposed to render a quad in 3D space. My problem is that when I run the program, it shows a blank screen if I use the same coordinates as him. I can change the coordinates to put the quad in view, but it looks distorted.