C++ game from scratch in 3d with models

Started by
11 comments, last by kks21199 11 years, 2 months ago

Hello, guys, i just wonder how could i make a game from scratch in c++. I know it is easy to make tic-tac-toe and such thin, but how do you make a 3d game. Can anyone show me how ? Or i will give some models and can anyone help me by showing how to do it or is there anothher tutorial out there already ??

Ya, i know, we can use game engines, like unity ce3 or ue3, but still I just want to learn...

Advertisement
It is generally best to start with the basics.

Obviously you will need a good understanding of the c++ language and libraries. It is much better to learn how to use the language effectively by working on many small projects rather than jumping in to the fire with a huge project and no inkling of what you are doing.

Your knowledge of the language and system libraries will need to cover a wide range of algorithms, data structures, containers, serialization, scheduling, and so on. You will probably also want to pick up some audio libraries, user interface libraries, and so on. Just like with learning the language, it is often best to learn these on smaller projects rather than jumping in to a huge project without any prior understanding.

Next, for a 3D game you will need a solid understanding of linear algebra. That is the mathematics of 3D rendering. Usually it is taught at the college level, but some programmers are able to pick it up from web tutorials and such. Again, it is easier to understand matrix and vector manipulations, transformations, topologies, eigenvalue/vector uses, and so on, by learning them on a smaller scale before jumping in to a large scale.

Once you understand the mathematics behind it, you'll need to learn how to implement the math. Usually this takes place by writing your own 3D skinning code, animation code, motion controllers, etc., accompanied by assorted questions about why your 3D model sometimes looks like a pile of exploded triangles rather than the intended shape. It also includes learning to write shaders and particle systems and much more. Just like above, smaller projects are easier for learning.


It is NOT just a matter of a beginner opening a text editor, throwing together a bit of code, and pointing it at a collection of 3D models.

As Frob mentioned, aside from C++ you definitely need strong understanding of some linear algebraic terms. However there are more things to cover as well. otherwise it will be just a rendering engine not a game. A game has to be interactive in order to be called a game. for that reason you need some collision detection engine. if you are brave enough to implement that yourself, then you need to learn math behind collision detection as well.

start with something simple such as AABB vs ray, AABB vs AABB, OBB vs OBB Sphere vs Sphere and so on. You must understand the basics of matrix and vector manipulation before you dive in to collision detection though, otherwise you won't make sense of things.

I would recommend following books.

3D math primer for Game development(by Fletcher Dunn & Ian Perberry)

and

3D game engine Programming(by Stefan Zerbst & Oliver Duvel)

Just to highlight a point that I think gets smoothed over in Frob's coverage (no knock to the otherwise great primer on the size of the step you're taking), the word libraries is a huge component. DirectX (specifically Direct3D) or OpenGL will likely be necessary, as almost no one just straight-codes all the 3d functions and graphics-card interfaces necessary to do 3d graphics rendering. All the current engines you're referencing use these for their 3d graphics. Both libraries are still low-level enough that you'll get PLENTY of practice implementing your game-specific 3D tasks.

OpenGL and Direct3D have plenty of tutorial series across the web, just google them. They all rely to some degree on the reader being comfortable in C++ already (syntax and general programming concepts for sure).

Hazard Pay :: FPS/RTS in SharpDX (gathering dust, retained for... historical purposes)
DeviantArt :: Because right-brain needs love too (also pretty neglected these days)

ya, i just want to see a sample project now, so i can see how they are doing it.

ya, i just want to see a sample project now, so i can see how they are doing it.

Like Frob said, trying to grasp the whole concept at once will only result in frustration.

ya, i just want to see a sample project now, so i can see how they are doing it.


Finding source code isn't hard. Just seaarch github for "3d game".
If you make a 2D game that just uses 3D graphics, the only thing that needs to be different about the engine is the rendering component.
So what you actually need is tutorials to use a graphics interface, not an entire game engine.

These tutorials read very nicely and use modern-style OpenGL. As you can see, model loading comes up at tutorial 7.
http://www.opengl-tutorial.org/

thanks guys

and also atleast give me a source for a begineers to start off

This topic is closed to new replies.

Advertisement