<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Maratis forum - Drawing in Orthographic mode]]></title>
	<link rel="self" href="http://forum.maratis3d.com/extern.php?action=feed&amp;tid=436&amp;type=atom"/>
	<updated>2012-09-10T15:00:43Z</updated>
	<generator>PunBB</generator>
	<id>http://forum.maratis3d.com/viewtopic.php?id=436</id>
		<entry>
			<title type="html"><![CDATA[Re: Drawing in Orthographic mode]]></title>
			<link rel="alternate" href="http://forum.maratis3d.com/viewtopic.php?pid=2563#p2563"/>
			<content type="html"><![CDATA[<p>I had a quick look at MOText, I just used the atlas system because I knew I could get it working quickly. I think I might get it to fallback on MOText, if I have time, I don&#039;t know.</p><p>There&#039;s a lot of GUI-ish things that still need to be done, like animations... but for now I think, with the exception of keyboard and mouse input, I&#039;m almost done with GUI features.</p>]]></content>
			<author>
				<name><![CDATA[Nistur]]></name>
				<uri>http://forum.maratis3d.com/profile.php?id=500</uri>
			</author>
			<updated>2012-09-10T15:00:43Z</updated>
			<id>http://forum.maratis3d.com/viewtopic.php?pid=2563#p2563</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Drawing in Orthographic mode]]></title>
			<link rel="alternate" href="http://forum.maratis3d.com/viewtopic.php?pid=2561#p2561"/>
			<content type="html"><![CDATA[<p>Very nice <img src="http://forum.maratis3d.com/img/smilies/smile.png" width="15" height="15" alt="smile" /></p><p>For the text you can also use MOText manually I think, but there might be a little trick for drawing it if it&#039;s not in a scene (not sure).</p>]]></content>
			<author>
				<name><![CDATA[anael]]></name>
				<uri>http://forum.maratis3d.com/profile.php?id=2</uri>
			</author>
			<updated>2012-09-10T14:46:01Z</updated>
			<id>http://forum.maratis3d.com/viewtopic.php?pid=2561#p2561</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Drawing in Orthographic mode]]></title>
			<link rel="alternate" href="http://forum.maratis3d.com/viewtopic.php?pid=2560#p2560"/>
			<content type="html"><![CDATA[<p>I will probably end up using it for that too, yep <img src="http://forum.maratis3d.com/img/smilies/smile.png" width="15" height="15" alt="smile" /> To begin with (because the design is far simpler than complex game GUI) it&#039;s for the tools stuff I&#039;m doing, but I am trying to write it in a way that&#039;s easy to reuse for ingame stuff.</p><p>All of the layout and logic is actually a collection of lua classes, there&#039;s very little actually implemented in C++ right now (the atlasing system and RendererDrawQuad is really all it is)</p><p>Over lunch, I reused the atlas system to do bitmap font rendering using the same setup. I should be able to do any dialogue box with 2 draw calls with no optimisations, if it ends up being slow (really shouldn&#039;t) then I could probably make it ~2 draw calls for the whole GUI.</p>]]></content>
			<author>
				<name><![CDATA[Nistur]]></name>
				<uri>http://forum.maratis3d.com/profile.php?id=500</uri>
			</author>
			<updated>2012-09-10T14:40:39Z</updated>
			<id>http://forum.maratis3d.com/viewtopic.php?pid=2560#p2560</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Drawing in Orthographic mode]]></title>
			<link rel="alternate" href="http://forum.maratis3d.com/viewtopic.php?pid=2559#p2559"/>
			<content type="html"><![CDATA[<p>Looks nice <img src="http://forum.maratis3d.com/img/smilies/smile.png" width="15" height="15" alt="smile" /><br />Are you doing an in-game GUI system ?</p>]]></content>
			<author>
				<name><![CDATA[anael]]></name>
				<uri>http://forum.maratis3d.com/profile.php?id=2</uri>
			</author>
			<updated>2012-09-10T14:32:24Z</updated>
			<id>http://forum.maratis3d.com/viewtopic.php?pid=2559#p2559</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Drawing in Orthographic mode]]></title>
			<link rel="alternate" href="http://forum.maratis3d.com/viewtopic.php?pid=2554#p2554"/>
			<content type="html"><![CDATA[<p>It worked great. I had a little problem with my atlas implementation to get it to display properly, but tadaa! Now I can go on and make more GUI stuff <img src="http://forum.maratis3d.com/img/smilies/smile.png" width="15" height="15" alt="smile" /><br /><span class="postimg"><img src="http://img41.imageshack.us/img41/6936/boxgx.png" alt="http://img41.imageshack.us/img41/6936/boxgx.png" /></span></p><p><em>Yes, I know that the top left image is 1px larger than the rest, I will sort that</em></p>]]></content>
			<author>
				<name><![CDATA[Nistur]]></name>
				<uri>http://forum.maratis3d.com/profile.php?id=500</uri>
			</author>
			<updated>2012-09-10T12:30:22Z</updated>
			<id>http://forum.maratis3d.com/viewtopic.php?pid=2554#p2554</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Drawing in Orthographic mode]]></title>
			<link rel="alternate" href="http://forum.maratis3d.com/viewtopic.php?pid=2529#p2529"/>
			<content type="html"><![CDATA[<p>Thank you, that worked great. Here&#039;s the beginning of a &quot;dialogue box&quot;, this one is particularly smiley. And the stretching in this case is on purpose. Now to hunt for textures</p><p><span class="postimg"><img src="http://img96.imageshack.us/img96/5779/smilekg.png" alt="http://img96.imageshack.us/img96/5779/smilekg.png" /></span></p>]]></content>
			<author>
				<name><![CDATA[Nistur]]></name>
				<uri>http://forum.maratis3d.com/profile.php?id=500</uri>
			</author>
			<updated>2012-09-07T07:49:49Z</updated>
			<id>http://forum.maratis3d.com/viewtopic.php?pid=2529#p2529</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Drawing in Orthographic mode]]></title>
			<link rel="alternate" href="http://forum.maratis3d.com/viewtopic.php?pid=2525#p2525"/>
			<content type="html"><![CDATA[<p>If you want to draw 2d, you might also need to disable depth-test and face-culling.</p>]]></content>
			<author>
				<name><![CDATA[anael]]></name>
				<uri>http://forum.maratis3d.com/profile.php?id=2</uri>
			</author>
			<updated>2012-09-06T13:19:15Z</updated>
			<id>http://forum.maratis3d.com/viewtopic.php?pid=2525#p2525</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Drawing in Orthographic mode]]></title>
			<link rel="alternate" href="http://forum.maratis3d.com/viewtopic.php?pid=2524#p2524"/>
			<content type="html"><![CDATA[<p>((sorry for the delay, I had to wait until my lunch break to actually test it))</p><p>No, it&#039;s actually rendering nothing at all now <img src="http://forum.maratis3d.com/img/smilies/smile.png" width="15" height="15" alt="smile" /> But I&#039;m quite happy to say that it&#039;s probably some of the crazy things I&#039;d tried to get the thing displaying properly before that I haven&#039;t un-done yet. I will fiddle more tonight <img src="http://forum.maratis3d.com/img/smilies/smile.png" width="15" height="15" alt="smile" /></p>]]></content>
			<author>
				<name><![CDATA[Nistur]]></name>
				<uri>http://forum.maratis3d.com/profile.php?id=500</uri>
			</author>
			<updated>2012-09-06T12:45:11Z</updated>
			<id>http://forum.maratis3d.com/viewtopic.php?pid=2524#p2524</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Drawing in Orthographic mode]]></title>
			<link rel="alternate" href="http://forum.maratis3d.com/viewtopic.php?pid=2521#p2521"/>
			<content type="html"><![CDATA[<p>It&#039;s working ?</p>]]></content>
			<author>
				<name><![CDATA[anael]]></name>
				<uri>http://forum.maratis3d.com/profile.php?id=2</uri>
			</author>
			<updated>2012-09-06T08:38:42Z</updated>
			<id>http://forum.maratis3d.com/viewtopic.php?pid=2521#p2521</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Drawing in Orthographic mode]]></title>
			<link rel="alternate" href="http://forum.maratis3d.com/viewtopic.php?pid=2520#p2520"/>
			<content type="html"><![CDATA[<p>... I&#039;m sorry... clearly my mind wasn&#039;t working well this morning.</p><p>Thanks <img src="http://forum.maratis3d.com/img/smilies/smile.png" width="15" height="15" alt="smile" /></p>]]></content>
			<author>
				<name><![CDATA[Nistur]]></name>
				<uri>http://forum.maratis3d.com/profile.php?id=500</uri>
			</author>
			<updated>2012-09-06T08:32:14Z</updated>
			<id>http://forum.maratis3d.com/viewtopic.php?pid=2520#p2520</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Drawing in Orthographic mode]]></title>
			<link rel="alternate" href="http://forum.maratis3d.com/viewtopic.php?pid=2519#p2519"/>
			<content type="html"><![CDATA[<p>Hi,</p><p>you have to set the viewport and the matrix, like with openGL :</p><div class="codebox"><pre><code>void set2dMode(unsigned int width, unsigned int height)
{
    MRenderingContext * render = MEngine::getInstance()-&gt;getRenderingContext();
    render-&gt;setViewport(0, 0, width, height);
    
    // set ortho projection
    render-&gt;setMatrixMode(M_MATRIX_PROJECTION);
    render-&gt;loadIdentity();
    
    render-&gt;setOrthoView(0.0f, (float)width, (float)height, 0.0f, 1.0f, -1.0f);
    
    render-&gt;setMatrixMode(M_MATRIX_MODELVIEW);
    render-&gt;loadIdentity();
}</code></pre></div><p>(used in the post process example : <a href="http://www.maratis3d.com/code/post-process/MyGame.cpp">http://www.maratis3d.com/code/post-process/MyGame.cpp</a>)</p>]]></content>
			<author>
				<name><![CDATA[anael]]></name>
				<uri>http://forum.maratis3d.com/profile.php?id=2</uri>
			</author>
			<updated>2012-09-06T08:24:53Z</updated>
			<id>http://forum.maratis3d.com/viewtopic.php?pid=2519#p2519</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Drawing in Orthographic mode]]></title>
			<link rel="alternate" href="http://forum.maratis3d.com/viewtopic.php?pid=2517#p2517"/>
			<content type="html"><![CDATA[<p>I&#039;m trying to do some orthographic drawing and everything&#039;s looking squashed and in the wrong place. I have no idea what I&#039;ve managed to set up incorrectly.</p><p>Oh, and another thing is that for some reason the setup that I assumed would be right, gave {0,0} at the bottom left (huh?)</p><div class="quotebox"><blockquote><p>unsigned int w, h;<br />system-&gt;getScreenSize(&amp;w, &amp;h);<br />render-&gt;setOrthoView(0, w, h, 0, 0.1, 1);</p><p>render-&gt;enableVertexArray();<br />render-&gt;enableTexCoordArray();<br />//...</p></blockquote></div><p>I did also have render-&gt;setViewport(0,0, w, h); in there to test, but it did nothing.<br />The vertices I&#039;m trying to draw are two quads from {0,0} to {200,200} and {100,100} to {300,300}.</p><p><span class="postimg"><img src="http://img26.imageshack.us/img26/3357/squashed.png" alt="http://img26.imageshack.us/img26/3357/squashed.png" /></span></p><p>Any ideas?</p>]]></content>
			<author>
				<name><![CDATA[Nistur]]></name>
				<uri>http://forum.maratis3d.com/profile.php?id=500</uri>
			</author>
			<updated>2012-09-06T07:14:33Z</updated>
			<id>http://forum.maratis3d.com/viewtopic.php?pid=2517#p2517</id>
		</entry>
</feed>
