<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>The Park is Vast &#187; Plugins</title>
	<atom:link href="http://theparkisvast.com/VastPark/nerdy/plugins/feed/" rel="self" type="application/rss+xml" />
	<link>http://theparkisvast.com</link>
	<description></description>
	<lastBuildDate>Mon, 31 Oct 2011 18:44:18 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Presentation: The Technology Behind VastPark</title>
		<link>http://theparkisvast.com/2011/06/11/presentation-the-technology-behind-vastpark/</link>
		<comments>http://theparkisvast.com/2011/06/11/presentation-the-technology-behind-vastpark/#comments</comments>
		<pubDate>Fri, 10 Jun 2011 14:40:29 +0000</pubDate>
		<dc:creator>craigomatic</dc:creator>
				<category><![CDATA[IMML]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Plugins]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[VastPark General]]></category>

	<!-- AutoMeta Start -->
	<category>paris</category>
	<category>cantine</category>
	<category>slideshare</category>
	<category>10th</category>
	<category>june</category>
	<category>presentation</category>
	<category>technology</category>
	<category>audience</category>
	<!-- AutoMeta End -->
	
		<guid isPermaLink="false">http://theparkisvast.com/?p=652</guid>
		<description><![CDATA[Today I presented at La Cantine in Paris to both a real world audience and a virtual audience inside of VastPark. The presentation covered the technology that powers VastPark, where to find the open source code and the specifications such as IMML, Continuum, and the recently announced OpenAvatar. I also showed some live demonstrations of [...]]]></description>
			<content:encoded><![CDATA[<p>Today I presented at La Cantine in Paris to both a real world audience and a virtual audience inside of VastPark.</p>
<p>The presentation covered the technology that powers VastPark, where to find the open source code and the specifications such as IMML, Continuum, and the recently announced OpenAvatar. I also showed some live demonstrations of VastPark in action (the selective Continuum capture I did can be downloaded from <a href='http://theparkisvast.com/wp-content/uploads/2011/06/Retreat-2011-06-10-1031.continuum'>here</a>).</p>
<p>See the slideshare below, there was a lot of talking during the presentation so the slides may seem a little light on content. If you have questions about the slides feel free to comment and I will answer. </p>
<div style="width:595px" id="__ss_8271303"> <strong style="display:block;margin:12px 0 4px"><a href="http://www.slideshare.net/craigomatic/la-cantine-presentation-paris-10th-june-2011" title="La Cantine Presentation, Paris, 10th June 2011">La Cantine Presentation, Paris, 10th June 2011</a></strong> <iframe src="http://www.slideshare.net/slideshow/embed_code/8271303" width="595" height="497" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe> </div>
]]></content:encoded>
			<wfw:commentRss>http://theparkisvast.com/2011/06/11/presentation-the-technology-behind-vastpark/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Plugin Framework available via NuGet</title>
		<link>http://theparkisvast.com/2011/04/21/plugin-framework-available-via-nuget/</link>
		<comments>http://theparkisvast.com/2011/04/21/plugin-framework-available-via-nuget/#comments</comments>
		<pubDate>Wed, 20 Apr 2011 23:17:07 +0000</pubDate>
		<dc:creator>craigomatic</dc:creator>
				<category><![CDATA[Plugins]]></category>
		<category><![CDATA[NuGet]]></category>
		<category><![CDATA[Plugin API]]></category>
		<category><![CDATA[PluginFramework]]></category>

	<!-- AutoMeta Start -->
	<category>nuget</category>
	<category>project</category>
	<category>reference</category>
	<category>install</category>
	<category>mvc3</category>
	<category>package</category>
	<category>pluginframework</category>
	<category>studio</category>
	<category>nuget</category>
	<category>project</category>
	<category>reference</category>
	<category>install</category>
	<category>mvc3</category>
	<category>package</category>
	<category>pluginframework</category>
	<category>studio</category>
	<!-- AutoMeta End -->
	
		<guid isPermaLink="false">http://theparkisvast.com/?p=621</guid>
		<description><![CDATA[After a recent visit to Las Vegas for MIX11 (which was excellent btw) I was taken by the usefulness of NuGet and decided it was time to contribute a package into the main feed. I&#8217;ve been developing a plugin framework, imaginatively named VastPark.PluginFramework which I hope to eventually massage into a really convenient MVC framework. [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://theparkisvast.com/wp-content/uploads/2011/04/nuget-logo.png" rel="lightbox"><img src="http://theparkisvast.com/wp-content/uploads/2011/04/nuget-logo.png" alt="" title="nuget-logo" width="228" height="67" class="alignnone size-full wp-image-625" /></a></p>
<p>After a recent visit to Las Vegas for <a href="http://live.visitmix.com/">MIX11</a> (which was excellent btw) I was taken by the usefulness of <a href="http://nuget.org">NuGet</a> and decided it was time to contribute a package into the main feed.</p>
<p>I&#8217;ve been developing a plugin framework, imaginatively named VastPark.PluginFramework which I hope to eventually massage into a really convenient MVC framework. </p>
<p>As it stands today it is a useful time saving library to be familiar with and I&#8217;d recommend all VastPark plugin developers make use of it.</p>
<h4>1. Install NuGet</h4>
<p>This has been covered in detail elsewhere and chances are you already have it installed as it is included in <a href="http://www.asp.net/mvc/mvc3">MVC3</a>.</p>
<p>Visit the CodePlex documentation site <a href="http://nuget.codeplex.com/wikipage?title=Using%20the%20Extension%20Manager%20to%20Install%20the%20Library%20Package%20Manager%20(NuGet)">here</a> for a simple install guide.</p>
<h4>2. Create a new plugin project in Visual Studio</h4>
<p>As per usual, create a new project in Visual Studio:</p>
<p><a href="http://theparkisvast.com/wp-content/uploads/2011/04/new-project.jpg" rel="lightbox"><img src="http://theparkisvast.com/wp-content/uploads/2011/04/new-project.jpg" alt="" title="new-project" width="900" height="622" class="alignnone size-full wp-image-632" /></a></p>
<p><strong>Note:</strong> It&#8217;s best to go with .NET Framework 3.5 as the target framework, the client applications are built against this version of the .NET framework.</p>
<h4>3. Add package reference to VastPark.PluginFramework</h4>
<p>Right-click References and choose the shiny Add Library Package Reference button:</p>
<p><a href="http://theparkisvast.com/wp-content/uploads/2011/04/add-lib-pkg.jpg" rel="lightbox"><img src="http://theparkisvast.com/wp-content/uploads/2011/04/add-lib-pkg.jpg" alt="" title="add-lib-pkg" width="900" height="604" class="alignnone size-full wp-image-631" /></a></p>
<p>Next perform a search for &#8216;VastPark&#8217;:</p>
<p><a href="http://theparkisvast.com/wp-content/uploads/2011/04/search-vastpark.jpg" rel="lightbox"><img src="http://theparkisvast.com/wp-content/uploads/2011/04/search-vastpark.jpg" alt="" title="search-vastpark" width="900" height="600" class="alignnone size-full wp-image-634" /></a></p>
<p>Click install to download the package and have it magically added to your project. </p>
<p>You should now see some additional assemblies referenced and a blueprint.xml file included in your project:</p>
<p><a href="http://theparkisvast.com/wp-content/uploads/2011/04/plugin-framework-reference-added.jpg" rel="lightbox"><img src="http://theparkisvast.com/wp-content/uploads/2011/04/plugin-framework-reference-added.jpg" alt="" title="plugin-framework-reference-added" width="900" height="641" class="alignnone size-full wp-image-633" /></a></p>
<h4>4. Code your plugin!</h4>
<p>Sit back for a moment to ponder the awesome of NuGet, then get on with coding your plugin <img src='http://theparkisvast.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  </p>
<p><a href="http://theparkisvast.com/wp-content/uploads/2011/04/using-plugin-framework.jpg" rel="lightbox"><img src="http://theparkisvast.com/wp-content/uploads/2011/04/using-plugin-framework.jpg" alt="" title="using-plugin-framework" width="900" height="641" class="alignnone size-full wp-image-635" /></a></p>
<p>See here for the NuGet package page: <a href="http://nuget.org/List/Packages/VastPark.PluginFramework">http://nuget.org/List/Packages/VastPark.PluginFramework</a></p>
]]></content:encoded>
			<wfw:commentRss>http://theparkisvast.com/2011/04/21/plugin-framework-available-via-nuget/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Pianist v2</title>
		<link>http://theparkisvast.com/2011/04/15/the-pianist-v2/</link>
		<comments>http://theparkisvast.com/2011/04/15/the-pianist-v2/#comments</comments>
		<pubDate>Fri, 15 Apr 2011 04:29:51 +0000</pubDate>
		<dc:creator>craigomatic</dc:creator>
				<category><![CDATA[IMML]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Plugins]]></category>
		<category><![CDATA[Audio]]></category>
		<category><![CDATA[Behaviours]]></category>
		<category><![CDATA[Continuum]]></category>
		<category><![CDATA[Recording]]></category>
		<category><![CDATA[Roland HP1300e]]></category>
		<category><![CDATA[Virtual Piano]]></category>

	<!-- AutoMeta Start -->
	<category>piano</category>
	<category>sound</category>
	<category>behaviours</category>
	<category>csharp</category>
	<category>pianist</category>
	<category>played</category>
	<category>parkengine</category>
	<category>visually</category>
	<category>piano</category>
	<category>sound</category>
	<category>behaviours</category>
	<category>csharp</category>
	<category>pianist</category>
	<category>played</category>
	<category>parkengine</category>
	<category>visually</category>
	<!-- AutoMeta End -->
	
		<guid isPermaLink="false">http://theparkisvast.com/?p=588</guid>
		<description><![CDATA[Back in April of 2007 I was inspired to build a virtual piano in VastPark, you can read the super brief post about it here. At the time, I was pretty happy with the way it turned out and recently decided it was time for it to make a comeback! How it works This time [...]]]></description>
			<content:encoded><![CDATA[<p>Back in April of 2007 I was inspired to build a virtual piano in VastPark, you can read the super brief post about it <a href="http://theparkisvast.com/2007/04/18/the-pianist-v10/">here</a>. </p>
<p>At the time, I was pretty happy with the way it turned out and recently decided it was time for it to make a comeback!</p>
<p><a href="http://theparkisvast.com/wp-content/uploads/2011/04/the-pianist-v2.jpg" rel="lightbox"><img src="http://theparkisvast.com/wp-content/uploads/2011/04/the-pianist-v2.jpg" alt="" title="the-pianist-v2" width="836" height="499" class="alignnone size-full wp-image-590" /></a></p>
<h4>How it works</h4>
<p>This time around I decided to do things a little differently and shift all of the logic to a single .NET plugin that controls the entire piano experience. </p>
<p>While this has a number of benefits, I was primarily interested in keeping the structure of the environment cleanly separated from the logic.</p>
<p>To keep this separation simple, I made use of a little known feature of IMML called behaviours. Here&#8217;s a sample of my IMML:</p>
<pre class="brush: xml; highlight: [20,26]; title: ; notranslate">&lt;IMML Name=&quot;The Pianist v2&quot; Camera=&quot;camera&quot; xmlns=&quot;http://schemas.vastpark.com/2007/imml/&quot;&gt;

  &lt;!-- The plugin manages all interaction with the piano via behaviours --&gt;
  &lt;Plugin Name=&quot;PianoPlugin&quot; Enabled=&quot;True&quot; Source=&quot;plugins/Piano.plugin&quot;&gt;
    &lt;Parameter Key=&quot;HighlightColour&quot; Value=&quot;#00FF00&quot; /&gt;
    &lt;Parameter Key=&quot;RotationWhenPressed&quot; Value=&quot;0.03120605, 0, 0&quot; /&gt;
  &lt;/Plugin&gt;

  &lt;Model Name=&quot;black_piano&quot;
         Size=&quot;1.193525,1.065062,0.524349&quot;
         Rotation=&quot;6.283185,0,0&quot;
         Position=&quot;4.76837E-07,1.63393E-08,0.111626&quot;
         Source=&quot;models/black_piano.model&quot; /&gt;

  &lt;!-- Piano key models --&gt;
  &lt;Model Name=&quot;key_b_8&quot;
         Size=&quot;0.01918364,0.02875674,0.1308559&quot;
         Rotation=&quot;6.283185,0,0&quot;
         Position=&quot;-0.4839502,0.8194631,0.2247874&quot;
         Behaviours=&quot;piano-key&quot;
         Source=&quot;models/white_key1.model&quot; /&gt;
  &lt;!-- other models snipped for brevity --&gt;

  &lt;!-- Piano sounds --&gt;
  &lt;Sound Name=&quot;note_b_8&quot;
         Behaviours=&quot;piano-key-sound&quot;
         Source=&quot;sounds/pianokey_b_8.mp3&quot; /&gt;
  &lt;!-- other sounds snipped for brevity --&gt;

&lt;/IMML&gt;</pre>
<p>Note the usage of the piano-key and piano-key-sound behaviours. </p>
<p>Also, I&#8217;ve only shown one model and one sound, the actual file contains 88 of each named according to a convention so that the appropriate sound can be mapped.</p>
<h4>Using Behaviours</h4>
<p>Every IMML element has the ability to be marked as having one or more behaviours that can be accessed as a list via the DOM.</p>
<p>This is extremely handy when writing plugins that manipulate elements, as you can simply query the scene for elements that match the desired behaviours like so:</p>
<pre class="brush: csharp; title: ; notranslate">
//find all audio and models based on behaviour
var keyModels = base.ParkEngine.Context.Elements.Where(e =&gt; e.Behaviours.Contains(this.KeyModelBehaviour));
var keySounds = base.ParkEngine.Context.Elements.Where(e =&gt; e.Behaviours.Contains(this.KeySoundBehaviour));

if(keyModels.Any())
{
    //build keys for each model/sound combination
}
</pre>
<p>This works really well during the <em>Load()</em> method and can also be performed on elements dynamically added into the scene by listening to the <em>ParkEngine.ElementLoaded</em> event</p>
<p>In the context of the-pianist, it finds all elements of type <em>piano-key</em> and <em>piano-key-sound</em> and builds a PianoKey instance to manage them so that:</p>
<ul>
<li>When the mouse is down, the key is visually down, highlighted and the sound plays.</li>
<li>When the mouse is up, the key is visually up.</li>
<li>When the sound is no longer playing, the key is no longer highlighted</li>
</ul>
<h4>Continuum</h4>
<p>Next, I wanted to make sure that the work my plugin was doing would be correctly captured by Continuum. By default, Continuum will happily capture any series of changes in IMML state, so this initially didn&#8217;t seem like it would be a concern. </p>
<p>However, in my implementation of the Piano plugin I wanted to allow the same key to be pressed while the previous sound for that key was still playing. Just like a real piano.</p>
<p>To do this, I&#8217;ve been a little sneaky by going directly to the sound engine, bypassing the IMML change notification infrastructure which means that Continuum doesn&#8217;t see that change and cannot record it without some additional help.</p>
<p>You can see the two contrasting approaches below:</p>
<pre class="brush: csharp; title: ; notranslate">
//toggle approach
this.Audible.Enabled = true;

//direct approach, bypass the IMML change framework
this.ParkEngine.SoundEngine.Play(this.Audible);
</pre>
<p>To overcome this limitation, I wrote an implementation of IStateRecorder for my plugin with one very simple method:</p>
<pre class="brush: csharp; title: ; notranslate">
/// &lt;summary&gt;
/// Marks the sound as being played directly by the SoundEngine.
/// &lt;/summary&gt;
/// &lt;param name=&quot;sound&quot;&gt;The sound.&lt;/param&gt;
public void MarkSoundPlayed(Sound sound)
{
        if (!this.IsStarted)
        {
            return;
        }

        var captureState = new PianoCaptureState(Encoding.ASCII.GetBytes(sound.Name), Constants.Guid, DateTime.UtcNow, 0);

        this.Buffer.Enqueue(captureState);
}
</pre>
<p>It takes the name of the element that was played directly and writes it into the Continuum stream. </p>
<p>Later during playback, that element is resolved and at the appropriate time is played directly by the PianoStateController.</p>
<h4>Goodies</h4>
<p>I&#8217;ve zipped up the full source code to Plugin.Piano, along with the IMML and models you see in the screenshot at the beginning of this post. </p>
<p>Download here: <a href="http://tpiv.s3.amazonaws.com/the-pianist-v2.7z">http://tpiv.s3.amazonaws.com/the-pianist-v2.7z</a></p>
<p>Note that In order to run this properly, you&#8217;ll need to be a member of the Closed Beta community on <a href="http://vastpark.org">vastpark.org</a> (contact me if you&#8217;d like in) and be rocking Player v1.5.2 build 92 or newer.</p>
<p><strong>Update:</strong> <em>A more recent version of the-pianist IMML is available <a href='http://theparkisvast.com/wp-content/uploads/2011/04/the-pianist.zip'>here</a>. </p>
<p>Simply unzip into the hosting root directory of your WorldServer to host.</em></p>
]]></content:encoded>
			<wfw:commentRss>http://theparkisvast.com/2011/04/15/the-pianist-v2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>VastPark Developer Introduction &#8211; v1.3 Framework</title>
		<link>http://theparkisvast.com/2010/07/30/vastpark-developer-introduction-v1-3-framework/</link>
		<comments>http://theparkisvast.com/2010/07/30/vastpark-developer-introduction-v1-3-framework/#comments</comments>
		<pubDate>Fri, 30 Jul 2010 00:02:42 +0000</pubDate>
		<dc:creator>craigomatic</dc:creator>
				<category><![CDATA[IMML]]></category>
		<category><![CDATA[Plugins]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[VastPark General]]></category>

	<!-- AutoMeta Start -->
	<category>talk</category>
	<category>audio</category>
	<category>audience</category>
	<category>offered</category>
	<category>products</category>
	<category>primer</category>
	<category>planning</category>
	<category>curious</category>
	<category>talk</category>
	<category>audio</category>
	<category>audience</category>
	<category>offered</category>
	<category>products</category>
	<category>primer</category>
	<category>planning</category>
	<category>curious</category>
	<!-- AutoMeta End -->
	
		<guid isPermaLink="false">http://theparkisvast.com/?p=284</guid>
		<description><![CDATA[Update: The video was re-dubbed, you now get the pleasure of Liz&#8217;s delightful voice I recently gave a talk to a team of developers interested in working with the platform who are planning to build some new exciting products on top of it. One of the audience offered to record the session remotely so the [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Update:</strong> The video was re-dubbed, you now get the pleasure of Liz&#8217;s delightful voice <img src='http://theparkisvast.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>I recently gave a talk to a team of developers interested in working with the platform who are planning to build some new exciting products on top of it. </p>
<p>One of the audience offered to record the session remotely so the audio is a little scratchy, but I think it&#8217;s come across ok.</p>
<p>The talk covers:</p>
<ul>
<li>IMML</li>
<li>VastScript</li>
<li>Network enabled elements</li>
<li>HTML interop</li>
<li>Video</li>
<li>Audio</li>
<li>Textures</li>
<li>User Profiles</li>
<li>Plugins</li>
</ul>
<p><object width="640" height="424"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=13720857&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=1&amp;color=FF7700&amp;fullscreen=1" /><embed src="http://vimeo.com/moogaloop.swf?clip_id=13720857&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=1&amp;color=FF7700&amp;fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="640" height="424"></embed></object></p>
<p>Hopefully this is a useful primer if you are interested in developing with VastPark or are curious to know a little more about the way the system functions.</p>
<p>Download the PDF shown in the video here: <a href="http://theparkisvast.com/wp-content/plugins/download-monitor/download.php?id=7">VastPark Developer Introduction - Framework v1.3</a></p>
]]></content:encoded>
			<wfw:commentRss>http://theparkisvast.com/2010/07/30/vastpark-developer-introduction-v1-3-framework/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Flocking algorithm in VastPark</title>
		<link>http://theparkisvast.com/2010/04/13/flocking-algorithm-in-vastpark/</link>
		<comments>http://theparkisvast.com/2010/04/13/flocking-algorithm-in-vastpark/#comments</comments>
		<pubDate>Tue, 13 Apr 2010 03:47:26 +0000</pubDate>
		<dc:creator>craigomatic</dc:creator>
				<category><![CDATA[IMML]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Plugins]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[Boids]]></category>
		<category><![CDATA[Flocking]]></category>

	<!-- AutoMeta Start -->
	<category>flocking</category>
	<category>boids</category>
	<category>boids</category>
	<category>implement</category>
	<category>algorithm</category>
	<category>rule</category>
	<category>enjoy</category>
	<category>cool</category>
	<!-- AutoMeta End -->
	
		<guid isPermaLink="false">http://theparkisvast.com/?p=236</guid>
		<description><![CDATA[Many months ago during May of 09, after meeting Ian Hughes at FCVW, I came across an interesting post on his blog discussing an implementation of the flocking algorithm in Unity. I&#8217;d not heard of the term flocking or boids, so proceeded to get stuck into some research, which lead me to Conrad Parker&#8217;s page [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://theparkisvast.com/wp-content/uploads/2010/04/flocking.jpg" rel="lightbox"><img src="http://theparkisvast.com/wp-content/uploads/2010/04/flocking.jpg" alt="" title="flocking" width="242" height="150" class="alignright size-full wp-image-255" /></a></td>
<p>Many months ago during May of 09, after meeting Ian Hughes at <a href="http://www.ndu.edu/IRMC/fedconsortium.html">FCVW</a>, I came across an <a href="http://www.feedingedge.co.uk/blog/2009/05/11/flocking-brilliant-fill-in-own-joke-here/">interesting post</a> on his blog discussing an implementation of the <a href="http://www.red3d.com/cwr/boids/">flocking algorithm</a> in Unity. </p>
<p>I&#8217;d not heard of the term flocking or boids, so proceeded to get stuck into some research, which lead me to Conrad Parker&#8217;s page on <a href="http://www.vergenet.net/~conrad/boids/pseudocode.html">Boids Pseudocode</a> as well as many others who had implemented the algorithm, I figured it would be a fun little plugin to write for VastPark so gave it a try.</p>
<h4>Implementing the algorithm</h4>
<p>Thinking about what was required, I came up with the following as the plan for the plugin:</p>
<ul>
<li>Any IPositionalElement (Model, Primitive, Sound, Camera, Light, etc) would be supported</li>
<li>Implement Rule 1 &#8211; &#8220;Boids try to fly towards the centre of mass of neighbouring boids&#8221;</li>
<li>Implement Rule 2 &#8211; &#8220;Boids try to keep a small distance away from other objects (including other boids)&#8221;</li>
<li>Implement Rule 3 &#8211; &#8220;Boids try to match velocity with near boids&#8221;</li>
<li>For bonus points I&#8217;d implement &#8220;Tendency towards a particular place&#8221;, &#8220;Limiting the speed&#8221;, &#8220;Bounding the position&#8221;, &#8220;Perching&#8221; and &#8220;Scattering the flock&#8221;</li>
</ul>
<p>In terms of the plugin this translates into these properties:</p>
<ul>
<li>SmallDistance</li>
<li>MaxVelocity</li>
<li>MinVelocity</li>
<li>EnableBounds</li>
<li>MaxBounds</li>
<li>MinBounds</li>
<li>EnablePerching</li>
<li>MinPerchTime</li>
<li>MaxPerchTime</li>
<li>PerceivedCentre (get only)</li>
</ul>
<p>The following callbacks:</p>
<ul>
<li>ElementPerched</li>
<li>ElementLeftPerch</li>
</ul>
<p>The following methods:</p>
<ul>
<li>SetPointOfInterest</li>
<li>AddPlaceToAvoid</li>
<li>AddPerch</li>
<li>Scatter</li>
</ul>
<p>The class diagrams look like this:<br />
<a href="http://theparkisvast.com/wp-content/uploads/2010/04/flocking-plugin-class-diagram.png" rel="lightbox"><img src="http://theparkisvast.com/wp-content/uploads/2010/04/flocking-plugin-class-diagram.png" alt="" title="flocking-plugin-class-diagram" width="619" height="523" class="aligncenter size-full wp-image-243" /></a></p>
<h4>How does it work?</h4>
<p>Put quite simply, the plugin works like this:</p>
<ul>
<li><em>AddElement(ImmlElement element)</em> creates a boid instance for the positional element passed</li>
<li>The plugin Update method (called once each update by the VastPark framework) proceeds to calculate the rules, one at a time for each boid to work out the new velocity and position for the element it represents</li>
<li>Scatter requests made during runtime are dealt with during the next update</li>
</ul>
<h4>Downloads</h4>
<p>Here is some sample IMML and the source code to the plugin, enjoy! Let me know if you decide to implement any of the other rules or do something cool with it <img src='http://theparkisvast.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Sample IMML: <a href='http://theparkisvast.com/wp-content/uploads/2010/04/flocking.imml'>flocking.imml</a><br />
Source code to plugin: <a href='http://theparkisvast.com/wp-content/uploads/2010/04/Plugin.Flocking.zip'>Plugin.Flocking.zip</a></p>
<p><strong>Note:</strong> The source code will probably complain about some missing references. Install the Player from <a href="http://www.vastpark.com">www.vastpark.com</a> and link against the relevant binaries included with it.</p>
]]></content:encoded>
			<wfw:commentRss>http://theparkisvast.com/2010/04/13/flocking-algorithm-in-vastpark/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Drag and Drop Sample</title>
		<link>http://theparkisvast.com/2010/02/20/drag-and-drop-sample/</link>
		<comments>http://theparkisvast.com/2010/02/20/drag-and-drop-sample/#comments</comments>
		<pubDate>Fri, 19 Feb 2010 20:56:14 +0000</pubDate>
		<dc:creator>craigomatic</dc:creator>
				<category><![CDATA[IMML]]></category>
		<category><![CDATA[Plugins]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[0.98 release]]></category>

	<!-- AutoMeta Start -->
	<category>tostring</category>
	<category>updateuri</category>
	<category>metaforikadapter</category>
	<category>writeline</category>
	<category>item</category>
	<category>drag</category>
	<category>controller</category>
	<category>pages</category>
	<!-- AutoMeta End -->
	
		<guid isPermaLink="false">http://theparkisvast.com/?p=177</guid>
		<description><![CDATA[One of the major features of the 0.98 release is the inclusion of drag and drop. Basically, this allows you to drag an Item into the 3D space where the IMML can decide to do something with it. To try drag and drop out for yourself, first download (right-click, save as) and open in the [...]]]></description>
			<content:encoded><![CDATA[<table>
<tr>
<td>
<img src="http://theparkisvast.com/wp-content/uploads/2010/02/mouse-cursor.png" alt="" title="mouse-cursor" width="48" height="48" class="alignleft size-full wp-image-226" />
</td>
<td>
One of the major features of the <a href="http://theparkisvast.com/2010/02/17/vastpark-platform-0-98-released/">0.98 release</a> is the inclusion of drag and drop. Basically, this allows you to drag an Item into the 3D space where the IMML can decide to do something with it.
</td>
</tr>
</table>
<p>To try drag and drop out for yourself, first download <a href="http://theparkisvast.com/wp-content/plugins/download-monitor/download.php?id=5">generic-drag-drop-sample.imml</a> (right-click, save as) and open in the Player.</p>
<p>Next, you&#8217;ll need to expand the Items list. Do so by clicking on this icon:</p>
<p><a href="http://theparkisvast.com/wp-content/uploads/2010/02/player-items-button.jpg" rel="lightbox"><img src="http://theparkisvast.com/wp-content/uploads/2010/02/player-items-button.jpg" alt="" title="player-items-button" width="232" height="42" class="aligncenter size-full wp-image-162" /></a></p>
<p>By default you are presented with the list of Items of type <em>Video</em> and <em>Document</em> that the currently logged in account has access to (these can be further restricted by the <a href="http://vastpark.org/wiki/vp/VastPark_Server#ACL">hosting server&#8217;s group ACL</a>). </p>
<p>In this case as we are opening the file directly, it will default to showing the most recently published Items without filtering and should look similar to this:</p>
<p><a href="http://theparkisvast.com/wp-content/uploads/2010/02/drag-drop-1.jpg" rel="lightbox"><img src="http://theparkisvast.com/wp-content/uploads/2010/02/drag-drop-1-300x178.jpg" alt="" title="drag-drop-1" width="300" height="178" class="aligncenter size-medium wp-image-173" /></a></p>
<p>Click to select one of the items from the list (in my example, I&#8217;ve chosen &#8220;VastPark Logo&#8221;) and drag it onto the 3D view. The large rectangle in the centre of the screen will change colour to blue indicating it is a drop target.</p>
<p><a href="http://theparkisvast.com/wp-content/uploads/2010/02/drag-drop-2.jpg" rel="lightbox"><img src="http://theparkisvast.com/wp-content/uploads/2010/02/drag-drop-2-300x178.jpg" alt="" title="drag-drop-2" width="300" height="178" class="aligncenter size-medium wp-image-174" /></a></p>
<p>Next, drop the Item onto the blue rectangle, which will cause it to change colour to green. Shortly the VastPark logo will appear on it.</p>
<p><a href="http://theparkisvast.com/wp-content/uploads/2010/02/drag-drop-3.jpg" rel="lightbox"><img src="http://theparkisvast.com/wp-content/uploads/2010/02/drag-drop-3-300x178.jpg" alt="" title="drag-drop-3" width="300" height="178" class="aligncenter size-medium wp-image-175" /></a></p>
<h4>How does this work?</h4>
<p>Behind the scenes is a plugin (called MetaforikAdapter) which currently supports adapting Items of type &#8220;Document&#8221; and &#8220;Video&#8221; to a Model or Primitive element. The code to do this is quite simple. </p>
<p>First, reference the Plugin:<br />
<pre class="php">&lt;Plugin Enabled=<span style="color: #ff0000;">&quot;True&quot;</span> Source=<span style="color: #ff0000;">&quot;http://id.vastpark.com/VastParkWS/get.vpws?name=MetaforikAdapter&amp;amp;publisher=craigomatic&amp;amp;domain=vastpark&amp;amp;context=park&quot;</span> Name=<span style="color: #ff0000;">&quot;MetaforikAdapter&quot;</span>&gt;
    &lt;Element Name=<span style="color: #ff0000;">&quot;InvalidRequestHandler&quot;</span> /&gt;
    &lt;Parameter <a href="http://www.php.net/key"><span style="color: #000066;">Key</span></a>=<span style="color: #ff0000;">&quot;InvalidRequestEvent&quot;</span> Value=<span style="color: #ff0000;">&quot;InvalidRequestHandler&quot;</span> /&gt;    
  &lt;/Plugin&gt;   
  
  &lt;Script Name=<span style="color: #ff0000;">&quot;InvalidRequestHandler&quot;</span>&gt;
    <span style="color: #000000; font-weight: bold;">function</span> main<span style="color: #66cc66;">&#40;</span>obj, args<span style="color: #66cc66;">&#41;</span>
      scene.ui:writeline<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'invalid request'</span><span style="color: #66cc66;">&#41;</span>          
    <a href="http://www.php.net/end"><span style="color: #000066;">end</span></a>
  <span style="color: #000000; font-weight: bold;">&lt;/Script&gt;</span></pre><br />
Next, handle the appropriate events on the elements you want to be able to drop on. Alternatively, this can be at the document level:<br />
<pre class="php">&lt;Trigger Event=<span style="color: #ff0000;">&quot;DragDrop&quot;</span> Target=<span style="color: #ff0000;">&quot;OnDragDrop&quot;</span> /&gt;
&lt;Trigger Event=<span style="color: #ff0000;">&quot;DragEnter&quot;</span> Target=<span style="color: #ff0000;">&quot;OnDragEnter&quot;</span> /&gt;
&lt;Trigger Event=<span style="color: #ff0000;">&quot;DragLeave&quot;</span> Target=<span style="color: #ff0000;">&quot;OnDragLeave&quot;</span> /&gt;</pre></p>
<p>In you script for the drop, pass the Item along with the element you want to adapt it to into the load method on the plugin. You may choose to inspect the Item before the drop to give user feedback as is done in the sample IMML.<br />
<pre class="php">&lt;Script Name=<span style="color: #ff0000;">&quot;OnDragDrop&quot;</span>&gt;
    <span style="color: #000000; font-weight: bold;">function</span> main<span style="color: #66cc66;">&#40;</span>obj, args<span style="color: #66cc66;">&#41;</span>            
      --args.data contains the Item which was dragged in
      
      --load returns a controller object
      c = metaforikadapter:load<span style="color: #66cc66;">&#40;</span>args.data, obj<span style="color: #66cc66;">&#41;</span>      
    
      scene.ui:writeline<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'item name: '</span>..c.item.name<span style="color: #66cc66;">&#41;</span>
      scene.ui:writeline<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'id: '</span>..c.id<span style="color: #66cc66;">&#41;</span>
      scene.ui:writeline<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'is first: '</span>..tostring<span style="color: #66cc66;">&#40;</span>c.isfirst<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
      scene.ui:writeline<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'is last: '</span>..tostring<span style="color: #66cc66;">&#40;</span>c.islast<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
      scene.ui:writeline<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'total pages: '</span>..tostring<span style="color: #66cc66;">&#40;</span>c.pages<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
      scene.ui:writeline<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'current page: '</span>..tostring<span style="color: #66cc66;">&#40;</span>c.currentpage<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
    <a href="http://www.php.net/end"><span style="color: #000066;">end</span></a>
<span style="color: #000000; font-weight: bold;">&lt;/Script&gt;</span>
  
&lt;Script Name=<span style="color: #ff0000;">&quot;OnDragEnter&quot;</span>&gt;
    <span style="color: #000000; font-weight: bold;">function</span> main<span style="color: #66cc66;">&#40;</span>obj, args<span style="color: #66cc66;">&#41;</span>
        scene.ui:writeline<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'drag enter on: '</span>..obj.name..<span style="color: #ff0000;">' of type: '</span>..args.data.assets<span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#93;</span>.type<span style="color: #66cc66;">&#41;</span>     
    <a href="http://www.php.net/end"><span style="color: #000066;">end</span></a>
<span style="color: #000000; font-weight: bold;">&lt;/Script&gt;</span>
  
&lt;Script Name=<span style="color: #ff0000;">&quot;OnDragLeave&quot;</span>&gt;
    <span style="color: #000000; font-weight: bold;">function</span> main<span style="color: #66cc66;">&#40;</span>obj, args<span style="color: #66cc66;">&#41;</span>
      scene.ui:writeline<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'drag leave on: '</span>..obj.name<span style="color: #66cc66;">&#41;</span>
    <a href="http://www.php.net/end"><span style="color: #000066;">end</span></a>
<span style="color: #000000; font-weight: bold;">&lt;/Script&gt;</span></pre></p>
<h4>Working with elements other than Document or Video</h4>
<p>One thing to be aware of is that you don&#8217;t necessarily have to use the MetaforikAdapter plugin to benefit from drag and drop. If you want to allow for models or sounds to be dropped in, you can use the item.updateuri as the source for the element and add it into the scene, like this:<br />
<pre class="php">&lt;Script Name=<span style="color: #ff0000;">&quot;OnDragDrop&quot;</span>&gt;
    <span style="color: #000000; font-weight: bold;">function</span> main<span style="color: #66cc66;">&#40;</span>obj, args<span style="color: #66cc66;">&#41;</span>    
      item = args.data
      <span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span>item.assets<span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#93;</span>.type == <span style="color: #ff0000;">'Model'</span><span style="color: #66cc66;">&#41;</span> then       
          m = model<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>
          m.source = args.data.updateuri
      
          scene:add<span style="color: #66cc66;">&#40;</span>m<span style="color: #66cc66;">&#41;</span>     
      <a href="http://www.php.net/end"><span style="color: #000066;">end</span></a>
    <a href="http://www.php.net/end"><span style="color: #000066;">end</span></a>
<span style="color: #000000; font-weight: bold;">&lt;/Script&gt;</span></pre></p>
<h4>Final Note</h4>
<p>That&#8217;s really all there is to it, you may want to craft different UI depending on the state of the controller properties in the MetaforikAdapter plugin sample, ie: to handle a multi-page document differently to a video or single page document, or in the model example to only allow certain users to drop models into a specific region of your space. </p>
]]></content:encoded>
			<wfw:commentRss>http://theparkisvast.com/2010/02/20/drag-and-drop-sample/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Updated IMML for Stock Market Ticker</title>
		<link>http://theparkisvast.com/2010/02/17/updated-imml-for-stock-market-ticker/</link>
		<comments>http://theparkisvast.com/2010/02/17/updated-imml-for-stock-market-ticker/#comments</comments>
		<pubDate>Wed, 17 Feb 2010 03:56:28 +0000</pubDate>
		<dc:creator>craigomatic</dc:creator>
				<category><![CDATA[IMML]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Plugins]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[stock market]]></category>
		<category><![CDATA[Yahoo]]></category>

	<!-- AutoMeta Start -->
	<category>define</category>
	<category>tooltip</category>
	<category>tooltipid</category>
	<category>tooltipplugin</category>
	<category>lines</category>
	<category>settext</category>
	<category>lasttradeprim</category>
	<category>mouse</category>
	<!-- AutoMeta End -->
	
		<guid isPermaLink="false">http://theparkisvast.com/?p=208</guid>
		<description><![CDATA[I&#8217;ve made some adjustments to the stock ticker built as part of my building a stock ticker in vastpark post to take advantage of the new Tooltip Plugin and the Define element in IMML. Rather than going all out, I&#8217;ve simply added a tip that shows the volume for the current day when the mouse [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve made some adjustments to the stock ticker built as part of my <a href="http://theparkisvast.com/2009/01/12/building-a-stock-market-ticker-in-vastpark/">building a stock ticker in vastpark post</a> to take advantage of the new Tooltip Plugin and the Define element in IMML. Rather than going all out, I&#8217;ve simply added a tip that shows the volume for the current day when the mouse is over one of the green bars and a Define that lets you more easily choose which stocks should be displayed.</p>
<p>If you haven&#8217;t already read the original article and are interested in how it works, be sure to <a href="http://theparkisvast.com/2009/01/12/building-a-stock-market-ticker-in-vastpark/">have a read</a> before continuing.</p>
<h4>Define Element</h4>
<p>The Define element is a declarative way of expressing a variable in IMML. It&#8217;s equivalent to doing element:set(&#8216;variableName&#8217;, variableValue) but doesn&#8217;t require interpretation via the scripting engine which results in much better performance. It&#8217;s also a much nicer way to store global variables as they can be placed in more a easily identifiable location in the IMML rather than being buried within a script.</p>
<p>My Define in the sample looks similar to this (truncated for brevity):<br />
<pre class="php">&lt;!--Use any Yahoo stock codes in the below <a href="http://www.php.net/define"><span style="color: #000066;">define</span></a> to control the stocks being generated and updated--&gt;
 &lt;Define <a href="http://www.php.net/key"><span style="color: #000066;">Key</span></a>=<span style="color: #ff0000;">&quot;stocks&quot;</span> Value=<span style="color: #ff0000;">&quot;IPL.AX,VIL.AX,FMG.AX,RIO.AX,BHP.AX,BOQ.AX&quot;</span> /&gt;</pre></p>
<p>To change the ticker to show different stocks, replace any of the entries in the Value of the Define with the appropriate <a href="http://finance.yahoo.com/lookup">Yahoo ticker code</a> for the relevant stock.</p>
<h4>Tooltip Plugin</h4>
<p>Note: To use the Tooltip plugin, you&#8217;ll need to be running either the most recent Player snapshot or version 0.98+ as it uses the <em>Handle</em> property that was added recently to the IRenderEngine interface. </p>
<p>The tooltip concept has been around for quite a while and is used by just about every modern desktop application. Ever wondered what that big red button does and hovered your mouse to find out? If yes, you&#8217;ve seen a tooltip. This plugin extends the concept to allow developers to associate a tip with an element in world. </p>
<p>To do so is quite simple, the following functions are provided with the plugin:<br />
<pre class="php">int Add<span style="color: #66cc66;">&#40;</span>string text, ImmlElement element<span style="color: #66cc66;">&#41;</span>
void Remove<span style="color: #66cc66;">&#40;</span>int id<span style="color: #66cc66;">&#41;</span>
void SetText<span style="color: #66cc66;">&#40;</span>int id, string text<span style="color: #66cc66;">&#41;</span></pre></p>
<p>To make use of these, I&#8217;ve added 2 lines to <em>_updateStock</em> in the UpdateStocks script:<br />
<pre class="php">--update the volume tooltip	
id = lastTradeVisual:get<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'tooltipId'</span><span style="color: #66cc66;">&#41;</span>
tooltipplugin:settext<span style="color: #66cc66;">&#40;</span>id, <span style="color: #ff0000;">'Volume: '</span>..volume<span style="color: #66cc66;">&#41;</span></pre></p>
<p>&#8230;and 3 lines to <em>_generateStock</em> in the GenerateStocks script:<br />
<pre class="php">--store a <a href="http://www.php.net/define"><span style="color: #000066;">define</span></a> value on the last trade to represent volume <span style="color: #b1b100;">for</span> the tooltip
lastTradePrim:set<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'volume'</span>, volume<span style="color: #66cc66;">&#41;</span>
id = tooltipplugin:add<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'Volume: '</span>..volume, lastTradePrim<span style="color: #66cc66;">&#41;</span>
lastTradePrim:set<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'tooltipId'</span>, id<span style="color: #66cc66;">&#41;</span></pre></p>
<p>The end result still looks similar to before, but we now get tooltips when hovering:</p>
<p><a href="http://theparkisvast.com/wp-content/uploads/2010/02/stock-ticker-with-tooltip.jpg" rel="lightbox"><img src="http://theparkisvast.com/wp-content/uploads/2010/02/stock-ticker-with-tooltip-300x162.jpg" alt="" title="stock-ticker-with-tooltip" width="300" height="162" class="aligncenter size-medium wp-image-210" /></a></p>
<p>Download the updated IMML here:  <a href="http://theparkisvast.com/wp-content/plugins/download-monitor/download.php?id=6">stock-ticker.imml</a></p>
]]></content:encoded>
			<wfw:commentRss>http://theparkisvast.com/2010/02/17/updated-imml-for-stock-market-ticker/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Dem bones, dem bones, dem&#8230;digital bones</title>
		<link>http://theparkisvast.com/2009/09/01/scriptable-bones-in-vastpark/</link>
		<comments>http://theparkisvast.com/2009/09/01/scriptable-bones-in-vastpark/#comments</comments>
		<pubDate>Mon, 31 Aug 2009 22:35:00 +0000</pubDate>
		<dc:creator>craigomatic</dc:creator>
		<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/theparki/public_html/wp-content/plugins/autometa/autometa.php</b> on line <b>300</b><br />
		<category><![CDATA[Content]]></category>
		<category><![CDATA[Misc]]></category>
		<category><![CDATA[Plugins]]></category>
		<category><![CDATA[Scripting]]></category>

	<!-- AutoMeta Start -->
	<!-- AutoMeta End -->
	
		<guid isPermaLink="false">http://theparkisvast.com/?p=129</guid>
		<description><![CDATA[The creative department have been craving bones for a very long time in VastPark and we&#8217;ve finally added support for them, both in scripting and via plugin. Here&#8217;s a teaser: Vastpark Facial Expressions Demo from VastPark on Vimeo.]]></description>
			<content:encoded><![CDATA[<p>The creative department have been craving bones for a very long time in VastPark and we&#8217;ve finally added support for them, both in scripting and via plugin.</p>
<p>Here&#8217;s a teaser:</p>
<p><object width="400" height="225"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=6175536&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" /><embed src="http://vimeo.com/moogaloop.swf?clip_id=6175536&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="400" height="225"></embed></object>
<p><a href="http://vimeo.com/6175536">Vastpark Facial Expressions Demo</a> from <a href="http://vimeo.com/vastpark">VastPark</a> on <a href="http://vimeo.com">Vimeo</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://theparkisvast.com/2009/09/01/scriptable-bones-in-vastpark/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>VastPark VNC Plugin</title>
		<link>http://theparkisvast.com/2009/04/08/vastpark-vnc-plugin/</link>
		<comments>http://theparkisvast.com/2009/04/08/vastpark-vnc-plugin/#comments</comments>
		<pubDate>Wed, 08 Apr 2009 04:38:56 +0000</pubDate>
		<dc:creator>craigomatic</dc:creator>
		<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/theparki/public_html/wp-content/plugins/autometa/autometa.php</b> on line <b>300</b><br />
		<category><![CDATA[IMML]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Plugins]]></category>

	<!-- AutoMeta Start -->
	<!-- AutoMeta End -->
	
		<guid isPermaLink="false">http://theparkisvast.com/?p=99</guid>
		<description><![CDATA[After some recent improvements to the core VastPark framework and the way textures are made available to the plugin API, I decided to build a VNC plugin for VastPark, basing it upon VncSharp. For those of you know don&#8217;t know what VNC is, there&#8217;s a good overview of it available on Wikipedia. In it&#8217;s simplest [...]]]></description>
			<content:encoded><![CDATA[<p>After some recent improvements to the core VastPark framework and the way textures are made available to the plugin API, I decided to build a VNC plugin for VastPark, basing it upon <a href="http://cdot.senecac.on.ca/projects/vncsharp/">VncSharp</a>. For those of you know don&#8217;t know what VNC is, there&#8217;s a good overview of it available on <a href="http://en.wikipedia.org/wiki/Vnc">Wikipedia</a>.</p>
<p>In it&#8217;s simplest form the IMML for the VNC Plugin will look something like this:<br />
<pre class="php">&lt;Plugin Name=<span style="color: #ff0000;">&quot;VncPlugin&quot;</span> Enabled=<span style="color: #ff0000;">&quot;True&quot;</span> 
Source=<span style="color: #ff0000;">&quot;http://content.vastpark.com/VastParkWS/get.vpws?publisher=craigomatic&amp;amp;name=VncPlugin&amp;amp;domain=vastpark&amp;amp;context=park&quot;</span>&gt;
	&lt;Element Name=<span style="color: #ff0000;">&quot;TargetElement&quot;</span>/&gt;
	&lt;Element Name=<span style="color: #ff0000;">&quot;OnPasswordRequired&quot;</span>/&gt;
	&lt;Parameter <a href="http://www.php.net/key"><span style="color: #000066;">Key</span></a>=<span style="color: #ff0000;">&quot;Uri&quot;</span> Value=<span style="color: #ff0000;">&quot;the-vnc-server-address.com&quot;</span>/&gt;
	&lt;Parameter <a href="http://www.php.net/key"><span style="color: #000066;">Key</span></a>=<span style="color: #ff0000;">&quot;Port&quot;</span> Value=<span style="color: #ff0000;">&quot;5900&quot;</span>/&gt;
 	&lt;Parameter <a href="http://www.php.net/key"><span style="color: #000066;">Key</span></a>=<span style="color: #ff0000;">&quot;PasswordRequired&quot;</span> Value=<span style="color: #ff0000;">&quot;OnPasswordRequired&quot;</span>/&gt;
&lt;/Plugin&gt;
&lt;Script Name=<span style="color: #ff0000;">&quot;OnPasswordRequired&quot;</span>&gt;
    <span style="color: #000000; font-weight: bold;">function</span> main<span style="color: #66cc66;">&#40;</span>obj, args<span style="color: #66cc66;">&#41;</span>
        vncplugin:setpassword<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'pass'</span><span style="color: #66cc66;">&#41;</span> --hardcoding password is bad, you should ask the user to enter one!
    <a href="http://www.php.net/end"><span style="color: #000066;">end</span></a>
<span style="color: #000000; font-weight: bold;">&lt;/Script&gt;</span>
&lt;Primitive Type=<span style="color: #ff0000;">&quot;Box&quot;</span> Name=<span style="color: #ff0000;">&quot;TargetElement&quot;</span> Size=<span style="color: #ff0000;">&quot;1,1,1&quot;</span>/&gt;</pre> </p>
<p>Here&#8217;s one I prepared earlier (well, Adrian did most of the work&#8230;):</p>
<p><a href="http://theparkisvast.com/wp-content/uploads/2009/04/vncplugin-in-action.jpg" rel="lightbox"><img src="http://theparkisvast.com/wp-content/uploads/2009/04/vncplugin-in-action-300x148.jpg" alt="vncplugin-in-action" title="vncplugin-in-action" width="300" height="148" class="alignnone size-medium wp-image-103" /></a></p>
<h4>Plugin Parameters</h4>
<h5>Uri</h5>
<p>The host address of the VNC server. You should avoid using the scheme at the start of this address (ie: <strong>don&#8217;t</strong> put the <em>http://</em>)</p>
<h5>Port</h5>
<p>Defaults to the VNC default of 5900</p>
<h5>ConnectionFailed</h5>
<p>Name of a Script/Timeline/other ITimelineExecutable element to execute when a VNC connection has failed</p>
<h5>PasswordRequired</h5>
<p>Name of a Script/Timeline/other ITimelineExecutable element to execute when a password is required to connect to the VNC server</p>
<h5>UpdateFrequency</h5>
<p>The number of milliseconds to wait before automatically refreshing the remote screen when ManualUpdate is false. Defaults to 500.</p>
<h5>ManualUpdate</h5>
<p>True/False. When true, you need to call the vncplugin:requestupdate(true) for a fullscreen update. Defaults to False</p>
<p>You can download an example IMML document here: <a href="http://theparkisvast.com/wp-content/plugins/download-monitor/download.php?id=4">basic-vnc.imml</a> and view the source code for the VNC Plugin over here: <a href="http://vastpark-svn.cvsdude.com/public/trunk/Plugins/Plugin.VNC/">http://vastpark-svn.cvsdude.com/public/trunk/Plugins/Plugin.VNC/</a></p>
<p>A good free windows VNC Server is <a href="http://www.tightvnc.com/">TightVNC</a></p>
]]></content:encoded>
			<wfw:commentRss>http://theparkisvast.com/2009/04/08/vastpark-vnc-plugin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

