geometric trigonometry

dejitaru

Banned
Sep 29, 2002
627
0
0
Why are graphics cards only capable of rendering triangles? Why not actual polygons?

Why does an extra light slow the rendering time so?

Why are reflections so slow?
 

RossGr

Diamond Member
Jan 11, 2000
3,383
1
0
Since every polygon is simply a collection of triangles, the triangle is the fundamental unit. Databases like consistent data since every surface can be tiled by a collection of polygons and triangle the most general solution is to simply tile with triangle.

The answer to the last 2 questions must simply be it takes more time to process more data.
 

dejitaru

Banned
Sep 29, 2002
627
0
0
Well, actually, I was looking for a more technical explanation.

Are all triangles rendered at exactly the same speed disregarding size or location?
 
Nov 22, 2002
82
0
0
I think the reason they use triangles is because the math is very simple with a triangle. To transform or rotate a triangle simply requires having a 4x4 coordinate matrix and multiplying by another 4x4 matrix which you can derive using trig to figure out what the new coordinates of your triangle will be. All 3d cards are capable of doing 4x4 matrix multiplication in hardware. The math becomes relativley complex when you use different shaped polygons with more coordinates.
 

CTho9305

Elite Member
Jul 26, 2000
9,214
1
81
1. To render a polygon, you have to fill the pixels inside it. Doing this is trivial as long as the polygon is convex. It is impossible to get a concave triangle, so triangles are safe to fill using the fastest alrogithms. I don't think the guy above me is correct about the math - transforms are done vertex by vertex, not for a whole polygon at a time (at least in the engine's I've read about - but they were pretty old so newer engines may do it that way - I don't know)

2. To light each polygon, you have to calculate at what angle each light strikes it (And consider stuff like distance, etc, depending on lighting method used). Add more lights, and you have to do all those lighting calculations another time.

3. In a scene without reflections, you can figure out what objects are "behind" the viewer at an early stage and completely drop them. This cuts what you have to worry about in the later stages (filling polygons, texturing them, lighting them, clipping the view to show only what should be onscreen). With reflections, you now have to consider those objects as well.
 

RossGr

Diamond Member
Jan 11, 2000
3,383
1
0
I am not certain how the modern graphics enginees handle the numbers. Generally speaking a triangle consists of 2 vectors defined by the 3 verticies of the triangle, To find the direction the surface is facing you compute a cross product, this gives the fundamental information that would be need to compute lighting etc.

All translations and rotations are a simple a matrix multiplication done on each vector, a single 3x3 matrix can be generated that contains both rotation and translation information. Really the math involved is not that bad, but it requires lots of mathematical operations, something like 9 multiplations and 6 adds per vector *2 per triangle) it can easily be done with pensile and paper, it would take longer though!