<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
	<channel>
		<title><![CDATA[Maratis forum - How to apply a gravitational force to an object?]]></title>
		<link>http://forum.maratis3d.com/viewtopic.php?id=1121</link>
		<description><![CDATA[The most recent posts in How to apply a gravitational force to an object?.]]></description>
		<lastBuildDate>Sun, 26 Apr 2015 17:39:52 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: How to apply a gravitational force to an object?]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=7525#p7525</link>
			<description><![CDATA[<p>1 - name your objects : &quot;earth&quot; and &quot;player&quot;<br />2 - import the script in the scene :<br /><a href="http://wiki.maratis3d.org/index.php?title=Applying_Scripts_to_objects">http://wiki.maratis3d.org/index.php?tit &#133; to_objects</a></p>]]></description>
			<author><![CDATA[dummy@example.com (anael)]]></author>
			<pubDate>Sun, 26 Apr 2015 17:39:52 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=7525#p7525</guid>
		</item>
		<item>
			<title><![CDATA[Re: How to apply a gravitational force to an object?]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=7524#p7524</link>
			<description><![CDATA[<p>Heres the project:&nbsp; <a href="https://drive.google.com/folderview?id=0B1qtn8NBqVuxflV6SWFfWUtjQURfbkFzbVlualBabENUZ0dYMG1OQzlTdFd0bzJIMV9hMmc&amp;usp=sharing">https://drive.google.com/folderview?id= &#133; sp=sharing</a></p>]]></description>
			<author><![CDATA[dummy@example.com (blend)]]></author>
			<pubDate>Sun, 26 Apr 2015 13:04:27 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=7524#p7524</guid>
		</item>
		<item>
			<title><![CDATA[Re: How to apply a gravitational force to an object?]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=7523#p7523</link>
			<description><![CDATA[<p>It still falls off the side of the earth tho? how do i make the gravity flip?</p>]]></description>
			<author><![CDATA[dummy@example.com (blend)]]></author>
			<pubDate>Sun, 26 Apr 2015 12:52:42 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=7523#p7523</guid>
		</item>
		<item>
			<title><![CDATA[Re: How to apply a gravitational force to an object?]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=7522#p7522</link>
			<description><![CDATA[<p>Thanks very much anael. this help me understand vectors better.</p>]]></description>
			<author><![CDATA[dummy@example.com (blend)]]></author>
			<pubDate>Sun, 26 Apr 2015 12:25:25 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=7522#p7522</guid>
		</item>
		<item>
			<title><![CDATA[Re: How to apply a gravitational force to an object?]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=7521#p7521</link>
			<description><![CDATA[<p>but be sure the origin of hearth and player are centered in the mesh</p>]]></description>
			<author><![CDATA[dummy@example.com (anael)]]></author>
			<pubDate>Sun, 26 Apr 2015 12:16:28 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=7521#p7521</guid>
		</item>
		<item>
			<title><![CDATA[Re: How to apply a gravitational force to an object?]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=7520#p7520</link>
			<description><![CDATA[<p>you need a direction vector, in your code it&#039;s all zero.</p><div class="codebox"><pre><code>-- get objects
player = getObject(&quot;player&quot;)
earth = getObject(&quot;earth&quot;)

setGravity({0, 0, 0}) -- set current scene gravity to zero

g = 0.98 -- your new hand made gravity force

-- scene update
function onSceneUpdate()
   
    vec = normalize(getPosition(earth) - getPosition(player)) * g
    addCentralForce(player, vec)
    
end</code></pre></div>]]></description>
			<author><![CDATA[dummy@example.com (anael)]]></author>
			<pubDate>Sun, 26 Apr 2015 12:15:08 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=7520#p7520</guid>
		</item>
		<item>
			<title><![CDATA[Re: How to apply a gravitational force to an object?]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=7519#p7519</link>
			<description><![CDATA[<p>This is what i have but cant get it to work.</p><br /><p>-- get objects<br />player = getObject(&quot;player&quot;)<br />earth= getObject(&quot;earth&quot;)</p><br /><p>-- scene update<br />function onSceneUpdate()</p><p>&nbsp; &nbsp; gravity = {0, 0, 0}<br />&nbsp; &nbsp; setGravity(gravity) -- set current scene gravity<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; addCentralForce(earth, {0, 0, 0}, &quot;local&quot;)<br />&nbsp; &nbsp; end<br />&nbsp; &nbsp; <br />end</p>]]></description>
			<author><![CDATA[dummy@example.com (blend)]]></author>
			<pubDate>Sun, 26 Apr 2015 11:33:40 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=7519#p7519</guid>
		</item>
		<item>
			<title><![CDATA[Re: How to apply a gravitational force to an object?]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=7518#p7518</link>
			<description><![CDATA[<p>well, you can first set the gravity to zero with setGravity :<br /><a href="http://wiki.maratis3d.org/index.php?title=SetGravity">http://wiki.maratis3d.org/index.php?title=SetGravity</a></p><p>and then at each frame add a central force with a vector going from the object to the center of the sphere.<br />with addCentralForce : <a href="http://wiki.maratis3d.org/index.php?title=AddCentralForce">http://wiki.maratis3d.org/index.php?tit &#133; ntralForce</a></p>]]></description>
			<author><![CDATA[dummy@example.com (anael)]]></author>
			<pubDate>Sun, 26 Apr 2015 09:36:15 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=7518#p7518</guid>
		</item>
		<item>
			<title><![CDATA[How to apply a gravitational force to an object?]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=7517#p7517</link>
			<description><![CDATA[<p>How to apply a gravitational force to an object? i want to make a sphere and the player walk 360 around it?</p>]]></description>
			<author><![CDATA[dummy@example.com (blend)]]></author>
			<pubDate>Sat, 25 Apr 2015 10:30:13 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=7517#p7517</guid>
		</item>
	</channel>
</rss>
