
#1
Dec2512, 09:03 PM

P: 5

Hello, I just have a basic geometry question (really within the context of computer graphics). What is the significance in triangulating polygons? Why not squares, or polys with more angles? Why triangles? Is that because it is the simplest representation of a closed area? Also, is it due to trigonometric functions being able to operate on triangles? Are there similar functions in mathematics for rectangles, etc? I never took geometry in school, so now that I'm working with 3D graphics these questions are on the brain!




#2
Dec2612, 12:30 AM

HW Helper
P: 2,168

The Sega Saturn used quadrilaterals as primitives. Any polygon triangle or higher can be used. Any polygon can be broken into triangles. There is potential in using higher polygons, but it also caused problems because triangles are the standard much of the hardware and software is optimized for them. Often when evaluating the tradeoffs it is better to just use more triangles.




#3
Dec2612, 03:50 AM

P: 4,570

Hey Synthetix and welcome to the forums.
The main advantage is they form a plane (minimum to form one) and you can do them in parallel with the right hardware design (and algorithms). The way graphics cards are setup nowadays, you have a vertex pipeline and a fragment pipeline. With triangles, these are well understood and the card can be optimized to do them per triangle since it is uniform for all triangles but not necessarily for other nonparametric primitives (like quadrilaterals). 



#4
Dec2612, 11:45 PM

P: 5

Basic geometry question
Thanks for the replies. I wasn't aware that the Saturn used quads as primitives. I read the Wikipedia entry on it and was surprised to see that triangular surfaces required the fourth edge to be a length of zero! That's just wacky, especially when we're so used to triangles. And texturing must be a real challenge in this case!
What about it terms of geometry (math) in general? Clearly, trigonometry operates on triangles, but are there similar mathematical functions that operate on other polygons? I haven't come across any computer graphics math from what I can recall that would be specific to anything more than a triangle or quad. 



#5
Dec2712, 03:27 AM

P: 4,570

Are you familiar with how triangles are rasterized (i.e textured) in terms of the technique?




#6
Dec2712, 11:33 AM

P: 5

I've recently tried to take on shadow mapping, and although I am getting a "result," it is not correct. How the fragment shader takes coordinates from lights and objects and rasterizes shadows is beyond me at the moment. I've of course used a lot of code taken from forums, etc., but again I really don't understand how the math is working (it's more of a "try this, oops, that doesn't work, try something else" approach). That's why I've decided I need to understand the math better, not just "paste this code and see if it works." 



#7
Dec2712, 05:50 PM

P: 4,570

The basic texturing method involves interpolation.
You do is do a line by line scan of the triangle raster by associating the texture coordinates with the endpoints of the triangle. You then do a horizontal line scan and interpolate across each line for the texels (texture element) and that location on the screen buffer becomes the texel. So in short, you do a series of horizontal line scans and each line retrieves the texels for that line and dumps that in the screen buffer which is what you see. 



#8
Jan213, 04:19 PM

P: 810

Three points are the smallest number of points to define a plane, as chiro said.
Furthermore, any more points, and you have to CHECK they all fall on the same plane. Three points always define a triangle, but four points don't always form a quadrilateral! Triangles are also a "finer" structure. If you're approximating a sphere with triangles, you will get a much more accurate result if you're using triangles instead of quads (given the same number of points). Three ordered points also gives you a very fast way to take the normal of the triangle's plane. If your tri has coordinates(p0, p1, p2), then simply take the cross product of (p1  p0) x (p2  p1), and normalize it. 


Register to reply 
Related Discussions  
basic geometry question re isosceles triangles  General Math  3  
Basic Geometry Question  General Math  1  
Basic diff. geometry question  Gradient of F  Differential Geometry  4  
Basic geometry question regarding hexagons.  Differential Geometry  2  
Basic integration, geometry  Calculus  0 