RE: RE: Steering Game Objects with P.I.D. Control
You are viewing a single comment's thread from:

RE: Steering Game Objects with P.I.D. Control

RE: Steering Game Objects with P.I.D. Control

Indeed. In it's simplest form, a 2D game that is moving a green pixel from left to right on the screen would clear the screen and then set the colour of pixel (x,y) to green and vary x from 0 to Max (and using the same y value each frame.) All current computers use framebuffers that contain all the pixels on the CRT or LCD screen.

The actually setting a pixel colour is just writing to a location in the framebuffer. If the framebuffer holds 320x200 pixels, then setting pixel X,Y to colour C would mean writing the value C at location Y×200+X.

Interestingly, this wasn't always the case. In the early days, there were vector displays. These did not have the concept of scanlines nor pixels. The computer driving a vector display would actually move an electron beam over a screen (in any direction) and turning the beam on and off. Very similar to an oscilloscope actually. Asteroids arcade machines worked that way. The electron beam would trace out the shapes on the screen.

Later computer monitors all wrote the screen left to right top to bottom as pixels on scanlines.

In 3D games it is a little more involved. A world composed of triangles is drawn a triangle at a time, and each triangle is projected onto the screen using linear algebra with 4x4 matrices, after which the corresponding pixels in the framebuffer for that triangle are set to a colour.

H2
H3
H4
3 columns
2 columns
1 column
Join the conversation now
Logo
Center