<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Maratis forum - Distance examples]]></title>
	<link rel="self" href="http://forum.maratis3d.com/extern.php?action=feed&amp;tid=1004&amp;type=atom"/>
	<updated>2014-06-16T19:01:14Z</updated>
	<generator>PunBB</generator>
	<id>http://forum.maratis3d.com/viewtopic.php?id=1004</id>
		<entry>
			<title type="html"><![CDATA[Re: Distance examples]]></title>
			<link rel="alternate" href="http://forum.maratis3d.com/viewtopic.php?pid=6907#p6907"/>
			<content type="html"><![CDATA[<p>@ant0n, Thanks for posting ! the more methods we have, the better <img src="http://forum.maratis3d.com/img/smilies/smile.png" width="15" height="15" alt="smile" /></p><p>@TD, Yeah it&#039;s a good one, what i really like with that app is you can feed it directly with png files, i had some nice results out of it, however tweaking the effet was kinda troublesome, i should try again</p><p>About the animated texture tutorial, there&#039;s a lot of info you don&#039;t even need in it, i&#039;m gonna remake it right now<br />keep you in touch</p><p>Edit : Early rewrite of the tut :<br /><a href="http://forum.maratis3d.com/viewtopic.php?pid=365#p365">http://forum.maratis3d.com/viewtopic.php?pid=365#p365</a></p>]]></content>
			<author>
				<name><![CDATA[Vegas]]></name>
				<uri>http://forum.maratis3d.com/profile.php?id=53</uri>
			</author>
			<updated>2014-06-16T19:01:14Z</updated>
			<id>http://forum.maratis3d.com/viewtopic.php?pid=6907#p6907</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Distance examples]]></title>
			<link rel="alternate" href="http://forum.maratis3d.com/viewtopic.php?pid=6906#p6906"/>
			<content type="html"><![CDATA[<p>Hey, I went looking for generators, and the first one I came across was this:</p><p><a href="http://www.saschawillems.de/?page_id=253">http://www.saschawillems.de/?page_id=253</a></p><p>Looks promising.</p><p>All I need to know now is how to export this animation, but I think I saw a tutorial either here or on the wiki.</p>]]></content>
			<author>
				<name><![CDATA[Tutorial Doctor]]></name>
				<uri>http://forum.maratis3d.com/profile.php?id=2493</uri>
			</author>
			<updated>2014-06-16T15:42:30Z</updated>
			<id>http://forum.maratis3d.com/viewtopic.php?pid=6906#p6906</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Distance examples]]></title>
			<link rel="alternate" href="http://forum.maratis3d.com/viewtopic.php?pid=6904#p6904"/>
			<content type="html"><![CDATA[<p>Hi all! great examples, Vegas!</p><p>Here is my function of receiving a distance:<br /></p><div class="codebox"><pre><code>function distance(entity1,entity2)
    local pos1 = (getTransformedPosition(entity1))
    local pos2 = (getTransformedPosition(entity2))
    return (math.sqrt(math.abs(math.pow((pos2[1]-pos1[1]),2)+math.pow((pos2[2]-pos1[2]),2) ) ) )
end</code></pre></div><div class="codebox"><pre><code>--the function call:
--1)
print(distance(player, enemy))

--2)
if distance(player, enemy) &lt; 100 then
    --
end</code></pre></div><p>if it is someone useful, can lay out other functions.</p>]]></content>
			<author>
				<name><![CDATA[ant0n]]></name>
				<uri>http://forum.maratis3d.com/profile.php?id=1562</uri>
			</author>
			<updated>2014-06-16T12:21:10Z</updated>
			<id>http://forum.maratis3d.com/viewtopic.php?pid=6904#p6904</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Distance examples]]></title>
			<link rel="alternate" href="http://forum.maratis3d.com/viewtopic.php?pid=6902#p6902"/>
			<content type="html"><![CDATA[<p>There it is, Lord TD <img src="http://forum.maratis3d.com/img/smilies/big_smile.png" width="15" height="15" alt="big_smile" /> </p><p>This particular explosion comes from a application called Particle Illusion <br />but basically my method is :</p><p>1) use a Imagemagick script to pack individual frames in a spritesheet<br />2) loading the texture into blender (i have a template for animating textures) <br />3) export. thats it</p><p>I have now a pretty decent collection of animated textures, with some found <br />on OGA, Deviant Art, and some others made with generators,I was planning to make a pack<br /> of these but i could never decide if i put :</p><p>1) Multiple animations on a single texture <br />= Easier to manage, less easier to use, not really tweakable afterward (or painfully)</p><p>or </p><p>2) One texture per animations (so 1 different mesh for each anims)<br />= Easier to use, less easier to manage, easily tweakable </p><p>+ with maratis MGUI that will use FreeImage library, maybe i can use better resolution, easier workflow, i dont know, maybe it&#039;s better to wait a bit</p>]]></content>
			<author>
				<name><![CDATA[Vegas]]></name>
				<uri>http://forum.maratis3d.com/profile.php?id=53</uri>
			</author>
			<updated>2014-06-16T10:49:14Z</updated>
			<id>http://forum.maratis3d.com/viewtopic.php?pid=6902#p6902</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Distance examples]]></title>
			<link rel="alternate" href="http://forum.maratis3d.com/viewtopic.php?pid=6901#p6901"/>
			<content type="html"><![CDATA[<p>Okay Sir Vegas, those explosions are awesome!!! What was your method?</p>]]></content>
			<author>
				<name><![CDATA[Tutorial Doctor]]></name>
				<uri>http://forum.maratis3d.com/profile.php?id=2493</uri>
			</author>
			<updated>2014-06-16T03:36:26Z</updated>
			<id>http://forum.maratis3d.com/viewtopic.php?pid=6901#p6901</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Distance examples]]></title>
			<link rel="alternate" href="http://forum.maratis3d.com/viewtopic.php?pid=6895#p6895"/>
			<content type="html"><![CDATA[<p>@TD, Yep, something like this (but take care it can be troublesome <br />to use on characters because it will then face the ground <img src="http://forum.maratis3d.com/img/smilies/tongue.png" width="15" height="15" alt="tongue" />)</p><p>@Anael, Outstanding ! Thank you <img src="http://forum.maratis3d.com/img/smilies/wink.png" width="15" height="15" alt="wink" /></p>]]></content>
			<author>
				<name><![CDATA[Vegas]]></name>
				<uri>http://forum.maratis3d.com/profile.php?id=53</uri>
			</author>
			<updated>2014-06-15T16:00:48Z</updated>
			<id>http://forum.maratis3d.com/viewtopic.php?pid=6895#p6895</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Distance examples]]></title>
			<link rel="alternate" href="http://forum.maratis3d.com/viewtopic.php?pid=6894#p6894"/>
			<content type="html"><![CDATA[<p>So something like?:<br /></p><div class="codebox"><pre><code>person = getObject(&quot;Person&quot;)
building = getObject(&quot;Building&quot;)
building2 = getObject(&quot;Building2&quot;)

--Person object should have LookAt behavior
translate(Person,{0,0,-1},&quot;local)

if isCollisionBetween(person,building) then
    setBehaviorVariable(Person,0,&quot;target&quot;,&quot;building2&quot;)
end</code></pre></div><p><a href="http://wiki.maratis3d.org/index.php?title=SetBehaviorVariable">http://wiki.maratis3d.org/index.php?tit &#133; orVariable</a></p><p>I will check this out later. Thanks.</p>]]></content>
			<author>
				<name><![CDATA[Tutorial Doctor]]></name>
				<uri>http://forum.maratis3d.com/profile.php?id=2493</uri>
			</author>
			<updated>2014-06-15T15:35:20Z</updated>
			<id>http://forum.maratis3d.com/viewtopic.php?pid=6894#p6894</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Distance examples]]></title>
			<link rel="alternate" href="http://forum.maratis3d.com/viewtopic.php?pid=6893#p6893"/>
			<content type="html"><![CDATA[<p>to convert % in position, just use the start and end positions :</p><p>- convert your % to a number between 0 and 1 : factor = percent*0.01<br />- then : pos = start_pos + (end_pos - start_pos)*factor</p>]]></content>
			<author>
				<name><![CDATA[anael]]></name>
				<uri>http://forum.maratis3d.com/profile.php?id=2</uri>
			</author>
			<updated>2014-06-15T15:30:24Z</updated>
			<id>http://forum.maratis3d.com/viewtopic.php?pid=6893#p6893</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Distance examples]]></title>
			<link rel="alternate" href="http://forum.maratis3d.com/viewtopic.php?pid=6891#p6891"/>
			<content type="html"><![CDATA[<p>Glad it helped <img src="http://forum.maratis3d.com/img/smilies/wink.png" width="15" height="15" alt="wink" /></p><div class="quotebox"><blockquote><p>guide an object along a path</p></blockquote></div><p>oh you need almost nothing to do this, from an empty project :</p><p>add 3 cubes, spread them, and name them :</p><p>Player<br />TargetA<br />TargetB</p><p>then put a LookAt behavior on the Player, with TargetA as target </p><p>and in script you could do</p><p>translate(Player, {0, 0, -1}, &quot;local&quot;)</p><p>(negative value on Z axis on a object who got LookAt on it, will always move toward his target)</p><p>And when it reaches TargetA and collide with physics, distance or whatever, change behavior to<br />setBehaviorVariable(Player, 0, &quot;target&quot;, &quot;TargetB&quot;)</p><p>I will update the 2nd and 3nd examples this evening, while i was fighting with my projects i got some ideas <img src="http://forum.maratis3d.com/img/smilies/smile.png" width="15" height="15" alt="smile" /></p>]]></content>
			<author>
				<name><![CDATA[Vegas]]></name>
				<uri>http://forum.maratis3d.com/profile.php?id=53</uri>
			</author>
			<updated>2014-06-15T15:22:58Z</updated>
			<id>http://forum.maratis3d.com/viewtopic.php?pid=6891#p6891</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Distance examples]]></title>
			<link rel="alternate" href="http://forum.maratis3d.com/viewtopic.php?pid=6890#p6890"/>
			<content type="html"><![CDATA[<p>So wait, I have a question, that DistancePercent thing has a box going from one point to another. So, I could use this to guide an object along a path then?</p><p>Also, the radius thing sort of acts like a wind system for particles.</p>]]></content>
			<author>
				<name><![CDATA[Tutorial Doctor]]></name>
				<uri>http://forum.maratis3d.com/profile.php?id=2493</uri>
			</author>
			<updated>2014-06-15T14:57:11Z</updated>
			<id>http://forum.maratis3d.com/viewtopic.php?pid=6890#p6890</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Distance examples]]></title>
			<link rel="alternate" href="http://forum.maratis3d.com/viewtopic.php?pid=6889#p6889"/>
			<content type="html"><![CDATA[<p>Nice!!! This solves my distance issue. I guess I can pick back up on that AI system.</p><p>I needed distance detection for the 5 senses, and also for the fuzzy logic I was trying to implement.</p>]]></content>
			<author>
				<name><![CDATA[Tutorial Doctor]]></name>
				<uri>http://forum.maratis3d.com/profile.php?id=2493</uri>
			</author>
			<updated>2014-06-15T14:03:00Z</updated>
			<id>http://forum.maratis3d.com/viewtopic.php?pid=6889#p6889</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Distance examples]]></title>
			<link rel="alternate" href="http://forum.maratis3d.com/viewtopic.php?pid=6888#p6888"/>
			<content type="html"><![CDATA[<p>Ooops thanks for the feedback, i fixed that <img src="http://forum.maratis3d.com/img/smilies/smile.png" width="15" height="15" alt="smile" /><br />for the third example i forgot to put instructions on screen, you needed to press &quot;1&quot; to spawn the clones</p><p>Im gonna add one or two more levels to this project later on,<br />a LookAt alternative like you suggested me a while back (with getLength3d(vec), normalize3d(vec) stuff)<br />and a mix-up of the 3 first examples</p><p>Oh and while i&#039;m at it, for the first example, do you know if that&#039;s possible to <br />convert back the % value to position ?</p><p>I wanted to spawn clones between point A &amp; B at a given % when launching the game,<br />(lets say 1 clones every 10%) but didn&#039;t succeed</p>]]></content>
			<author>
				<name><![CDATA[Vegas]]></name>
				<uri>http://forum.maratis3d.com/profile.php?id=53</uri>
			</author>
			<updated>2014-06-15T11:50:42Z</updated>
			<id>http://forum.maratis3d.com/viewtopic.php?pid=6888#p6888</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Distance examples]]></title>
			<link rel="alternate" href="http://forum.maratis3d.com/viewtopic.php?pid=6887#p6887"/>
			<content type="html"><![CDATA[<p>that&#039;s awesome !</p><p>The Radius collision detection mproj is not connected to the correct level by default,<br />I just loaded the good level and it worked.</p><p>But I didn&#039;t managed to make the Spawn multiple clones level working.</p>]]></content>
			<author>
				<name><![CDATA[anael]]></name>
				<uri>http://forum.maratis3d.com/profile.php?id=2</uri>
			</author>
			<updated>2014-06-15T11:13:22Z</updated>
			<id>http://forum.maratis3d.com/viewtopic.php?pid=6887#p6887</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Distance examples]]></title>
			<link rel="alternate" href="http://forum.maratis3d.com/viewtopic.php?pid=6885#p6885"/>
			<content type="html"><![CDATA[<p>here&#039;s 1 project with 3 levels about distance, pretty bad explained (or not at all) i&#039;m afraid !<br />but if it can give you some ideas it&#039;s all good </p><p>• <a href="https://dl.dropboxusercontent.com/u/19970067/Maratis/DistanceExamples/DistanceExamples.rar">Project</a></p><p>1) Calculate distance between meshes in percent<br /><span class="postimg"><img src="https://dl.dropboxusercontent.com/u/19970067/Maratis/DistanceExamples/DistancePercent.jpg" alt="PunBB bbcode test" /></span></p><br /><p>2) Radius collision detection, based on anael&#039;s method over here : <a href="http://forum.maratis3d.com/viewtopic.php?pid=6296#p6296">http://forum.maratis3d.com/viewtopic.php?pid=6296#p6296</a><br /><span class="postimg"><img src="https://dl.dropboxusercontent.com/u/19970067/Maratis/DistanceExamples/RadiusCollision.jpg" alt="PunBB bbcode test" /></span></p> <br /><p>3) Spawn multiple clones in a given object perimeter<br /><span class="postimg"><img src="https://dl.dropboxusercontent.com/u/19970067/Maratis/DistanceExamples/SpawnInRadius.jpg" alt="PunBB bbcode test" /></span></p><p>4) Spawn in Radius v2, will spawn animated texture at random positions on a controllable radius<br /><span class="postimg"><img src="https://dl.dropboxusercontent.com/u/19970067/Maratis/DistanceExamples/SpawnInRadius_v2.jpg" alt="PunBB bbcode test" /></span></p><br /><br /><p>Notes : I removed the object parenting in example 2, and use follow behavior instead</p>]]></content>
			<author>
				<name><![CDATA[Vegas]]></name>
				<uri>http://forum.maratis3d.com/profile.php?id=53</uri>
			</author>
			<updated>2014-06-14T19:29:19Z</updated>
			<id>http://forum.maratis3d.com/viewtopic.php?pid=6885#p6885</id>
		</entry>
</feed>
