<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>ALLEGRO_PRIM_QUAD</title>
		<link>http://www.allegro.cc/forums/view/604303</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Thu, 10 Jun 2010 16:24:32 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Any chance we could get an ALLEGRO_PRIM_QUAD primitive type? I am in need of a function that works like OpenLayer&#39;s Bitmap::BlitDistorted() function. I tried using triangles but the texture doesn&#39;t get stretched correctly.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Todd Cope)</author>
		<pubDate>Wed, 09 Jun 2010 03:29:03 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I think you might be doing something wrong if the texture isn&#39;t applied correctly... But we don&#39;t have quads now because some hardware doesn&#39;t support them (some entire platforms don&#39;t support them)... I don&#39;t see any need. Maybe you could post your code?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Trent Gamblin)</author>
		<pubDate>Wed, 09 Jun 2010 03:41:09 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>The problem I&#39;m having is I am wanting to do some simple 3D effects but with triangles I am not getting the correct perspective on the texture. Because each triangle is rendered separately I get one triangle with the texture stretched one way and the other with the texture stretched another way. The effect I want cannot be done with triangles without actually using 3D.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Todd Cope)</author>
		<pubDate>Wed, 09 Jun 2010 04:18:15 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Sorry, I don&#39;t know what OpenLayer&#39;s Bitmap::BlitDistorted() does. Can you explain? Sometimes when you need a 3d effect, you need to use 3d?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Trent Gamblin)</author>
		<pubDate>Wed, 09 Jun 2010 04:21:51 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p><a href="http://retrospec.sgn.net/~openlayer/Bitmap/BlitDistorted.html">Here</a> is a description of the function:</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>Draws the bitmap such that the given coordinates describe the positions of the corner points of the bitmap in the screen. </p><p>Coordinates are given in a clockwise order starting from the top-left coordinate. The bitmap will be stretched to fill the quadrate area inside the corner points.</p></div></div><p>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Todd Cope)</author>
		<pubDate>Wed, 09 Jun 2010 04:30:22 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Ok.. I&#39;m not even sure how you would do that without shaders or making a bunch of triangles. I wouldn&#39;t add it to Allegro, I think it&#39;s too specialized but wait for the smart people to speak.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Trent Gamblin)</author>
		<pubDate>Wed, 09 Jun 2010 04:34:43 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Trent, BlitDistorted actually uses a quad, here it is in case you want to take a loot at it:
