Question:

How does C/C++ programming translate into pictures and movement in games?

by  |  earlier

0 LIKES UnLike

well, i do programming in javascript, and html, but i dont understand how all pictures are translated from code into movement and visual pictures.

please answer!

 Tags:

   Report

4 ANSWERS


  1. The guy above is right however you don't nesscary have to have an engine to do this.



    C++ doesnt create graphics, you have to have something similar to openGL which renders the graphics.

    Now for the example you have an update variable (the ball) where it's bouncing and you have the y pinned to another variable that is constant, and that constant variable is assigned to an image,

    x = ball pos

    y = wall pos

    if( x == y){

    // bounce the ball

    }

    there is a lot of code in this and I would not recommend C++ yet to you, although i'm sure you can do it. I would learn php which is similar to c++ so you can see if you can handle it. there is a lot envolved. best of luck to you.


  2. Your suggestion is along the right track, but in modern games there are a lot more details. For  example, take the idea of someone moving through a tunnel - you have to make sure that the movement doesn't make the person go through the walls or any obstacles, and the behaviour of any object is natural. This is done using a "physics engine", for example Havok.

    For pictures they are individually painted on the screen. For motion, e.g. for a person walking, you display one picture, then you display the person's legs and arms as having moved a little bit, and then another little bit - a set of frames, similar to a film. However there are some optimizations: you only change the part of the screen where the movement occurs rather than redrawing the whole screen every time.

    This is a very, very simplistic description of how to do this stuff. If you're interested in this, learn your math - a big part of motion involves things like matrix multiplication.

  3. C/C++ programming does not translate into pictures themselves but rather tells the CPU and GPU what to do with the pictures that the artist has created and what to do with the models that were made that pictures are placed to create real looking objects. C++ is important because without it all you have is a bunch of resources.

  4. Through the use of a graphics API such as OpenGL or Microsoft's DirectX. And usually in conjunction with third party software like Maya or 3d studio max.

Question Stats

Latest activity: earlier.
This question has 4 answers.

BECOME A GUIDE

Share your knowledge and help people by answering questions.