<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
	<channel>
		<title><![CDATA[Maratis forum - Set object position to mouse x and y position]]></title>
		<link>http://forum.maratis3d.com/viewtopic.php?id=1224</link>
		<description><![CDATA[The most recent posts in Set object position to mouse x and y position.]]></description>
		<lastBuildDate>Mon, 02 Jan 2017 02:45:12 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Set object position to mouse x and y position]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=7849#p7849</link>
			<description><![CDATA[<p>I actually figured it out:</p><div class="codebox"><pre><code>Camera =getObject(&quot;Camera0&quot;)
player = getObject(&quot;Entity0&quot;) 



function onSceneUpdate()
colorr=math.random(0, 2)
colorg=math.random(0, 2)
colorb=math.random(0, 2)




mx = getAxis(&quot;MOUSE_X&quot;)
my = getAxis(&quot;MOUSE_Y&quot;) 
mz = 0.0   

cursor3d = getUnProjectedPoint(Camera, vec3(mx, my, mz))
print(cursor3d[1], cursor3d[2], cursor3d[3])
setPosition(player, {cursor3d[1], cursor3d[2], mz})






Camera = getCurrentCamera()
enableCameraOrtho(Camera, true)
setCameraClearColor(Camera, {colorr, colorg, colorb})




end</code></pre></div><p>this will set player cords to mouse.</p>]]></description>
			<author><![CDATA[dummy@example.com (blend)]]></author>
			<pubDate>Mon, 02 Jan 2017 02:45:12 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=7849#p7849</guid>
		</item>
		<item>
			<title><![CDATA[Set object position to mouse x and y position]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=7848#p7848</link>
			<description><![CDATA[<p>so heres my simple code:</p><div class="codebox"><pre><code>Camera =getObject(&quot;Camera0&quot;)
player = getObject(&quot;Entity0&quot;) 



function onSceneUpdate()
colorr=math.random(0, 2)
colorg=math.random(0, 2)
colorb=math.random(0, 2)




getX = getAxis(&quot;MOUSE_X&quot;)
getY = getAxis(&quot;MOUSE_Y&quot;)

var1 = updateMatrix(getX)
print (var1)



Camera = getCurrentCamera()
setCameraClearColor(Camera, {colorr, colorg, colorb})




end</code></pre></div><p>i&#039;m trying to set the position of player to mouse position but when i use &quot;getAxis(&quot;MOUSE_X&quot;) it throws out a strange float, what can i do with this data?</p>]]></description>
			<author><![CDATA[dummy@example.com (blend)]]></author>
			<pubDate>Mon, 02 Jan 2017 01:01:08 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=7848#p7848</guid>
		</item>
	</channel>
</rss>