</p><div class="source-code"><div class="toolbar"><span class="button numbers"><b>#</b></span><span class="button select">Select</span><span class="button expand">Expand</span></div><div class="inner"><span class="number">  1</span><span class="k1">void</span> Bitmap::
<span class="number">  2</span>BlitDistorted<span class="k2">(</span> <span class="k1">float</span> x1, <span class="k1">float</span> y1, <span class="k1">float</span> x2, <span class="k1">float</span> y2, <span class="k1">float</span> x3, <span class="k1">float</span> y3,
<span class="number">  3</span>               <span class="k1">float</span> x4, <span class="k1">float</span> y4, <span class="k1">const</span> RenderMode <span class="k3">&amp;</span>mode, <span class="k1">float</span> fact <span class="k2">)</span> <span class="k1">const</span> <span class="k2">{</span>
<span class="number">  4</span>   mode.Select<span class="k2">(</span><span class="k2">)</span><span class="k2">;</span>
<span class="number">  5</span>
<span class="number">  6</span>   GetReadyToRender<span class="k2">(</span> fact <span class="k2">)</span><span class="k2">;</span>
<span class="number">  7</span>
<span class="number">  8</span>   OlRect renderArea <span class="k3">=</span> mode.GetRenderRect<span class="k2">(</span> OlRect<span class="k2">(</span> <span class="n">0</span>.<span class="n">0</span>, <span class="n">0</span>.<span class="n">0</span>, textureInfo.imgWidth, textureInfo.imgHeight <span class="k2">)</span><span class="k2">)</span><span class="k2">;</span>
<span class="number">  9</span>   OlTexCoords texCoordArea <span class="k3">=</span> mode.GetTexCoords<span class="k2">(</span> OlTexCoords<span class="k2">(</span> textureInfo <span class="k2">)</span><span class="k2">)</span><span class="k2">;</span>
<span class="number"> 10</span>
<span class="number"> 11</span>   texCoordArea.CalculateTextureCoords<span class="k2">(</span><span class="k2">)</span><span class="k2">;</span>
<span class="number"> 12</span>
<span class="number"> 13</span>   <span class="k1">bool</span> setsTexCoords <span class="k3">=</span> mode.SetsTexCoords<span class="k2">(</span><span class="k2">)</span><span class="k2">;</span>
<span class="number"> 14</span>
<span class="number"> 15</span>   <span class="k1">float</span> w <span class="k3">=</span> textureInfo.imgWidth<span class="k2">;</span>
<span class="number"> 16</span>   <span class="k1">float</span> h <span class="k3">=</span> textureInfo.imgHeight<span class="k2">;</span>
<span class="number"> 17</span>
<span class="number"> 18</span>   glBegin<span class="k2">(</span> GL_QUADS <span class="k2">)</span><span class="k2">;</span>
<span class="number"> 19</span>      <span class="k1">if</span><span class="k2">(</span> setsTexCoords <span class="k2">)</span>
<span class="number"> 20</span>         mode.SetTexCoord<span class="k2">(</span> OL_TC_BOTTOMLEFT, renderArea, texCoordArea, w, h <span class="k2">)</span><span class="k2">;</span>
<span class="number"> 21</span>      <span class="k1">else</span>
<span class="number"> 22</span>         RenderMode::PrimarySetTexCoord<span class="k2">(</span> OL_TC_BOTTOMLEFT, renderArea, texCoordArea, w, h <span class="k2">)</span><span class="k2">;</span>
<span class="number"> 23</span>
<span class="number"> 24</span>      glVertex2f<span class="k2">(</span> x4, y4 <span class="k2">)</span><span class="k2">;</span>
<span class="number"> 25</span>
<span class="number"> 26</span>      <span class="k1">if</span><span class="k2">(</span> setsTexCoords <span class="k2">)</span>
<span class="number"> 27</span>         mode.SetTexCoord<span class="k2">(</span> OL_TC_BOTTOMRIGHT, renderArea, texCoordArea, w, h <span class="k2">)</span><span class="k2">;</span>
<span class="number"> 28</span>      <span class="k1">else</span>
<span class="number"> 29</span>         RenderMode::PrimarySetTexCoord<span class="k2">(</span> OL_TC_BOTTOMRIGHT, renderArea, texCoordArea, w, h <span class="k2">)</span><span class="k2">;</span>
<span class="number"> 30</span>
<span class="number"> 31</span>      glVertex2f<span class="k2">(</span> x3, y3 <span class="k2">)</span><span class="k2">;</span>
<span class="number"> 32</span>
<span class="number"> 33</span>
<span class="number"> 34</span>      <span class="k1">if</span><span class="k2">(</span> setsTexCoords <span class="k2">)</span>
<span class="number"> 35</span>         mode.SetTexCoord<span class="k2">(</span> OL_TC_TOPRIGHT, renderArea, texCoordArea, w, h <span class="k2">)</span><span class="k2">;</span>
<span class="number"> 36</span>      <span class="k1">else</span>
<span class="number"> 37</span>         RenderMode::PrimarySetTexCoord<span class="k2">(</span> OL_TC_TOPRIGHT, renderArea, texCoordArea, w, h <span class="k2">)</span><span class="k2">;</span>
<span class="number"> 38</span>
<span class="number"> 39</span>      glVertex2f<span class="k2">(</span> x2, y2 <span class="k2">)</span><span class="k2">;</span>
<span class="number"> 40</span>
<span class="number"> 41</span>      <span class="k1">if</span><span class="k2">(</span> setsTexCoords <span class="k2">)</span>
<span class="number"> 42</span>         mode.SetTexCoord<span class="k2">(</span> OL_TC_TOPLEFT, renderArea, texCoordArea, w, h <span class="k2">)</span><span class="k2">;</span>
<span class="number"> 43</span>      <span class="k1">else</span>
<span class="number"> 44</span>         RenderMode::PrimarySetTexCoord<span class="k2">(</span> OL_TC_TOPLEFT, renderArea, texCoordArea, w, h <span class="k2">)</span><span class="k2">;</span>
<span class="number"> 45</span>
<span class="number"> 46</span>      glVertex2f<span class="k2">(</span> x1, y1 <span class="k2">)</span><span class="k2">;</span>
<span class="number"> 47</span>   glEnd<span class="k2">(</span><span class="k2">)</span><span class="k2">;</span>
<span class="number"> 48</span>
<span class="number"> 49</span>   mode.Unselect<span class="k2">(</span><span class="k2">)</span><span class="k2">;</span>
<span class="number"> 50</span>
<span class="number"> 51</span>   <span class="k1">if</span><span class="k2">(</span> <span class="k3">!</span>Settings::TextureMappingUsed<span class="k2">(</span><span class="k2">)</span> <span class="k2">)</span>
<span class="number"> 52</span>      glDisable<span class="k2">(</span> GL_TEXTURE_2D <span class="k2">)</span><span class="k2">;</span>
<span class="number"> 53</span><span class="k2">}</span>
</div></div><p>

