|
newbie question, tessellation |
metzor
Member #7,780
September 2006
|
I'm gonna feel really stupid for asking this, but here it goes I just started taking a computer graphics course, and we've now started using Allegro C++. We haven't gotten all that far, we basically were handed a sheet with primitive functions (rectfill, ellipsefill, triangle, etc) and one of our first or second assignments was to tessellate (basically tile) the screen with a checkerboard. This was easy enough, as all it really needed was one set of nested for loops and a rectfill statement. our next assignment has me stumped. i haven't taken a programming class in years, and it's overall very frustrating, which is why I'm making a fool of myself on these forums =) we basically have to take a polygon with 6 vertices. and tile the screen with it. (this polygon has vertices of (50,0), (25, 25), (50,50), (100,50), (75, 25), (100,0)). we also have to make up our own polygon and do the same thing with it, creating something that you might see from mc escher. but i figure if i could just figure out the code for the first one, i could do it with pretty much any polygon. anyone have any ideas or help? it's greatly appreciated. sorry if this is lame |
Krzysztof Kluczek
Member #4,191
January 2004
|
Quote: (this polygon has vertices of (50,0), (25, 25), (50,50), (100,0), (75, 25), (100,0)) There is probably something wrong with is since you have listed (100,0) twice. ________ |
Ib Quezada
Member #7,779
September 2006
|
Probably the 2nd (100,0) is the way to tell the shape that it's closing... i'm not sure. |
metzor
Member #7,780
September 2006
|
typo =o there is a 100,0 but the other one is 100,50 corrected the original post |
miran
Member #2,407
June 2002
|
What's the problem? Do the same thing as you did when drawing the checkerboard, except that instead of drawing rects, you draw this 6-sided polygon (write a function for this). The for loops should advance by 50 pixels each. -- |
Ron Ofir
Member #2,357
May 2002
|
Unless you need to tile it tightly (leaving no spaces). I'm afraid it's not possible with this shape and I'm not sure there's a general way to do so. |
miran
Member #2,407
June 2002
|
Quote: I'm afraid it's not possible with this shape Are you sure? -- |
Evert
Member #794
November 2000
|
Quote: Unless you need to tile it tightly (leaving no spaces). I'm afraid it's not possible with this shape It's a regular hexagon. Of course it's possible. |
miran
Member #2,407
June 2002
|
Quote: It's a regular hexagon. It's not a regular hexagon. It's a kind of an arrow hexagon, pointing to the left. Easier to tile than a regular honey comb style hexagon... -- |
Simon Parzer
Member #3,330
March 2003
|
|