<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>newbie question, tessellation</title>
		<link>http://www.allegro.cc/forums/view/587653</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Fri, 22 Sep 2006 02:25:09 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I&#39;m gonna feel really stupid for asking this, but here it goes</p><p>I just started taking a computer graphics course, and we&#39;ve now started using Allegro C++. We haven&#39;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.</p><p>our next assignment has me stumped. i haven&#39;t taken a programming class in years, and it&#39;s overall very frustrating, which is why I&#39;m making a fool of myself on these forums =)</p><p>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. </p><p>anyone have any ideas or help? it&#39;s greatly appreciated.</p><p>sorry if this is lame <img src="http://www.allegro.cc/forums/smileys/tongue.gif" alt=":P" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (metzor)</author>
		<pubDate>Thu, 21 Sep 2006 02:19:21 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
(this polygon has vertices of (50,0), (25, 25), (50,50), (100,0), (75, 25), (100,0))
</p></div></div><p>
There is probably something wrong with is since you have listed (100,0) twice.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Krzysztof Kluczek)</author>
		<pubDate>Thu, 21 Sep 2006 03:00:20 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Probably the 2nd (100,0) is the way to tell the shape that it&#39;s closing... i&#39;m not sure.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Ib Quezada)</author>
		<pubDate>Thu, 21 Sep 2006 03:03:46 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>typo =o</p><p>there is a 100,0 but the other one is 100,50</p><p>corrected the original post<br />sorry
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (metzor)</author>
		<pubDate>Thu, 21 Sep 2006 03:08:37 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>What&#39;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.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (miran)</author>
		<pubDate>Thu, 21 Sep 2006 16:38:11 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Unless you need to tile it tightly (leaving no spaces). I&#39;m afraid it&#39;s not possible with this shape and I&#39;m not sure there&#39;s a general way to do so.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Ron Ofir)</author>
		<pubDate>Thu, 21 Sep 2006 21:09:19 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
I&#39;m afraid it&#39;s not possible with this shape
</p></div></div><p>
Are you sure? <img src="http://www.allegro.cc/forums/smileys/huh.gif" alt="???" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (miran)</author>
		<pubDate>Thu, 21 Sep 2006 21:12:28 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
Unless you need to tile it tightly (leaving no spaces). I&#39;m afraid it&#39;s not possible with this shape
</p></div></div><p>
It&#39;s a regular hexagon. Of course it&#39;s possible.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Evert)</author>
		<pubDate>Thu, 21 Sep 2006 21:23:09 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
It&#39;s a regular hexagon.
</p></div></div><p>
It&#39;s not a regular hexagon. It&#39;s a kind of an arrow hexagon, pointing to the left. Easier to tile than a regular honey comb style hexagon...
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (miran)</author>
		<pubDate>Thu, 21 Sep 2006 21:43:16 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="source-code snippet"><div class="inner"><pre><span class="k1">void</span> draw_my_shape<span class="k2">(</span> <a href="http://www.allegro.cc/manual/BITMAP" target="_blank"><span class="a">BITMAP</span></a><span class="k3">*</span> bmp, <span class="k1">int</span> x, <span class="k1">int</span> y, <span class="k1">int</span> color <span class="k2">)</span>
<span class="k2">{</span>
  <span class="k1">int</span> points<span class="k2">[</span><span class="n">12</span><span class="k2">]</span> <span class="k3">=</span> <span class="k2">{</span><span class="n">0</span>,<span class="n">0</span>, <span class="k3">-</span><span class="n">25</span>,<span class="n">25</span>, <span class="n">0</span>,<span class="n">50</span>, <span class="n">50</span>,<span class="n">50</span>, <span class="n">25</span>,<span class="n">25</span>, <span class="n">50</span>,<span class="n">0</span><span class="k2">}</span><span class="k2">;</span>
  <span class="k1">for</span> <span class="k2">(</span><span class="k1">int</span> i<span class="k3">=</span><span class="n">0</span><span class="k2">;</span> i<span class="k3">&lt;</span><span class="n">12</span><span class="k2">;</span> <span class="k3">+</span><span class="k3">+</span>i<span class="k2">)</span>
  <span class="k2">{</span>
    points<span class="k3">&lt;</span>i&gt;<span class="k3">+</span><span class="k3">=</span>x<span class="k2">;</span>
    points<span class="k2">[</span><span class="k3">+</span><span class="k3">+</span>i<span class="k2">]</span><span class="k3">+</span><span class="k3">=</span>y<span class="k2">;</span>
  <span class="k2">}</span>
  <a href="http://www.allegro.cc/manual/polygon" target="_blank"><span class="a">polygon</span></a><span class="k2">(</span>bmp,<span class="n">6</span>,points,color<span class="k2">)</span><span class="k2">;</span>
<span class="k2">}</span>
</pre></div></div><p>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Simon Parzer)</author>
		<pubDate>Fri, 22 Sep 2006 02:25:09 +0000</pubDate>
	</item>
</rss>