If the hardware supports it, quads could be a useful addition. If a software fallback routine isn&#39;t hard to do. <img src="http://www.allegro.cc/forums/smileys/undecided.gif" alt=":-/" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Dario ff)</author>
		<pubDate>Wed, 09 Jun 2010 04:39:35 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>It&#39;s not clear to me what that function does, or why you couldn&#39;t do the same thing by splitting the thing up into two triangles (as long as you order your vertices correctly and set the texture coordinates properly), however it seems to me you could just use a textured polygon?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Evert)</author>
		<pubDate>Wed, 09 Jun 2010 04:41:31 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>To me it sounds like you could place your vertices anywhere you like, so you could create a flattened out mobius strip, which is twisted so can&#39;t be rendered by two triangles AFAIK.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Trent Gamblin)</author>
		<pubDate>Wed, 09 Jun 2010 04:43:06 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Here&#39;s what it looks like when I use triangles:</p><p><span class="remote-thumbnail"><span class="json">{"name":"Screenshot-EOF%20Audition-1.png","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/4\/4\/44024acc4a3d7d543c3c9d1231bb858b.png","w":640,"h":480,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/4\/4\/44024acc4a3d7d543c3c9d1231bb858b"}</span><img src="http://www.allegro.cc//djungxnpq2nug.cloudfront.net/image/cache/4/4/44024acc4a3d7d543c3c9d1231bb858b-240.jpg" alt="Screenshot-EOF%20Audition-1.png" width="240" height="180" /></span></p><p>Here&#39;s the original texture:</p><p><span class="remote-thumbnail"><span class="json">{"name":"neck.png","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/b\/c\/bc919f4302dab4e56a4de6097e031646.png","w":512,"h":1024,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/b\/c\/bc919f4302dab4e56a4de6097e031646"}</span><img src="http://www.allegro.cc//djungxnpq2nug.cloudfront.net/image/cache/b/c/bc919f4302dab4e56a4de6097e031646-240.jpg" alt="neck.png" width="240" height="480" /></span>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Todd Cope)</author>
		<pubDate>Wed, 09 Jun 2010 05:09:07 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Dario, missed your post... I think I understand now. It still plays by the rules of regular opengl quads. Basically it can draw trapezoids and other weird shapes but the vertices must be planar... So I think quads would be useful to simplify this stuff, though I&#39;m not convinced it couldn&#39;t be done with triangles.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Trent Gamblin)</author>
		<pubDate>Wed, 09 Jun 2010 05:14:04 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>It can be done with triangles, but as the posted example shows, you can&#39;t do it with just two (four will work: chop off the slanted sides, then split the remaining rectangle in two).<br />I would still say that a textured polygon should work, but that may have the same issue (not sure).
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Evert)</author>
		<pubDate>Wed, 09 Jun 2010 05:18:41 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Using GL_QUADS results in the same output as triangles.</p><div class="source-code"><div class="toolbar"><span class="button numbers"><b>#</b></span><span class="button select">Select</span><span class="button expand">Expand</span></div><div class="inner"><span class="number">  1</span><span class="p">#include &lt;allegro5/allegro5.h&gt;</span>
