Ketsji unveilled

module owner: Janco Verduin

Version: $Id: graphics.html,v 1.2 2001/05/28 15:18:08 janco Exp $

The graphics module

bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla

[top]


The graphics module in detail

Triangles, strips, fans

Drawing triangles is the most basic way we draw. We say: here are three positions, make a triangle out of them. A triangle is the most basic form you can draw: you can think of a square as two triangles, and from just two positions you just can't make a surface.

Usually you don't want to draw a single triangle, but lots of them. Off course you can draw all the triangles seperately but there are smarter ways to do it. If you want to draw two triangles that are next to each other and you draw them seperately, you have two pass on six positions. But you can also do it with four. When you finished your first triangle, pass the coordinate of the second triangle that doesn't overlap with the first. So with every triangle that you add, you only have to add one coordinate. When you draw such a group of triangles, you get a strip, that's why we call them strips. The direction of the odd triangles are the opposite of the even triangles. When you start with a triangles that is drawn clockwise, then the second triangles will be drawn counterclockwise. The third will be clockwise agian etc.

Another way to draw multiple triangles is, after you've drawn your first one, to take the first coordinate, the last one and a new one. This way you get a series of triangles all in the same direction, with one coordinate in common. We call this type fan.

Strips are the preferred way of drawing our little friends. They are the most optimized way. We try to draw as many triangles of a model as strips, then as fans and the rest as single triangles.

Meshes, polygons

A mesh is a model in a 3D environment. A mesh is made out of polygons, and a polygon consists of three vertices (x, y & z coordinate), three normals (again x, y & z), four colour values ( r(ed), g(reen), b(lue) and a(lpha)) and two texture coordinates (u & v). The polygons are stored in a strided array. This means that if we store the polygon in a 32 bit int, we know that we have to read the first three coordinates out of the value, jump 32 bits and read the next three coordinates.
If we draw the polygons in an implicit way, we draw them in the way they are presented to us. If we draw them in an explicit way, we draw them by means of an index array. An example of an index array is [1,3,4,2,3,7,41,26,5]. Here the first three are the first triangle, the next three are the second and the last three are the last triangle.

[top]


Using the graphics module

bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla

[top]


The OpenGL rasterizer

bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla

[top]


The D3D rasterizer

We don't have one yet!

[top]


The PS2 rasterizer

We don't have one yet!

[top]


Back to index ketsji unveilled