<?xml version="1.0" encoding="UTF-8"?>

<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">

  <channel>

  
  <title>Qt DevNet forums: Game Development 1357647683**  </title>
  <link>http://qt-project.org/forums/viewforum/17/</link>
  <description>RSS feed for latest posts in Game Development</description>
  <copyright>Copyright 2013 Qt Project</copyright>
  <docs>http://www.rssboard.org/rss-specification</docs>
  <generator>ExpressionEngine v2.3.1 http://expressionengine.com/</generator>
  <lastBuildDate>Tue, 08 Jan 2013 14:21:23 GMT</lastBuildDate>
  <atom:link href="http://qt-project.org/feeds/all_forums/17" rel="self" type="application/rss+xml" />
  
  
  
        <item>
            <title>app.setOverrideCursor() takes too much cpu</title>
            <link>http://qt-project.org/forums/viewreply/125904</link>
            <author>ritschratsch</author>
            <description><![CDATA[Hi Sgaist,
the problem is that I can manage the cursor with Irrlicht only in the Irrlichtwidget. As soon as I move the mouse out of the widget (over the interface), the cursor changes to its normal design. But maybe I could try to manage the cursor with Irrlicht as you said and tell QT to set the cursor to the same image as Irrlicht does, maybe this could work :)

	I&#8217;ll post as soon as I have time to try it.

	Thanks for your help and have a nice day.

	Ritschratsch]]></description>
            <guid isPermaLink="false">03083e1abc017dd996f1b33d3dabc2a5</guid>
            <pubDate>Sat, 18 May 2013 13:01:53 GMT</pubDate>
        </item>
  
        <item>
            <title>Using qt widgets as texture in 3D</title>
            <link>http://qt-project.org/forums/viewthread/27903</link>
            <author>belab</author>
            <description><![CDATA[Inspired by the wolfenqt demo with the browser walls I wanted to embed widgets into a game with min. effort using qt for the game ui to prevent from writing an own ui framework and getting all the comfort of qt. Here are my essentials so far:
	
		design ui (of course with qtdesigner)
		create 3d geometries for in game ui, planes, spheres, whatever&#8230;
		render widgets to geometry textures
		pass input events (mouse, key) to 3d widgets and ray picking using mapped texture coords
Code:
&amp;nbsp; &amp;nbsp; widget = new Form&#40;0, this&#41;; // ui from designer
&amp;nbsp; &amp;nbsp; this&#45;&amp;gt;setMouseTracking&#40;true&#41;;
&amp;nbsp; &amp;nbsp; scene = new QGraphicsScene;
&amp;nbsp; &amp;nbsp; scene&#45;&amp;gt;addWidget&#40;widget&#41;;
&amp;nbsp; &amp;nbsp; // connect to ui updates
&amp;nbsp; &amp;nbsp; connect&#40; scene, SIGNAL&#40;changed&#40;const QList&amp;lt;QRectF&amp;gt;&amp;amp;&#41;&#41;, this, SLOT&#40; updateTexture&#40;const QList&amp;lt;QRectF&amp;gt;&amp;amp;&#41;&#41; &#41;;
.
.
void GlWidget::updateTexture&#40; const QList&amp;lt;QRectF&amp;gt;&amp;amp; &#41;
&#123;
&amp;nbsp; &amp;nbsp; QPainter painter&#40; &amp;amp;&#40;cube.pixmap&#41; &#41;;
&amp;nbsp; &amp;nbsp; scene&#45;&amp;gt;render&#40; &amp;amp;painter &#41;; // render ui updates to texture
&amp;nbsp; &amp;nbsp; cube.texture = bindTexture&#40;cube.pixmap&#41;;
&amp;nbsp; &amp;nbsp; updateGL&#40;&#41;;
&#125;
void GlWidget::mouseMoveEvent&#40;QMouseEvent *event&#41;
&#123;
&amp;nbsp; &amp;nbsp; QVector3D rayOrg;
&amp;nbsp; &amp;nbsp; QVector3D rayDir;
&amp;nbsp; &amp;nbsp; getMousePickRay&#40;event&#45;&amp;gt;localPos&#40;&#41;, rayOrg, rayDir&#41;;
&amp;nbsp; &amp;nbsp; QVector2D texCoords;
&amp;nbsp; &amp;nbsp; if&#40; cube.intersect&#40;rayOrg, rayDir, texCoords&#41;&#41;
&amp;nbsp; &amp;nbsp; &#123;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; QPointF scenePos&#40;texCoords.x&#40;&#41;*widget&#45;&amp;gt;width&#40;&#41;, texCoords.y&#40;&#41;*widget&#45;&amp;gt;height&#40;&#41;&#41;;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; QGraphicsSceneMouseEvent mouseEvent&#40;QEvent::GraphicsSceneMouseMove&#41;;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; mouseEvent.setWidget&#40;this&#41;;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; mouseEvent.setScenePos&#40;scenePos&#41;;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; mouseEvent.setLastScenePos&#40;scenePos&#41;;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; mouseEvent.setAccepted&#40;false&#41;;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; QApplication::sendEvent&#40; scene, &amp;amp;mouseEvent &#41;;
&amp;nbsp; &amp;nbsp; &#125;
.
.
.

I wrote a small demo on top of the simple qt opengl texture mapping example with putting it all together while keeping it small.
https://github.com/belab/widgetTo3dTexture]]></description>
            <guid isPermaLink="false">cedda615af862623b3bc879e6f284162</guid>
            <pubDate>Fri, 17 May 2013 23:12:07 GMT</pubDate>
        </item>
  
        <item>
            <title>app.setOverrideCursor() takes too much cpu</title>
            <link>http://qt-project.org/forums/viewthread/27899</link>
            <author>ritschratsch</author>
            <description><![CDATA[Hiho, everybody again :)

	I&#8217;m programming a strategy game with the Irrlicht 3D Engine, and use QT for the interface.
For showing the player if he would select a unit by left click, the cursor changes as soon as it is over a unit.
It works very well if I just move the cursor over one unit.
But if I have a bunch of units in a row and move the camera eg. from the left to the right and pass all these units, the camera movement slows down a little bit because the cursor has to change very often.

	I declared the cursors as follows:

	QCursor * blue = new QCursor&#40;*&#40;new QPixmap&#40;&amp;quot;../media/interface/cursor_blue.gif&amp;quot;&#41;&#41;&#41;;
QCursor * green = new QCursor&#40;*&#40;new QPixmap&#40;&amp;quot;../media/interface/cursor_green.gif&amp;quot;&#41;&#41;&#41;;
QCursor * yellow = new QCursor&#40;*&#40;new QPixmap&#40;&amp;quot;../media/interface/cursor_yellow.gif&amp;quot;&#41;&#41;&#41;;


	and change it with:
app.setOverrideCursor&#40;*blue&#41;;


	or yellow or green.

	As I can see its only a pointer and the images should already have been loaded so why does the game slows down?
Is there a better way to acchieve what I want?

	Thanks in advance and best regards

	Ritschratsch]]></description>
            <guid isPermaLink="false">a52bf984e333f5b0c82a352cc5f0c004</guid>
            <pubDate>Fri, 17 May 2013 18:03:44 GMT</pubDate>
        </item>
  
        <item>
            <title>Opengl textures with glDrawElements</title>
            <link>http://qt-project.org/forums/viewreply/125534</link>
            <author>Skyrpex</author>
            <description><![CDATA[You can use glDrawElements for each face]]></description>
            <guid isPermaLink="false">16520f7a5a27aa6ef54a54a4cc53bebd</guid>
            <pubDate>Wed, 15 May 2013 22:57:09 GMT</pubDate>
        </item>
  
        <item>
            <title>Qt3D Animations?</title>
            <link>http://qt-project.org/forums/viewreply/123520</link>
            <author>john_god</author>
            <description><![CDATA[@ JanDal: thanks for thoose links, nice material.]]></description>
            <guid isPermaLink="false">2691e3635d388248bde1b9f3eeafc445</guid>
            <pubDate>Mon, 29 Apr 2013 14:27:38 GMT</pubDate>
        </item>
  
        <item>
            <title>Best way to create multi&#45;textured terrain</title>
            <link>http://qt-project.org/forums/viewreply/123065</link>
            <author>eggsmatter</author>
            <description><![CDATA[Right, I was under the mistaken assumption that QMultiMap () would insert over the same key. The opposite is true. The documentation was staring me in the face.]]></description>
            <guid isPermaLink="false">1a0824e52a9e9da138aab4cf6dc1f011</guid>
            <pubDate>Fri, 26 Apr 2013 01:50:19 GMT</pubDate>
        </item>
  
        <item>
            <title>Best way to create multi&#45;textured terrain</title>
            <link>http://qt-project.org/forums/viewthread/26938</link>
            <author>eggsmatter</author>
            <description><![CDATA[Hi,

	I have a heightmap that I&#8217;ve generated and have implemented to render a terrain. So far, I can only apply one texture to it. My question is, what is the best way to assign varying textures and render them? I will want to blend textures as well but that can come later. I just need to learn how to render more than one. Searching online certainly has a lot of examples but many are either outdated or conflicting. Most render in immediate mode without shaders. GLSL is something I&#8217;m trying to comprehend as well. 

	The following code has been adapted from the Qt OpenGL tutorial. [qt&#45;project.org] 

	In glwidget.cpp::initializeGL()
&amp;nbsp; &amp;nbsp; 
&amp;nbsp; &amp;nbsp; glEnable&#40;GL_DEPTH_TEST&#41;;
&amp;nbsp; &amp;nbsp; glEnable&#40;GL_CULL_FACE&#41;;
&amp;nbsp;
&amp;nbsp; &amp;nbsp; const float bgColor&#91;4&#93; = &#123;.7, .8, 1.0, 1.0&#125;;
&amp;nbsp; &amp;nbsp; glClearColor&#40;bgColor&#91;0&#93;, bgColor&#91;1&#93;, bgColor&#91;2&#93;, bgColor&#91;3&#93;&#41;;
&amp;nbsp;
&amp;nbsp; &amp;nbsp; camera = world&#45;&amp;gt;initCamera&#40;&#41;;
&amp;nbsp;
&amp;nbsp; &amp;nbsp; shaderProgram.addShaderFromSourceFile&#40;QGLShader::Vertex, &amp;quot;:/vertexShader.vsh&amp;quot;&#41;;
&amp;nbsp; &amp;nbsp; shaderProgram.addShaderFromSourceFile&#40;QGLShader::Fragment, &amp;quot;:/fragmentShader.fsh&amp;quot;&#41;;
&amp;nbsp;
&amp;nbsp; &amp;nbsp; shaderProgram.link&#40;&#41;;
&amp;nbsp; &amp;nbsp; 
&amp;nbsp; &amp;nbsp; texture0 = bindTexture&#40;QPixmap&#40;&amp;quot;:/textures/grassb512.bmp&amp;quot;&#41;&#41;;


	And the rendering occurs in glwidget.cpp::paintGL()
&amp;nbsp; &amp;nbsp; vMatrix.rotate&#40;180.0f, 0.0f, 0.0f, 1.0f&#41;;
&amp;nbsp; &amp;nbsp; vMatrix.rotate&#40;yRot, 0.0f, 1.0f, 0.0f&#41;;
&amp;nbsp; &amp;nbsp; vMatrix.translate&#40;camera&#41;;
&amp;nbsp;
&amp;nbsp; &amp;nbsp; shaderProgram.bind&#40;&#41;;
&amp;nbsp;
&amp;nbsp; &amp;nbsp; shaderProgram.setUniformValue&#40;&amp;quot;mvpMatrix&amp;quot;, pMatrix * vMatrix * mMatrix&#41;;
&amp;nbsp; &amp;nbsp; shaderProgram.setUniformValue&#40;&amp;quot;texture&amp;quot;, 0&#41;;
&amp;nbsp;
&amp;nbsp; &amp;nbsp; glActiveTexture&#40;GL_TEXTURE0&#41;;
&amp;nbsp; &amp;nbsp; glBindTexture&#40;GL_TEXTURE_2D, texture0&#41;;
&amp;nbsp; &amp;nbsp; glActiveTexture&#40;0&#41;;
&amp;nbsp;
&amp;nbsp; &amp;nbsp; shaderProgram.setAttributeArray&#40;&amp;quot;vertex&amp;quot;, world&#45;&amp;gt;vertices.constData&#40;&#41;&#41;;
&amp;nbsp; &amp;nbsp; shaderProgram.enableAttributeArray&#40;&amp;quot;vertex&amp;quot;&#41;;
&amp;nbsp;
&amp;nbsp; &amp;nbsp; shaderProgram.setAttributeArray&#40;&amp;quot;textureCoordinate&amp;quot;, world&#45;&amp;gt;textures.constData&#40;&#41;&#41;;
&amp;nbsp; &amp;nbsp; shaderProgram.enableAttributeArray&#40;&amp;quot;textureCoordinate&amp;quot;&#41;;
&amp;nbsp;
&amp;nbsp; &amp;nbsp; QString log = shaderProgram.log&#40;&#41;;
&amp;nbsp; &amp;nbsp; if &#40;!log.isEmpty&#40;&#41;&#41; &#123;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; qDebug&#40;&amp;quot;%s&amp;quot;, qPrintable&#40;log&#41;&#41;;
&amp;nbsp; &amp;nbsp; &#125;
&amp;nbsp;
&amp;nbsp; &amp;nbsp; glDrawArrays&#40;GL_TRIANGLES, 0, world&#45;&amp;gt;vertices.size&#40;&#41;&#41;;
&amp;nbsp;
&amp;nbsp; &amp;nbsp; shaderProgram.disableAttributeArray&#40;&amp;quot;vertex&amp;quot;&#41;;
&amp;nbsp; &amp;nbsp; shaderProgram.disableAttributeArray&#40;&amp;quot;textureCoordinate&amp;quot;&#41;;
&amp;nbsp; &amp;nbsp; shaderProgram.release&#40;&#41;;


	As you may be able to tell, I have a class &#8220;world&#8221; which exposes an array of vertices as well as an array of textures to the rendering method (I also have an array of normals etc.) 
It would be nice to bind the textures in the world class but I don&#8217;t see how they&#8217;d be exposed to the rendering method. The only solution that comes to mind is to have the world class generate vertex and texture arrays per texture and then process them in the paintGL method but, what happens when I start adding objects: trees structures people? What happens when I need to blend two textures across mutliple polygons?

	Is there logic I can perform in the shaders? 

	A link to a perinent and up&#45;to&#45;date reference would be great or just some lucid step in the right direction. Thanks! 

	I am developing in:
Qt Creator 2.5.0 
Based on Qt 4.8.2 (64 bit)

	Built on Aug 7 2012 at 11:47:27  
running on Linux Debian Wheezy/experimental. 

	The OpenGL specs are mesa which is a little bit behind the current openGL standards.]]></description>
            <guid isPermaLink="false">9d6f742398b32287fe4ce153f9ba5d3a</guid>
            <pubDate>Fri, 19 Apr 2013 18:38:52 GMT</pubDate>
        </item>
  
        <item>
            <title>If I build a game in Qt for android and iOS can i include objective C toolkits in it like game center?</title>
            <link>http://qt-project.org/forums/viewreply/121403</link>
            <author>feldifux</author>
            <description><![CDATA[Hi,
if you like using QML for your game, you can consider V&#45;Play, a Qt&#45;based game engine we have been working on for the last 1.5 years. It contains platform&#45;specific plugins like Game Center [v&#45;play.net], Flurry or native Facebook SDK accessibe from QML, together with other gaming components for 2D games. We&#8217;ll add a cross&#45;platform solution (supported on all platforms) for leaderboards, achievements, challenges and in&#45;app&#45;purchases til this summer. It&#8217;s free for the desktops, Symbian and MeeGo and also free to try for your iOS or Android test devices and available for download here [v&#45;play.net].

	Cheers, Chris]]></description>
            <guid isPermaLink="false">f6fa21fd2fd6f99302f042e260b5259b</guid>
            <pubDate>Mon, 15 Apr 2013 01:06:55 GMT</pubDate>
        </item>
  
        <item>
            <title>If I build a game in Qt for android and iOS can i include objective C toolkits in it like game center?</title>
            <link>http://qt-project.org/forums/viewthread/26681</link>
            <author>Periphery</author>
            <description><![CDATA[I want to build a game for both android and iOS but I&#8217;m afraid I wont be able to make it fully functional as if I were to just build one in objetive C. So can I use toolkits from android and or iOS in Qt? or can I make it in Qt and add them in later with a different software?]]></description>
            <guid isPermaLink="false">4bfb08faaabd4b2d3f4388a2a676e3a7</guid>
            <pubDate>Sat, 13 Apr 2013 07:56:13 GMT</pubDate>
        </item>
  
        <item>
            <title>qt3d tank example: projection of click position</title>
            <link>http://qt-project.org/forums/viewreply/120816</link>
            <author>AJOM566</author>
            <description><![CDATA[I&#8217;ve found the error.
The camera&#8217;s upVector has not been updated (default: 0,1,0). When the camera&#8217;s direction (eye&#45;center) is not parallel to the plane (as it is in the example), then the initial upVector is no longer orthogonal to the camera direction. For a correct projection, however, it must be. So you have to calculate a new upVector in initializeGL, after having positioned the eye.]]></description>
            <guid isPermaLink="false">9b53a36354083c7ccde452602a51e022</guid>
            <pubDate>Tue, 09 Apr 2013 22:27:13 GMT</pubDate>
        </item>
  

  </channel>
</rss>