<span class="number">  2</span><span class="p">#include &lt;allegro5/allegro_image.h&gt;</span>
<span class="number">  3</span><span class="p">#include &lt;allegro5/allegro_opengl.h&gt;</span>
<span class="number">  4</span>
<span class="number">  5</span><span class="k1">int</span> main<span class="k2">(</span><span class="k2">)</span>
<span class="number">  6</span><span class="k2">{</span>
<span class="number">  7</span>   al_init<span class="k2">(</span><span class="k2">)</span><span class="k2">;</span>
<span class="number">  8</span>   
<span class="number">  9</span>   al_set_new_display_flags<span class="k2">(</span>ALLEGRO_OPENGL<span class="k2">)</span><span class="k2">;</span>
<span class="number"> 10</span>   ALLEGRO_DISPLAY<span class="k3">*</span> disp <span class="k3">=</span> al_create_display<span class="k2">(</span><span class="n">800</span>, <span class="n">800</span><span class="k2">)</span><span class="k2">;</span>
<span class="number"> 11</span>   
<span class="number"> 12</span>   ALLEGRO_EVENT_QUEUE<span class="k3">*</span> queue <span class="k3">=</span> al_create_event_queue<span class="k2">(</span><span class="k2">)</span><span class="k2">;</span>
<span class="number"> 13</span>   al_register_event_source<span class="k2">(</span>queue, al_get_display_event_source<span class="k2">(</span>disp<span class="k2">)</span><span class="k2">)</span><span class="k2">;</span>
<span class="number"> 14</span>   
<span class="number"> 15</span>   al_init_image_addon<span class="k2">(</span><span class="k2">)</span><span class="k2">;</span>
<span class="number"> 16</span>   ALLEGRO_BITMAP<span class="k3">*</span> texture <span class="k3">=</span> al_load_bitmap<span class="k2">(</span><span class="s">"grid.png"</span><span class="k2">)</span><span class="k2">;</span>
<span class="number"> 17</span>
<span class="number"> 18</span>   <span class="k1">bool</span> quit <span class="k3">=</span> <span class="k1">false</span><span class="k2">;</span>
<span class="number"> 19</span>   <span class="k1">while</span><span class="k2">(</span><span class="k3">!</span>quit<span class="k2">)</span>
<span class="number"> 20</span>   <span class="k2">{</span>
<span class="number"> 21</span>      ALLEGRO_EVENT event<span class="k2">;</span>
<span class="number"> 22</span>      <span class="k1">if</span><span class="k2">(</span>al_get_next_event<span class="k2">(</span>queue, <span class="k3">&amp;</span>event<span class="k2">)</span><span class="k2">)</span>
<span class="number"> 23</span>      <span class="k2">{</span>
<span class="number"> 24</span>         <span class="k1">if</span><span class="k2">(</span>event.type <span class="k3">=</span><span class="k3">=</span> ALLEGRO_EVENT_DISPLAY_CLOSE<span class="k2">)</span>
<span class="number"> 25</span>            quit <span class="k3">=</span> <span class="k1">true</span><span class="k2">;</span>
<span class="number"> 26</span>      <span class="k2">}</span>
<span class="number"> 27</span>    
<span class="number"> 28</span>    glEnable<span class="k2">(</span>GL_TEXTURE_2D<span class="k2">)</span><span class="k2">;</span>
<span class="number"> 29</span>    glBindTexture<span class="k2">(</span>GL_TEXTURE_2D, al_get_opengl_texture<span class="k2">(</span>texture<span class="k2">)</span><span class="k2">)</span><span class="k2">;</span>
<span class="number"> 30</span>    
<span class="number"> 31</span>    glBegin<span class="k2">(</span>GL_QUADS<span class="k2">)</span><span class="k2">;</span>
<span class="number"> 32</span>    
<span class="number"> 33</span>    glTexCoord2f<span class="k2">(</span><span class="n">0</span>, <span class="n">0</span><span class="k2">)</span><span class="k2">;</span>
<span class="number"> 34</span>    glVertex2f<span class="k2">(</span><span class="n">400</span>, <span class="n">200</span><span class="k2">)</span><span class="k2">;</span>
<span class="number"> 35</span>    
<span class="number"> 36</span>    glTexCoord2f<span class="k2">(</span><span class="n">1</span>, <span class="n">0</span><span class="k2">)</span><span class="k2">;</span>
<span class="number"> 37</span>    glVertex2f<span class="k2">(</span><span class="n">500</span>, <span class="n">200</span><span class="k2">)</span><span class="k2">;</span>
<span class="number"> 38</span>    
<span class="number"> 39</span>    glTexCoord2f<span class="k2">(</span><span class="n">1</span>, <span class="n">1</span><span class="k2">)</span><span class="k2">;</span>
<span class="number"> 40</span>    glVertex2f<span class="k2">(</span><span class="n">800</span>, <span class="n">600</span><span class="k2">)</span><span class="k2">;</span>
<span class="number"> 41</span>    
<span class="number"> 42</span>    glTexCoord2f<span class="k2">(</span><span class="n">0</span>, <span class="n">1</span><span class="k2">)</span><span class="k2">;</span>
<span class="number"> 43</span>    glVertex2f<span class="k2">(</span><span class="n">100</span>, <span class="n">600</span><span class="k2">)</span><span class="k2">;</span>
<span class="number"> 44</span>    
<span class="number"> 45</span>    glEnd<span class="k2">(</span><span class="k2">)</span><span class="k2">;</span>
<span class="number"> 46</span>
<span class="number"> 47</span>      al_flip_display<span class="k2">(</span><span class="k2">)</span><span class="k2">;</span>
<span class="number"> 48</span>      al_rest<span class="k2">(</span><span class="n">0</span>.<span class="n">01</span><span class="k2">)</span><span class="k2">;</span>
<span class="number"> 49</span>   <span class="k2">}</span>
<span class="number"> 50</span>   
<span class="number"> 51</span>   <span class="k1">return</span> <span class="n">0</span><span class="k2">;</span>
<span class="number"> 52</span><span class="k2">}</span>
</div></div><p>

