<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
	<channel>
		<title><![CDATA[Maratis forum - Mouse and cursor key movement]]></title>
		<link>http://forum.maratis3d.com/viewtopic.php?id=622</link>
		<description><![CDATA[The most recent posts in Mouse and cursor key movement.]]></description>
		<lastBuildDate>Mon, 25 Mar 2013 04:28:08 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Mouse and cursor key movement]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=3889#p3889</link>
			<description><![CDATA[<p>Ok thanks that has it, as it turned out that all parenting was totally correct ( given I &#039;d followed tut precisely), but somehow I had missed that the camera must be centered in head or it throws off the balance act <img src="http://forum.maratis3d.com/img/smilies/wink.png" width="15" height="15" alt="wink" /> &gt; Being new to this, it&#039;s a tad tricky following all the necessary positioning , but it does make sense after seeing it in action that the scripting values would indeed throw things way off if initial values aren&#039;t correct.</p><p>I think expecting someone to know such values is a bit outside the knowledge base of most people. I can put this in as a &#039;feature request&#039;,but before I do, I shall mention it here:</p><p>I think to avoid having to load a given mproj ( sponza in this case), it would be far easier (i&#039;d code it myself if I could) to have PRESET&#039;s that would make life much easier. Having to enter rotation values for objects is a mind numbing thing ( glad I know about it though) when we are talking about something so basic as movement in a game, and that when those values are wrong, it causes a great deal of mayhem.</p><p>I honestly don&#039;t even recall the TUT I watched for maratis, saying anything about needing to &#039;set&#039; those values to things to work correctly. </p><p>thx <img src="http://forum.maratis3d.com/img/smilies/wink.png" width="15" height="15" alt="wink" />)<br />Gm</p>]]></description>
			<author><![CDATA[dummy@example.com (VeganDev)]]></author>
			<pubDate>Mon, 25 Mar 2013 04:28:08 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=3889#p3889</guid>
		</item>
		<item>
			<title><![CDATA[Re: Mouse and cursor key movement]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=3888#p3888</link>
			<description><![CDATA[<p>Hi,<br />yes indeed the script is the same,<br />so the problem is probably from the level itself,<br />check that the rotations coordinates are the same than in sponza :</p><p>- Player : 0 0 -90<br />- Head : 0 0 0</p><p>Head parent is Player<br />Camera parent is Head</p><p>Also check that the scale of Player and Head are uniform (meaning the same scale for x, y and z)<br />a non-uniform scale on a 3d object can deform it&#039;s children&#039;s coordinates.</p>]]></description>
			<author><![CDATA[dummy@example.com (anael)]]></author>
			<pubDate>Mon, 25 Mar 2013 03:45:28 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=3888#p3888</guid>
		</item>
		<item>
			<title><![CDATA[Re: Mouse and cursor key movement]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=3884#p3884</link>
			<description><![CDATA[<p>It does not have this odd behavior in Sponza,which is odd because Im following the exact same behavior , given im using the script from sponza and simply loaded the box mesh and duplicated it as shown in one of the tuts for maratis online.</p><p>I then created the values as given in sponza and it works fine except for these few things..Ive double checked and I simply can&#039;t find what I&#039;ve got incorrect here, but yes I&#039;d be happy to post script Im using .</p><p>My script which is exact duplicate of sponza script:</p><p>-----------------------------------------------------------------------------------<br />-- Maratis<br />-- Jules script test<br />-----------------------------------------------------------------------------------</p><p>-- get objects<br />Player = getObject(&quot;Player&quot;)<br />Head = getObject(&quot;Head&quot;)</p><p>dx = 0.0<br />dy = 0.0</p><p>centerCursor()<br />mx = getAxis(&quot;MOUSE_X&quot;)<br />my = getAxis(&quot;MOUSE_Y&quot;)</p><p>-- scene update<br />function onSceneUpdate()</p><p>&nbsp; &nbsp; -- rotate Player (X mouse)<br />&nbsp; &nbsp; rotate(Player, {0, 0, -1}, dx*100)<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; -- rotate Head (Y mouse)<br />&nbsp; &nbsp; rotate(Head, {-1, 0, 0}, dy*100, &quot;local&quot;)&nbsp; &nbsp; <br />&nbsp; &nbsp; rotation = getRotation(Head)<br />&nbsp; &nbsp; if rotation[1] &gt; 90 then<br />&nbsp; &nbsp; &nbsp; &nbsp; rotation[1] = 90<br />&nbsp; &nbsp; elseif rotation[1] &lt; -90 then<br />&nbsp; &nbsp; &nbsp; &nbsp; rotation[1] = -90<br />&nbsp; &nbsp; end</p><p>&nbsp; &nbsp; setRotation(Head, rotation)<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; -- move<br />&nbsp; &nbsp; if isKeyPressed(&quot;UP&quot;) then<br />&nbsp; &nbsp; &nbsp; &nbsp; addCentralForce(Player, {0, 3, 0}, &quot;local&quot;)<br />&nbsp; &nbsp; end<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; if isKeyPressed(&quot;DOWN&quot;) then<br />&nbsp; &nbsp; &nbsp; &nbsp; addCentralForce(Player, {0, -3, 0}, &quot;local&quot;)<br />&nbsp; &nbsp; end<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; if isKeyPressed(&quot;LEFT&quot;) then<br />&nbsp; &nbsp; &nbsp; &nbsp; addCentralForce(Player, {-3, 0, 0}, &quot;local&quot;)<br />&nbsp; &nbsp; end</p><p>&nbsp; &nbsp; if isKeyPressed(&quot;RIGHT&quot;) then<br />&nbsp; &nbsp; &nbsp; &nbsp; addCentralForce(Player, {3, 0, 0}, &quot;local&quot;)<br />&nbsp; &nbsp; end&nbsp; &nbsp; <br />&nbsp; &nbsp; <br />&nbsp; &nbsp; -- get mouse direction<br />&nbsp; &nbsp; dx = getAxis(&quot;MOUSE_X&quot;) - mx<br />&nbsp; &nbsp; dy = getAxis(&quot;MOUSE_Y&quot;) - my</p><p>&nbsp; &nbsp; -- center cursor<br />&nbsp; &nbsp; centerCursor()<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; mx = getAxis(&quot;MOUSE_X&quot;)<br />&nbsp; &nbsp; my = getAxis(&quot;MOUSE_Y&quot;)&nbsp; &nbsp; <br />&nbsp; &nbsp; <br />end</p><br /><p>My box.mesh ( brought in direct from sponza DIR) has properties in editor, which match their sponza values, as does head and camera, so I&#039;m lost as to what I&#039;m doing wrong here . My parenting is also precisely matching sponza example as are all other value, afaict.</p><p>I realize I could just use sponza mproj and del building and load my mesh instead, but I&#039;d rather know why what I&#039;m doing isn&#039;t having intended effect so I can learn Maratis effectively.</p><p>thx<br />Gm</p>]]></description>
			<author><![CDATA[dummy@example.com (VeganDev)]]></author>
			<pubDate>Sun, 24 Mar 2013 20:57:04 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=3884#p3884</guid>
		</item>
		<item>
			<title><![CDATA[Re: Mouse and cursor key movement]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=3883#p3883</link>
			<description><![CDATA[<p>Hi,<br />is it also doing that on Sponza example ?<br />the best is if you can show us your script</p>]]></description>
			<author><![CDATA[dummy@example.com (anael)]]></author>
			<pubDate>Sun, 24 Mar 2013 09:02:34 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=3883#p3883</guid>
		</item>
		<item>
			<title><![CDATA[Mouse and cursor key movement]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=3882#p3882</link>
			<description><![CDATA[<p>Hi,</p><p>Im working on a new project here, and while Ive used the Tutorials and Sponza as examples, I&#039;m unable to get the camera to work up and down ( only tracks horizontally), and when I press UP on keyboard it goes left instead, and LEFT goes forward,,,,any idea what I&#039;ve got set wrong atm ?</p><p>When I move the mouse to rotate view in game, it rotates left/right as it should, but when I try moving mouse UP/down, the view TILTS left/right.</p><p>thx<br />Gm</p>]]></description>
			<author><![CDATA[dummy@example.com (VeganDev)]]></author>
			<pubDate>Sun, 24 Mar 2013 05:01:31 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=3882#p3882</guid>
		</item>
	</channel>
</rss>
