<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Maratis forum - Set object position to mouse x and y position]]></title>
	<link rel="self" href="http://forum.maratis3d.com/extern.php?action=feed&amp;tid=1224&amp;type=atom"/>
	<updated>2017-01-02T02:45:12Z</updated>
	<generator>PunBB</generator>
	<id>http://forum.maratis3d.com/viewtopic.php?id=1224</id>
		<entry>
			<title type="html"><![CDATA[Re: Set object position to mouse x and y position]]></title>
			<link rel="alternate" href="http://forum.maratis3d.com/viewtopic.php?pid=7849#p7849"/>
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[blend]]></name>
				<uri>http://forum.maratis3d.com/profile.php?id=1343</uri>
			</author>
			<updated>2017-01-02T02:45:12Z</updated>
			<id>http://forum.maratis3d.com/viewtopic.php?pid=7849#p7849</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Set object position to mouse x and y position]]></title>
			<link rel="alternate" href="http://forum.maratis3d.com/viewtopic.php?pid=7848#p7848"/>
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[blend]]></name>
				<uri>http://forum.maratis3d.com/profile.php?id=1343</uri>
			</author>
			<updated>2017-01-02T01:01:08Z</updated>
			<id>http://forum.maratis3d.com/viewtopic.php?pid=7848#p7848</id>
		</entry>
</feed>