Output:<br /><span class="remote-thumbnail"><span class="json">{"name":"601548","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/2\/4\/24b3b452b84845d7eb51487dcb436b6d.png","w":800,"h":800,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/2\/4\/24b3b452b84845d7eb51487dcb436b6d"}</span><img src="http://www.allegro.cc//djungxnpq2nug.cloudfront.net/image/cache/2/4/24b3b452b84845d7eb51487dcb436b6d-240.jpg" alt="601548" width="240" height="240" /></span>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (SiegeLord)</author>
		<pubDate>Wed, 09 Jun 2010 05:26:38 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I would&#39;ve guessed that since the original function was using QUADs the texture&#39;s mapping would be fixed... but why does the mapping in your example look like it was done with 2 triangles?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Dario ff)</author>
		<pubDate>Wed, 09 Jun 2010 05:32:47 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>The graphics card breaks a quad into two triangles. Everything is done in triangles at the lowest level of the gpu.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Trent Gamblin)</author>
		<pubDate>Wed, 09 Jun 2010 05:34:47 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/604303/869422#target">Dario ff</a> said:</div><div class="quote"><p>
I would&#39;ve guessed that since the original function was using QUADs the texture&#39;s mapping would be fixed... but why does the mapping in your example look like it was done with 2 triangles?
</p></div></div><p>
Because it is done like that internally. GL_QUADS is just a convenience type. Internally, OpenGL tesselates the quad into two triangles. For Todd Cope to get what he wants he needs to either:
</p><ol><li><p>Use perspective (primitives addon in principle supports this in hardware mode)
</p></li><li><p>Approximate the effect using more triangles (e.g. in the way Evert suggested)</p></li></ol><p>Note that without the third dimension you can never get the proper mapping (unless your vertices are arranged in a particular way) because the generic quad to quad mapping is non-affine... and without 3D, only affine mappings can be done. You can get a good approximation by throwing more triangles at it, but it won&#39;t be exact in the general case.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (SiegeLord)</author>
		<pubDate>Wed, 09 Jun 2010 05:37:56 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I see. I&#39;m getting the same here... the only difference is that the image seems to be flipped horizontally.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Dario ff)</author>
		<pubDate>Wed, 09 Jun 2010 05:40:44 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Assuming that the projection matrix is set up as an orthogonal projection, you can get the effect with just 2 triangles and playing with the z coordinate. A bit of trigonometry should give you what z values you need to use.</p><p>Well if the output he expects is what I think (the horizontal lines won&#39;t be equidistant).
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Oscar Giner)</author>
		<pubDate>Wed, 09 Jun 2010 05:44:10 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I thought with an orthographic projection, z value didn&#39;t matter and distant objects appear in line with close objects, i.e., there is no way to tell tell distance of anything.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Trent Gamblin)</author>
		<pubDate>Wed, 09 Jun 2010 06:01:17 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Now I&#39;m starting to not be sure about what OpenGL would output doing that. I would think that the z coordinate would be used to perform the perspective correction and you could get the desired output that way (it&#39;s a bit of a hack/trick actually). But I haven&#39;t used OpenGL in a lot of time and now I&#39;m unsure about that.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Oscar Giner)</author>
		<pubDate>Wed, 09 Jun 2010 06:23:22 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I think you need a perspective projection for that, not an orthographic projection.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Trent Gamblin)</author>
		<pubDate>Wed, 09 Jun 2010 06:25:32 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Can&#39;t we just investigate on OpenLayer&#39;s setup and see how it setups the projections?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Dario ff)</author>
		<pubDate>Wed, 09 Jun 2010 20:11:06 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>The point I was getting at is that OpenLayer does it wrong also, since it uses the GL_QUADS in the same way I did: a single quad on a plane. In that configuration the perspective does not matter, since the quad is parallel to the viewing plane. It&#39;d be nice if someone with OpenLayer could confirm this.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (SiegeLord)</author>
		<pubDate>Wed, 09 Jun 2010 20:34:42 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>AFAIK, OpenLayer sets up an ortographic projection like this:
