<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
	<channel>
		<title><![CDATA[Maratis forum - Walk 360 around the surface of a sphere]]></title>
		<link>http://forum.maratis3d.com/viewtopic.php?id=1013</link>
		<description><![CDATA[The most recent posts in Walk 360 around the surface of a sphere.]]></description>
		<lastBuildDate>Sat, 19 Jul 2014 18:20:13 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Walk 360 around the surface of a sphere]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=7010#p7010</link>
			<description><![CDATA[<p>You just need to get your hands into vector mathematics,<br />there is some good introductions online, I found this : <a href="http://www.matrix44.net/cms/notes/opengl-3d-graphics/basic-3d-math-vectors">http://www.matrix44.net/cms/notes/openg &#133; th-vectors</a></p><p>Because your problem is just about mathematics, your need to understand how to handle vectors in a 3d world, then it will be a piece of cake.</p><p>There is two ways to solve your problem :</p><p>1 : use physics and modify the gravity vector like stated above depending on the player position and the planet center</p><p>2 : move the player yourself using vector and matrix math :<br />&nbsp; &nbsp; &nbsp;- get the player position<br />&nbsp; &nbsp; &nbsp;- move the player position orthogonally to the planet radius<br />&nbsp; &nbsp; &nbsp;- keep the player to the surface : force the distance of the vector |playerPos - planetCenter| to be always equal to the planet radius</p>]]></description>
			<author><![CDATA[dummy@example.com (anael)]]></author>
			<pubDate>Sat, 19 Jul 2014 18:20:13 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=7010#p7010</guid>
		</item>
		<item>
			<title><![CDATA[Re: Walk 360 around the surface of a sphere]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=7009#p7009</link>
			<description><![CDATA[<p>well i guess nobody knows</p>]]></description>
			<author><![CDATA[dummy@example.com (blend)]]></author>
			<pubDate>Sat, 19 Jul 2014 16:46:45 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=7009#p7009</guid>
		</item>
		<item>
			<title><![CDATA[Re: Walk 360 around the surface of a sphere]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=6968#p6968</link>
			<description><![CDATA[<p>This is the code i still cant figure it out? It&#039;s just the sponza tutorial with a sphere in it</p><div class="codebox"><pre><code>Player = getObject(&quot;Player&quot;)
Head = getObject(&quot;Head&quot;)
room = getObject(&quot;room&quot;)
sphere = getObject(&quot;sphere&quot;)

dx = 0.0
dy = 0.0

centerCursor()
mx = getAxis(&quot;MOUSE_X&quot;)
my = getAxis(&quot;MOUSE_Y&quot;)

-- scene update
function onSceneUpdate()

    playerPosition = getPosition(Player)
    vec = normalize(sphereCenter - playerPosition)*0.98)

    -- rotate Player (X mouse)
    rotate(Player, {0, 0, -1}, dx*100)
    
    -- rotate Head (Y mouse)
    rotate(Head, {-1, 0, 0}, dy*100, &quot;local&quot;)    
    rotation = getRotation(Head)
    if rotation[1] &gt; 90 then
        rotation[1] = 90
    elseif rotation[1] &lt; -90 then
        rotation[1] = -90
    end

    setRotation(Head, rotation)
    
    -- move    
    if isKeyPressed(&quot;W&quot;) then
        addCentralForce(Player, {0, 6, 0}, &quot;local&quot;)
    end
    
    if isKeyPressed(&quot;S&quot;) then
        addCentralForce(Player, {0, -6, 0}, &quot;local&quot;)
    end
    
    if isKeyPressed(&quot;A&quot;) then
        addCentralForce(Player, {-3, 0, 0}, &quot;local&quot;)
    end

    if isKeyPressed(&quot;D&quot;) then
        addCentralForce(Player, {3, 0, 0}, &quot;local&quot;)
    end    
    
    if isKeyPressed(&quot;SPACE&quot;) then
        addCentralForce(Player, {0, 0, 3}, &quot;local&quot;)
    end    
    
    -- get mouse direction
    dx = getAxis(&quot;MOUSE_X&quot;) - mx
    dy = getAxis(&quot;MOUSE_Y&quot;) - my

    -- center cursor
    centerCursor()
    hideCursor()
    gravity = {0, 0, -90}
    
    mx = getAxis(&quot;MOUSE_X&quot;)
    my = getAxis(&quot;MOUSE_Y&quot;)    
    
end
(</code></pre></div>]]></description>
			<author><![CDATA[dummy@example.com (blend)]]></author>
			<pubDate>Fri, 11 Jul 2014 22:18:52 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=6968#p6968</guid>
		</item>
		<item>
			<title><![CDATA[Re: Walk 360 around the surface of a sphere]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=6953#p6953</link>
			<description><![CDATA[<p>getPosition :<br /><a href="http://wiki.maratis3d.org/index.php?title=GetPosition">http://wiki.maratis3d.org/index.php?title=GetPosition</a></p>]]></description>
			<author><![CDATA[dummy@example.com (anael)]]></author>
			<pubDate>Sat, 05 Jul 2014 22:04:59 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=6953#p6953</guid>
		</item>
		<item>
			<title><![CDATA[Re: Walk 360 around the surface of a sphere]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=6952#p6952</link>
			<description><![CDATA[<p>how do i get the player position and center of sphere? I don&#039;t really understand</p>]]></description>
			<author><![CDATA[dummy@example.com (blend)]]></author>
			<pubDate>Sat, 05 Jul 2014 19:09:28 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=6952#p6952</guid>
		</item>
		<item>
			<title><![CDATA[Re: Walk 360 around the surface of a sphere]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=6951#p6951</link>
			<description><![CDATA[<p>you can start by setting the gravity every frame to this vector : normalize(sphereCenter - playerPosition)*0.98</p>]]></description>
			<author><![CDATA[dummy@example.com (anael)]]></author>
			<pubDate>Sat, 05 Jul 2014 18:08:27 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=6951#p6951</guid>
		</item>
		<item>
			<title><![CDATA[Walk 360 around the surface of a sphere]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=6949#p6949</link>
			<description><![CDATA[<p>So i want to walk 360 (anywhere) around the surface of a sphere without falling off how do i achieve this?</p><p>Here a diagram of what i want to do the cube is the FPS player and the sphere is the earth:<br /><a href="http://imgur.com/HHU1TeL">http://imgur.com/HHU1TeL</a></p>]]></description>
			<author><![CDATA[dummy@example.com (blend)]]></author>
			<pubDate>Sat, 05 Jul 2014 17:43:35 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=6949#p6949</guid>
		</item>
	</channel>
</rss>