</p><div class="source-code snippet"><div class="inner"><pre>    glMatrixMode<span class="k2">(</span> GL_PROJECTION <span class="k2">)</span><span class="k2">;</span>
    glPushMatrix<span class="k2">(</span><span class="k2">)</span><span class="k2">;</span>
    glLoadIdentity<span class="k2">(</span><span class="k2">)</span><span class="k2">;</span>
    glOrtho<span class="k2">(</span> <span class="n">0</span>, w, <span class="n">0</span>, h, <span class="k3">-</span><span class="n">1</span>, <span class="n">1000</span> <span class="k2">)</span><span class="k2">;</span>
    glScalef<span class="k2">(</span> <span class="n">1</span>, <span class="k3">-</span><span class="n">1</span>, <span class="n">1</span> <span class="k2">)</span><span class="k2">;</span>
    glTranslatef<span class="k2">(</span> <span class="n">0</span>, <span class="k3">-</span>h, <span class="n">0</span> <span class="k2">)</span><span class="k2">;</span>

    glMatrixMode<span class="k2">(</span> GL_MODELVIEW <span class="k2">)</span><span class="k2">;</span>
    glLoadIdentity<span class="k2">(</span><span class="k2">)</span><span class="k2">;</span>
    glDisable<span class="k2">(</span> GL_DEPTH_TEST <span class="k2">)</span><span class="k2">;</span>
</pre></div></div><p>
There must be something else though, but I&#39;m looking for any clues. If you want, I&#39;ll attach OpenLayer&#39;s source here.</p><p>EDIT: Ok, here it is. I took away the demos, but I just 7-zipped the old package I had. <b><a href="http://www.allegro.cc/files/attachment/601558">Download</a></b>.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Dario ff)</author>
		<pubDate>Wed, 09 Jun 2010 20:37:59 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>As far as I can see, the correct mapping would have to be in 3d with the bottom vertices near the camera, and the top vertices in the distance, but the vertices are actually a square in 3 space.  Using an orthgraphic projection would show this as a square every time.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Arthur Kalliokoski)</author>
		<pubDate>Wed, 09 Jun 2010 21:54:56 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>OpenLayer&#39;s alternative BlitDistorted function actually uses a <span class="source-code">GL_TRIANGLE_FAN</span>. <img src="http://www.allegro.cc/forums/smileys/undecided.gif" alt=":-/" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Dario ff)</author>
		<pubDate>Wed, 09 Jun 2010 22:16:44 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Well, do you have a screenshot how it looks in OpenLayer?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Elias)</author>
		<pubDate>Wed, 09 Jun 2010 22:21:46 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>How curious, after months of not using it, it doesn&#39;t seem to be able to do this as well.<br /><span class="remote-thumbnail"><span class="json">{"name":"601562","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/5\/2\/52818de022201e6db00ac0c433f54981.jpg","w":795,"h":602,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/5\/2\/52818de022201e6db00ac0c433f54981"}</span><img src="http://www.allegro.cc//djungxnpq2nug.cloudfront.net/image/cache/5/2/52818de022201e6db00ac0c433f54981-240.jpg" alt="601562" width="240" height="181" /></span><br />I remember it working perfectly. <img src="http://www.allegro.cc/forums/smileys/huh.gif" alt="???" /> Maybe this case is hard to do?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Dario ff)</author>
		<pubDate>Wed, 09 Jun 2010 22:34:44 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Ok, so we don&#39;t want a function that &quot;works like OpenLayer&#39;s Bitmap::BlitDistorted&quot; but a new function nobody has ever done yet...? <img src="http://www.allegro.cc/forums/smileys/tongue.gif" alt=":P" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Elias)</author>
		<pubDate>Wed, 09 Jun 2010 23:18:50 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Seems like too much of a hassle to me. I thought it would be something simple but from the looks of it this is something that is best left to being done in 3D. I retract my request.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Todd Cope)</author>
		<pubDate>Thu, 10 Jun 2010 03:10:35 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Googling a bit I found this paper from 2004. It sounds like a method to do what you want: <a href="http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.62.7170&amp;rep=rep1&amp;type=pdf">http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.62.7170&amp;rep=rep1&amp;type=pdf</a></p><p>It requires a hardware implementation though and doesn&#39;t seem like any hardware supports it, they all just use triangles. OpenGL ES 1 and 2 as well as normal OpenGL 3 and 4 even removed the GL_QUAD primitives completely. So yes, your best bet is to just use one of the methods suggested in this thread to achieve it, in your own code.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Elias)</author>
		<pubDate>Thu, 10 Jun 2010 16:24:32 +0000</pubDate>
	</item>
</rss>
