
<?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>Knospi.com</title>
	<atom:link href="http://www.knospi.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.knospi.com</link>
	<description>Have A Happy Life</description>
	<lastBuildDate>Wed, 18 Jan 2012 05:46:01 +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>VLC-Shares installation guide with NginX</title>
		<link>http://www.knospi.com/2012/vlc-shares-installation-guide-on-nginx/</link>
		<comments>http://www.knospi.com/2012/vlc-shares-installation-guide-on-nginx/#comments</comments>
		<pubDate>Tue, 17 Jan 2012 11:29:58 +0000</pubDate>
		<dc:creator>Knospi</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[3.2]]></category>
		<category><![CDATA[air playit]]></category>
		<category><![CDATA[air video]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[emit]]></category>
		<category><![CDATA[high quality]]></category>
		<category><![CDATA[hints]]></category>
		<category><![CDATA[honeycomb]]></category>
		<category><![CDATA[media]]></category>
		<category><![CDATA[nginx]]></category>
		<category><![CDATA[player]]></category>
		<category><![CDATA[plex]]></category>
		<category><![CDATA[shares]]></category>
		<category><![CDATA[squeeze]]></category>
		<category><![CDATA[streaming]]></category>
		<category><![CDATA[vlc]]></category>
		<category><![CDATA[vlc shares]]></category>

		<guid isPermaLink="false">http://www.knospi.com/?p=448</guid>
		<description><![CDATA[VLC-Shares is a nice way to stream your media from a centralized server to your mobile and desktop devices. But the setup might turn out to be quite tricky. Here is a guide how you can setup your VLC-Shares with &#8230;<p class="read-more"><a href="http://www.knospi.com/2012/vlc-shares-installation-guide-on-nginx/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p>VLC-Shares is a nice way to stream your media from a centralized server to your mobile and desktop devices. But the setup might turn out to be quite tricky. Here is a guide how you can setup your VLC-Shares with the already very famous Webserver <a href="http://wiki.nginx.org/Main">NginX</a>.<span id="more-448"></span></p>
	<ul id="slideshow" style="display:none;">
									<li>
					<h3>VLC-Shares Browsing Interface</h3>
										<span>http://www.knospi.com/wp-content/uploads/2012/01/vlc-shares-main.png</span>
					<p>VLC-Shares Browsing Interface</p>
																<a href="http://www.knospi.com/wp-content/uploads/2012/01/vlc-shares-main.png" title="VLC-Shares Browsing Interface"></a>
									</li>
							<li>
					<h3>VLC Streaming in action</h3>
										<span>http://www.knospi.com/wp-content/uploads/2012/01/vlc-screenshot2.png</span>
					<p></p>
																<a href="http://www.knospi.com/wp-content/uploads/2012/01/vlc-screenshot2.png" title="VLC Streaming in action"></a>
									</li>
							<li>
					<h3>VLC Streaming in action 2</h3>
										<span>http://www.knospi.com/wp-content/uploads/2012/01/vlc-screenshot1.png</span>
					<p></p>
																<a href="http://www.knospi.com/wp-content/uploads/2012/01/vlc-screenshot1.png" title="VLC Streaming in action 2"></a>
									</li>
						</ul>
	
	<div id="slideshow-wrapper">
			
		<div id="fullsize">
			<div id="imgprev" class="imgnav" title="Previous Image"></div>
			<div id="imglink"><!-- link --></div>
			<div id="imgnext" class="imgnav" title="Next Image"></div>
			<div id="image"></div>
							<div id="information">
					<h3></h3>
					<p></p>
				</div>
					</div>
		
			</div>
	
	<script type="text/javascript">
	jQuery.noConflict();
	tid('slideshow').style.display = "none";
	tid('slideshow-wrapper').style.display = 'block';
	tid('slideshow-wrapper').style.visibility = 'hidden';	


	/**
	 * issue #2: Bugfix for WebKit. Safari and similar browsers aren't capable to handle jQuery.ready() right. The problem
	 * here was, that sometimes the event was fired (if js is not available in browsers cache) too early, so that not all
	 * pictures were displayed in the thumbnail bar. I added a timeout to give the browser time to load the pictures.
	 * During that time I found it nice to display a spinner icon to give the visitor a hint that "somethings going on there".
	 * For this to display correctly I've added some lines to the css file too.
	 */

	// append the spinner
	jQuery("#fullsize").append('<div id="spinner"><img src="http://www.knospi.com/wp-content/plugins/slideshow-gallery/images/spinner.gif"></div>');
	tid('spinner').style.visibility = 'visible';

	var slideshow = new TINY.slideshow("slideshow");
	jQuery(document).ready(function() {
		// set a timeout before launching the slideshow
		window.setTimeout(function() {
			slideshow.auto = true;			slideshow.speed = 10;
			slideshow.imgSpeed = 5;
			slideshow.navOpacity = 25;
			slideshow.navHover = 70;
			slideshow.letterbox = "#000000";
			slideshow.linkclass = "linkhover";
			slideshow.info = "information";
			slideshow.infoSpeed = 10;
			slideshow.thumbs = "";
			slideshow.thumbOpacity = 70;
			slideshow.left = "slideleft";
			slideshow.right = "slideright";
			slideshow.scrollSpeed = 5;
			slideshow.spacing = 5;
			slideshow.active = "#FFFFFF";
			slideshow.imagesthickbox = "false";
			jQuery("#spinner").remove();
			slideshow.init("slideshow","image","imgprev","imgnext","imglink");
			tid('slideshow-wrapper').style.visibility = 'visible';
		}, 1000);
	});
	</script>

<p>&nbsp;</p>
<h2>Why VLC-Shares and related work</h2>
<p>My idea to consume media on my mobile devices is the following; I&#8217;d like to have a central point where all the media is stored. This point should be accessible from everywhere, so it needs to be on the internet. This point of media access should provide some kind of graphical user interface to browse the collection and to start the media player from it. The media should be live re-encoded so it could adapt to different connection speeds.</p>
<div id="attachment_449" class="wp-caption aligncenter" style="width: 310px"><img class="size-medium wp-image-449  " title="Ideal setup of a media server" src="http://www.knospi.com/wp-content/uploads/2012/01/media_consumption-300x236.png" alt="Graphical representation of an ideal setup of a media server" width="300" height="236" /><p class="wp-caption-text">Ideal setup of a media server</p></div>
<p>There exist some application which let you exactly do that. But my quality requirements are pretty high. The software titles I investigated were</p>
<ul>
<li>Air Video</li>
<li>Air PlayIt</li>
<li>Emit</li>
<li>VLC-Shares</li>
<li>&#8230;</li>
</ul>
<p>My personal favorite of this list is <a href="http://www.inmethod.com/air-video/index.html">Air Video</a>. Thats because of it&#8217;s performance, perfect configurability (not too much and not too less) and robustness. The only thing missing in this masterpiece is a linux server. So if you guys from Air Video are reading this, please consider making us happy!</p>
<p>I used it for a long time until i bought myself an Archos 80 g9 Turbo which comes with Android and Air Video has only a client application for iOS devices and an unofficial application for Mac OSX. I have to state at this point, that there is an Android application called <a href="http://www.appbrain.com/app/mirage-beta/com.bw.xplayer.ui">Mirage</a> Player which can communicate with Air Video Servers, but it can not (yet) request a live conversion of the video.</p>
<p>So i had to search for an alternative. If Air Video builds an Android version it&#8217;s very certain i might switch back to it. But in the meantime I stick to VLC-Shares. It has a very high configurability, more than one might wish. But it exactly gives me what I want, except a nice integration of a player, maybe directly in the VLC-Shares website.</p>
<p>On my Archos I had to install a special streaming media Player. A drawback of the VLC-Shares is that it&#8217;s not possible to jump forward, backwards or pause the video from within the player, this needs to be done in the Webinterface.</p>
<p>The installation of VLC-Shares can be tricky. That&#8217;s why i want to show you guys how to install it on a Linux Debian Squeeze box with NginX.</p>
<h2>Install required packages</h2>
<p>First we need to get some packages installed on our machine:</p>
<pre class="brush:shell">sudo apt-get install apache2 libapache2-mod-php5 php5 zendframework zendframework-bin vlc php5-sqlite php5-cli vlc ffmpeg</pre>
<p>You should have NginX already installed and configured with PHP-FastCGI. If not do that now and come back later.</p>
<h2>Download VLC-Shares</h2>
<p>Grab a current version of VLC-Shares from their Website at <a title="VLC-Shares on Google Code" href="http://code.google.com/p/vlc-shares/downloads/list" target="_blank">VLC-Shares at Google Code</a>. Extract it to a subdirectory of your www directory. In this tutorial I assume that the directory for all the websites resides at /www/ and you run virtual name based websites.<br />
Extract the directory so that the path to the <em>public/</em> subdirectory looks like that: /www/shares/vlc-shares/public. /www/shares/ will be the root of your VLC-Shares site. Now set the correct owner and permissions:</p>
<pre class="brush:shell">sudo chown -R www-data.www-data /www/shares/
sudo chmod -R 770 /www/shares/
sudo chmod -R 777 /www/shares/vlc-shares/data</pre>
<h2>Setup NginX</h2>
<p>Now that everything is in place we can tell NginX to serve VLC-Shares. For that make a new entry in your /etc/nginx/sites-available/ directory of NginX and put the following contents to it:<br />
(Don&#8217;t forget to adapt it for your liking and change the server name).</p>
<pre class="brush:shell">server {
	listen 		80;
	server_name 	shares.example.com;
	access_log 	/www/shares/access.log;
	error_log 	/www/shares/error.log;
	root /www/shares/;

	location / {
		index index.php;
	}

	if (!-e $request_filename) {
		rewrite ^(.*)$ /vlc-shares/public/index.php last;
	}

	location ~ \.php$ {
		include /etc/nginx/fastcgi_params;
		fastcgi_pass 127.0.0.1:9000;
		fastcgi_index index.php;
		fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
	}
}</pre>
<p>Now enable the configuration with</p>
<pre class="brush:shell">cd /etc/nginx/sites-enabled
sudo ln -s ../sites-available/shares</pre>
<p>restart your NginX</p>
<pre class="brush:shell">service nginx restart</pre>
<p>and navigate to your VLC-Shares installation at</p>
<pre class="brush:shell">http://shares.your_hostname.tld/vlc-shares/public</pre>
<p>and complete the installtion by filling out the settings on that webpage.</p>
<h2>Setup Android Device</h2>
<p>There are several streaming players for Android devices. On my Archos 80 G9 comes a very neat player. But of all the players i tried i found that <a href="https://market.android.com/details?id=com.daroonsoft.player&amp;hl=en">Daroon</a> Player gets the job done with VLC the best.<br />
So download this nifty player and add your host with the adress</p>
<pre class="brush:shell">http://example.com:8081</pre>
<p>to the favorites. When you start a stream in VLC Shares be sure to select HQ preset of video quality and the &#8220;Http Stream on 8081&#8243; option, see image below.</p>
<div id="attachment_456" class="wp-caption aligncenter" style="width: 230px"><a href="http://www.knospi.com/wp-content/uploads/2012/01/vlc-settigns.png"><img class="size-full wp-image-456 " title="vlc-settigns" src="http://www.knospi.com/wp-content/uploads/2012/01/vlc-settigns.png" alt="vlc streaming options" width="220" height="263" /></a><p class="wp-caption-text">VLC Streaming options</p></div>
<p>So get started with your first stream and enjoy. Note that you need to start the stream first in the web interface and then access it with your media player.</p>
<p>Hopefully I could help you guys getting your VLC-Shares to run. If you have any questions or remarks leave them in the comments below and i will give my best to help you out.</p>
<h2>Hints</h2>
<ul>
<li>If you have a firewall installed be sure to open the port 8081.</li>
<li>I spent a long time messing around with the VLC-Shares application to get it to run. The main issue was that the public folder needs to be a subfolder of the &#8220;vlc-shares&#8221; directory on your public webfolder, that means the root of your website points into the directory where the &#8220;vlc-shares&#8221; directory lies, see <a href="#public_url">here</a>.</li>
<li>After i managed to get to the installtion interface of VLC-Shares, i wasn&#8217;t able to submit the form. Everytime on submission an error occured which stated &#8220;Invalid value&#8221;. I had to work around this by setting up the application with the Apache 2 webserver, completing the Setup on the installation page, and then removing the Apache 2 webserver and enabling NginX again.</li>
<li>Sometimes the VLC player crashes and no new instance can be created, a simple &#8220;sudo killall vlc&#8221; in the console fixes this.</li>
</ul>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.knospi.com/2012/vlc-shares-installation-guide-on-nginx/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sara trying a new coat</title>
		<link>http://www.knospi.com/2011/sara-trying-a-new-coat/</link>
		<comments>http://www.knospi.com/2011/sara-trying-a-new-coat/#comments</comments>
		<pubDate>Sun, 23 Oct 2011 16:23:35 +0000</pubDate>
		<dc:creator>Knospi</dc:creator>
				<category><![CDATA[Sonstiges]]></category>

		<guid isPermaLink="false">http://www.knospi.com/?p=404</guid>
		<description><![CDATA[   ]]></description>
			<content:encoded><![CDATA[<p> </p>
<p><div id="attachment_405" class="wp-caption aligncenter" style="width: 235px"><a href="http://www.knospi.com/wp-content/uploads/2011/10/katzi_coat.png"><img class="size-medium wp-image-405" title="Sara trying a new Coat" src="http://www.knospi.com/wp-content/uploads/2011/10/katzi_coat-225x300.png" alt="" width="225" height="300" /></a><p class="wp-caption-text">Sara trying a new Coat</p></div>
<p> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.knospi.com/2011/sara-trying-a-new-coat/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Chronos Wrist Watch</title>
		<link>http://www.knospi.com/2010/381/</link>
		<comments>http://www.knospi.com/2010/381/#comments</comments>
		<pubDate>Wed, 22 Dec 2010 22:29:29 +0000</pubDate>
		<dc:creator>Knospi</dc:creator>
				<category><![CDATA[3D]]></category>

		<guid isPermaLink="false">http://www.knospi.com/?p=381</guid>
		<description><![CDATA[This is the first watch i modeled. Made in Blender and rendered in Luxrender.Finished in Photoshop 4. The symbol used in the Logo and on the clockface is a Letter of the Zibu Language taken from www.languageofzibu.com. Modeling Time: ~20 hoursRendering &#8230;<p class="read-more"><a href="http://www.knospi.com/2010/381/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p>This is the first watch i modeled. Made in Blender and rendered in Luxrender.<br />Finished in Photoshop 4.</p>
<p>The symbol used in the Logo and on the clockface is a Letter of the Zibu Language taken from <a href="http://www.languageofzibu.com/">www.languageofzibu.com</a>.</p>

<a href="http://www.knospi.com/wp-content/gallery/wallpapers/chronos.jpg" title="Blender &amp; Luxrender" class="shutterset_singlepic202" >
	<img class="ngg-singlepic" src="http://www.knospi.com/wp-content/gallery/cache/202__320x240_chronos.jpg" alt="Chronos Wrist Watch" title="Chronos Wrist Watch" />
</a>

<p><span id="more-381"></span></p>
<p>Modeling Time: ~20 hours<br />Rendering Detail: Bidirectional Path Tracing, Metropolis Sampler, Mitchell Integrator, Light-Portal right in Front of the Watch, Area Light.</p>
<p> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.knospi.com/2010/381/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MouseLook in Blender 2.55 for Blender Game Engine</title>
		<link>http://www.knospi.com/2010/mouselook-in-blender-2-55-for-blender-game-engine/</link>
		<comments>http://www.knospi.com/2010/mouselook-in-blender-2-55-for-blender-game-engine/#comments</comments>
		<pubDate>Sat, 20 Nov 2010 15:55:09 +0000</pubDate>
		<dc:creator>Knospi</dc:creator>
				<category><![CDATA[3D]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[1st Person Mouse Look]]></category>
		<category><![CDATA[2.55]]></category>
		<category><![CDATA[blender]]></category>
		<category><![CDATA[Blender Game Engine]]></category>
		<category><![CDATA[download]]></category>

		<guid isPermaLink="false">http://www.knospi.com/?p=369</guid>
		<description><![CDATA[I was just trying to get the Mouselook Script running in Blender 2.55. I ran into some problems. Indentation of Python Blocks Mathutils is now called mathutils AngleBetweenVecs or so is not any more etc. You canDownload the updated &#38; &#8230;<p class="read-more"><a href="http://www.knospi.com/2010/mouselook-in-blender-2-55-for-blender-game-engine/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p>I was just trying to get the Mouselook Script running in Blender 2.55. I ran into some problems.</p>
<ul>
<li>Indentation of Python Blocks</li>
<li>Mathutils is now called mathutils</li>
<li>AngleBetweenVecs or so is not any more</li>
<li>etc.</li>
</ul>
<p>You canDownload the <strong>updated &amp; running Version here</strong>: <a href="http://www.knospi.com/files/MouseLook.py.zip">MouseLook.py.zip</a></p>
<p><span id="more-369"></span>or Copy and Paste it right into your Blender:</p>
<p> </p>
<pre class="brush:py">######################################################
#
# MouseLook.py Blender 2.54 by Yorn Callens
#
#   Adapted by ProperVandal from 2.49 source at tutorialsforblender3d.com
#
#   Changed by Knospi (www.knospi.com) to run in Blender 2.55 ( 20.Nov 2010 )
#
# Released under the Creative Commons Attribution 3.0 Unported License.
#
# If you use this code, please include this information header.
#
######################################################

import bge
import mathutils

# define main program
def main():

# set default values
    Sensitivity = 0.0005
    Invert = 1
    Capped = False

    # get controller
    controller = bge.logic.getCurrentController()

    # get the object this script is attached to
    obj = controller.owner

    # get the size of the game screen
    gameScreen = gameWindow()

    # get mouse movement
    move = mouseMove(gameScreen, controller, obj)

    # change mouse sensitivity?
    sensitivity = mouseSen(Sensitivity, obj)

    # invert mouse pitch?
    invert = mousePitch(Invert, obj)

    # upDown mouse capped?
    capped = mouseCap(Capped, move, invert, obj)

    # use mouse look
    useMouseLook(controller, capped, move, invert, sensitivity)

    # Center mouse in game window
    centerCursor(controller, gameScreen)

#####################################################

# define game window
def gameWindow():

    # get width and height of game window
    width = bge.render.getWindowWidth()
    height = bge.render.getWindowHeight()

    return (width, height)

#######################################################

# define mouse movement function
def mouseMove(gameScreen, controller, obj):

    # Get sensor named MouseLook
    mouse = controller.sensors["MouseLook"]

    # extract width and height from gameScreen
    width = gameScreen[0]
    height = gameScreen[1]

    # distance moved from screen center
    x = width/2 - mouse.position[0]
    y = height/2 - mouse.position[1]

    # initialize mouse so it doesn't jerk first time
    if 'mouseInit' in obj == False:
        obj['mouseInit'] = True
        x = 0
        y = 0

    #########   stops drifting on mac osx

    # if sensor is deactivated don't move
    if not mouse.positive:
        x = 0
        y = 0

    ######### -- mac fix contributed by Pelle Johnsen

    # return mouse movement
    return (x, y)

######################################################

# define Mouse Sensitivity
def mouseSen(sensitivity, obj):

    # check so see if property named Adjust was added
    if 'Adjust' in obj == True:

    # Don't want Negative values
        if obj['Adjust'] &lt; 0.0:
            obj['Adjust'] = 0.0

    # adjust the sensitivity
        sensitivity = obj['Adjust'] * sensitivity

    # return sensitivity
    return sensitivity

#########################################################

# define Invert mouse pitch
def mousePitch(invert, obj):

    # check to see if property named Invert was added
    if 'Invert' in obj == True:

    # pitch to be inverted?
        if obj['Invert'] == True:
            invert = -1
        else:
           invert = 1

    # return mouse pitch
    return invert

#####################################################

# define Cap vertical mouselook
def mouseCap(capped, move, invert, obj):

    # check to see if property named Cap was added
    if 'Cap' in obj == True:    

    # import mathutils
     #   import Mathutils

    # limit cap to 0 - 180 degrees
        if obj['Cap'] &gt; 180:
            obj['Cap'] = 180
        if obj['Cap'] &lt; 0:
            obj['Cap'] = 0

        # get the orientation of the camera to world axis
        camOrient = obj.orientation

        # get camera Z axis vector
        camZ = [camOrient[0][2], camOrient[1][2], camOrient[2][2]]

        # create camera z axis vector
        vec1 = mathutils.Vector(camZ)

        # get camera parent
        camParent = obj.parent

        # get parent orientation to world axis
        parentOrient = camParent.orientation

        # get parent z axis vector
        parentZ = [parentOrient[0][2], parentOrient[1][2], parentOrient[2][2]]

        # create parent z axis vector
        vec2 = mathutils.Vector(parentZ)

        # find angle between two
        angle = vec1.angle(vec2)

        # get amount to limit mouselook
        capAngle = obj['Cap']

        # get mouse up down movement
        moveY = move[1] * invert

        # check capped angle against against camera z-axis and mouse y movement
        if (angle &gt; (90 + capAngle/2) and moveY &gt; 0) or (angle &lt; (90 - capAngle/2) and moveY &lt; 0) == True:

        # no movement
            capped = True

    # return capped
    return capped

###############################################

# define useMouseLook
def useMouseLook(controller, capped, move, invert, sensitivity):

    # get up/down movement
    if capped == True:
       upDown = 0
    else:
        upDown = move[1] * sensitivity * invert 

    # get left/right movement
    leftRight = move[0] * sensitivity * invert 

    # Get the actuators
    act_LeftRight = controller.actuators["LeftRight"]
    act_UpDown = controller.actuators["UpDown"] 

    # set the values
    act_LeftRight.dRot = [ 0.0, 0.0, leftRight]
    act_LeftRight.useLocalDRot = False 

    act_UpDown.dRot = [ upDown, 0.0, 0.0]
    act_UpDown.useLocalDRot = True

    # Use the actuators
    controller.activate(act_LeftRight)
    controller.activate(act_UpDown) 

#############################################

# define center mouse cursor
def centerCursor(controller, gameScreen):

    # extract width and height from gameScreen
    width = gameScreen[0]
    height = gameScreen[1]

    # Get sensor named MouseLook
    mouse = controller.sensors["MouseLook"]

    # get cursor position
    pos = mouse.position

    # if cursor needs to be centered
    if pos != [ int(width/2), int(height/2)]:

    # Center mouse in game windowp
        bge.render.setMousePosition(int(width/2), int(height/2))

    # already centered. Turn off actuators
    else:
    # Get the actuators
        act_LeftRight = controller.actuators["LeftRight"]
        act_UpDown = controller.actuators["UpDown"] 

    # turn off the actuators
        controller.deactivate(act_LeftRight)
        controller.deactivate(act_UpDown) 

##############################################

# Run program
main()######################################################
#
# MouseLook.py Blender 2.54 by Yorn Callens
#
#   Adapted by ProperVandal from 2.49 source at tutorialsforblender3d.com
#
# Changed by Knospi to run in Blender 2.55
#
# Released under the Creative Commons Attribution 3.0 Unported License.
#
# If you use this code, please include this information header.
#
######################################################

import bge
import mathutils

# define main program
def main():

# set default values
    Sensitivity = 0.0005
    Invert = 1
    Capped = False

    # get controller
    controller = bge.logic.getCurrentController()

    # get the object this script is attached to
    obj = controller.owner

    # get the size of the game screen
    gameScreen = gameWindow()

    # get mouse movement
    move = mouseMove(gameScreen, controller, obj)

    # change mouse sensitivity?
    sensitivity = mouseSen(Sensitivity, obj)

    # invert mouse pitch?
    invert = mousePitch(Invert, obj)

    # upDown mouse capped?
    capped = mouseCap(Capped, move, invert, obj)

    # use mouse look
    useMouseLook(controller, capped, move, invert, sensitivity)

    # Center mouse in game window
    centerCursor(controller, gameScreen)

#####################################################

# define game window
def gameWindow():

    # get width and height of game window
    width = bge.render.getWindowWidth()
    height = bge.render.getWindowHeight()

    return (width, height)

#######################################################

# define mouse movement function
def mouseMove(gameScreen, controller, obj):

    # Get sensor named MouseLook
    mouse = controller.sensors["MouseLook"]

    # extract width and height from gameScreen
    width = gameScreen[0]
    height = gameScreen[1]

    # distance moved from screen center
    x = width/2 - mouse.position[0]
    y = height/2 - mouse.position[1]

    # initialize mouse so it doesn't jerk first time
    if 'mouseInit' in obj == False:
        obj['mouseInit'] = True
        x = 0
        y = 0

    #########   stops drifting on mac osx

    # if sensor is deactivated don't move
    if not mouse.positive:
        x = 0
        y = 0

    ######### -- mac fix contributed by Pelle Johnsen

    # return mouse movement
    return (x, y)

######################################################

# define Mouse Sensitivity
def mouseSen(sensitivity, obj):

    # check so see if property named Adjust was added
    if 'Adjust' in obj == True:

    # Don't want Negative values
        if obj['Adjust'] &lt; 0.0:
            obj['Adjust'] = 0.0

    # adjust the sensitivity
        sensitivity = obj['Adjust'] * sensitivity

    # return sensitivity
    return sensitivity

#########################################################

# define Invert mouse pitch
def mousePitch(invert, obj):

    # check to see if property named Invert was added
    if 'Invert' in obj == True:

    # pitch to be inverted?
        if obj['Invert'] == True:
            invert = -1
        else:
           invert = 1

    # return mouse pitch
    return invert

#####################################################

# define Cap vertical mouselook
def mouseCap(capped, move, invert, obj):

    # check to see if property named Cap was added
    if 'Cap' in obj == True:    

    # import mathutils
     #   import Mathutils

    # limit cap to 0 - 180 degrees
        if obj['Cap'] &gt; 180:
            obj['Cap'] = 180
        if obj['Cap'] &lt; 0:
            obj['Cap'] = 0

        # get the orientation of the camera to world axis
        camOrient = obj.orientation

        # get camera Z axis vector
        camZ = [camOrient[0][2], camOrient[1][2], camOrient[2][2]]

        # create camera z axis vector
        vec1 = mathutils.Vector(camZ)

        # get camera parent
        camParent = obj.parent

        # get parent orientation to world axis
        parentOrient = camParent.orientation

        # get parent z axis vector
        parentZ = [parentOrient[0][2], parentOrient[1][2], parentOrient[2][2]]

        # create parent z axis vector
        vec2 = mathutils.Vector(parentZ)

        # find angle between two
        angle = vec1.angle(vec2)

        # get amount to limit mouselook
        capAngle = obj['Cap']

        # get mouse up down movement
        moveY = move[1] * invert

        # check capped angle against against camera z-axis and mouse y movement
        if (angle &gt; (90 + capAngle/2) and moveY &gt; 0) or (angle &lt; (90 - capAngle/2) and moveY &lt; 0) == True:

        # no movement
            capped = True

    # return capped
    return capped

###############################################

# define useMouseLook
def useMouseLook(controller, capped, move, invert, sensitivity):

    # get up/down movement
    if capped == True:
       upDown = 0
    else:
        upDown = move[1] * sensitivity * invert 

    # get left/right movement
    leftRight = move[0] * sensitivity * invert 

    # Get the actuators
    act_LeftRight = controller.actuators["LeftRight"]
    act_UpDown = controller.actuators["UpDown"] 

    # set the values
    act_LeftRight.dRot = [ 0.0, 0.0, leftRight]
    act_LeftRight.useLocalDRot = False 

    act_UpDown.dRot = [ upDown, 0.0, 0.0]
    act_UpDown.useLocalDRot = True

    # Use the actuators
    controller.activate(act_LeftRight)
    controller.activate(act_UpDown) 

#############################################

# define center mouse cursor
def centerCursor(controller, gameScreen):

    # extract width and height from gameScreen
    width = gameScreen[0]
    height = gameScreen[1]

    # Get sensor named MouseLook
    mouse = controller.sensors["MouseLook"]

    # get cursor position
    pos = mouse.position

    # if cursor needs to be centered
    if pos != [ int(width/2), int(height/2)]:

    # Center mouse in game windowp
        bge.render.setMousePosition(int(width/2), int(height/2))

    # already centered. Turn off actuators
    else:
    # Get the actuators
        act_LeftRight = controller.actuators["LeftRight"]
        act_UpDown = controller.actuators["UpDown"] 

    # turn off the actuators
        controller.deactivate(act_LeftRight)
        controller.deactivate(act_UpDown) 

##############################################

# Run program
main()</pre>
<p> </p>
<p> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.knospi.com/2010/mouselook-in-blender-2-55-for-blender-game-engine/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Alien Data Cube Wallpaper</title>
		<link>http://www.knospi.com/2010/alien-data-cube-wallpaper/</link>
		<comments>http://www.knospi.com/2010/alien-data-cube-wallpaper/#comments</comments>
		<pubDate>Wed, 17 Nov 2010 14:55:46 +0000</pubDate>
		<dc:creator>Knospi</dc:creator>
				<category><![CDATA[3D]]></category>

		<guid isPermaLink="false">http://www.knospi.com/?p=364</guid>
		<description><![CDATA[Alien Datacube Wallpaper. Made with Blender, Luxrender. Thx to Macke who lends me his Server as a rendermachine. Free to Use.]]></description>
			<content:encoded><![CDATA[<p>Alien Datacube Wallpaper.</p>

<a href="http://www.knospi.com/wp-content/gallery/wallpapers/cubes-5.png" title="Luxrender, Blender. 2010 High Resolution Render." class="shutterset_singlepic200" >
	<img class="ngg-singlepic" src="http://www.knospi.com/wp-content/gallery/cache/200__320x240_cubes-5.png" alt="Alien Data Cubes" title="Alien Data Cubes" />
</a>

<p>Made with Blender, Luxrender. Thx to Macke who lends me his Server as a rendermachine.</p>
<p>Free to Use.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.knospi.com/2010/alien-data-cube-wallpaper/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Desara Kuchen</title>
		<link>http://www.knospi.com/2010/desara-kuchen/</link>
		<comments>http://www.knospi.com/2010/desara-kuchen/#comments</comments>
		<pubDate>Tue, 12 Oct 2010 20:39:15 +0000</pubDate>
		<dc:creator>Knospi</dc:creator>
				<category><![CDATA[Rezepte]]></category>
		<category><![CDATA[backen]]></category>
		<category><![CDATA[desara]]></category>
		<category><![CDATA[geheimtipp]]></category>
		<category><![CDATA[herrlich]]></category>
		<category><![CDATA[kuchen]]></category>
		<category><![CDATA[lecker]]></category>
		<category><![CDATA[neu]]></category>
		<category><![CDATA[selber]]></category>
		<category><![CDATA[torte]]></category>

		<guid isPermaLink="false">http://www.knospi.com/?p=352</guid>
		<description><![CDATA[Zutaten: 3 Eggs 1,5 Becher Zucker 2 Becher Mehl 1/4 Butter Kleinen Löffel Backpulver 3 Päckchen Vanillezucker Sahne Frischkäse Früchte nach Belieben 2-3 Löffel Buttermilch Zubereitung: Zuerst den Teig: Das weisse der Eier steif schlagen. Zucker zugeben und durchmixen. Eigelb &#8230;<p class="read-more"><a href="http://www.knospi.com/2010/desara-kuchen/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[
<a href="http://www.knospi.com/wp-content/gallery/sonstiges/desara-kuchen.jpg" title="" class="shutterset_singlepic199" >
	<img class="ngg-singlepic ngg-right" src="http://www.knospi.com/wp-content/gallery/cache/199__320x240_desara-kuchen.jpg" alt="desara-kuchen" title="desara-kuchen" />
</a>

<p><strong>Zutaten</strong>:</p>
<ul>
<li>3 Eggs</li>
<li>1,5 Becher Zucker</li>
<li>2 Becher Mehl</li>
<li>1/4 Butter</li>
<li>Kleinen Löffel Backpulver</li>
<li>3 Päckchen Vanillezucker</li>
<li>Sahne</li>
<li>Frischkäse</li>
<li>Früchte nach Belieben</li>
<li>2-3 Löffel Buttermilch</li>
</ul>
<p><strong>Zubereitung</strong>:</p>
<p><em>Zuerst den Teig: </em></p>
<ol>
<li>Das weisse der Eier steif schlagen. </li>
<li>Zucker zugeben und durchmixen.</li>
<li>Eigelb und Mehl, Backpulver, Buttermilch und geschmolzene Butter zugeben und durchmixen.</li>
<li>Im Ofen bei 200º goldbraun backen</li>
</ol>
<p><em>Dann die Creme:</em></p>
<ol>
<li>Sahne etwas mixen</li>
<li>Vanillezucker und Frischkäse zugeben, durchmixen</li>
</ol>
<p>Früchte in Scheibchen schneiden und auf den Teig legen. Creme darüberstreichen und fertig!</p>
<p>Guten Appetit!</p>
<p> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.knospi.com/2010/desara-kuchen/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Alien from Melonia</title>
		<link>http://www.knospi.com/2010/alien-from-melonia/</link>
		<comments>http://www.knospi.com/2010/alien-from-melonia/#comments</comments>
		<pubDate>Tue, 28 Sep 2010 14:19:28 +0000</pubDate>
		<dc:creator>Knospi</dc:creator>
				<category><![CDATA[3D]]></category>

		<guid isPermaLink="false">http://www.knospi.com/?p=347</guid>
		<description><![CDATA[My girlfriend made a small creature out of rubber-glue, the one you use for sticking posters to the wall. I really liked it, so i made a 3D Model and Textured it with the Melon Material from the Luxrender Materials &#8230;<p class="read-more"><a href="http://www.knospi.com/2010/alien-from-melonia/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p>My girlfriend made a small creature out of rubber-glue, the one you use for sticking posters to the wall. I really liked it, so i made a 3D Model and Textured it with the Melon Material from the Luxrender Materials Database.</p>

<a href="http://www.knospi.com/wp-content/gallery/wallpapers/alien_from_melonia.png" title="Alien from Melonia" class="shutterset_singlepic198" >
	<img class="ngg-singlepic" src="http://www.knospi.com/wp-content/gallery/cache/198__320x240_alien_from_melonia.png" alt="alien_from_melonia" title="alien_from_melonia" />
</a>

<p>Blender and Luxrender</p>
]]></content:encoded>
			<wfw:commentRss>http://www.knospi.com/2010/alien-from-melonia/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Roots of Mind</title>
		<link>http://www.knospi.com/2010/roots-of-mind/</link>
		<comments>http://www.knospi.com/2010/roots-of-mind/#comments</comments>
		<pubDate>Sat, 18 Sep 2010 10:32:31 +0000</pubDate>
		<dc:creator>Knospi</dc:creator>
				<category><![CDATA[3D]]></category>
		<category><![CDATA[3d]]></category>
		<category><![CDATA[blender]]></category>
		<category><![CDATA[gold]]></category>
		<category><![CDATA[luxrender]]></category>
		<category><![CDATA[orange]]></category>
		<category><![CDATA[quadcore]]></category>
		<category><![CDATA[rendering]]></category>
		<category><![CDATA[roots]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[wallpaper]]></category>

		<guid isPermaLink="false">http://www.knospi.com/?p=344</guid>
		<description><![CDATA[What are the roots of the humans?]]></description>
			<content:encoded><![CDATA[<p>What are the roots of the humans?</p>

<a href="http://www.knospi.com/wp-content/gallery/wallpapers/roots.png" title="Perspective can interfere with symmetry" class="shutterset_singlepic196" >
	<img class="ngg-singlepic" src="http://www.knospi.com/wp-content/gallery/cache/196__320x240_roots.png" alt="roots" title="roots" />
</a>

]]></content:encoded>
			<wfw:commentRss>http://www.knospi.com/2010/roots-of-mind/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Waschmaschinenparty</title>
		<link>http://www.knospi.com/2010/waschmaschinenparty/</link>
		<comments>http://www.knospi.com/2010/waschmaschinenparty/#comments</comments>
		<pubDate>Thu, 19 Aug 2010 12:24:47 +0000</pubDate>
		<dc:creator>Knospi</dc:creator>
				<category><![CDATA[Musik]]></category>

		<guid isPermaLink="false">http://www.knospi.com/?p=337</guid>
		<description><![CDATA[Am Montag dem 15. August 2010 fand im Gemeinschaftsraum des Studentendorfes Klagenfurt die Waschmaschinenparty statt. Im Zuge dieser Feier wurde vom Markus Benedikt und mir, ein Song aufgenommen. Angelehnt an &#8220;Kabinenparty&#8221; von Skero wurde ein Text erstellt und von Markus &#8230;<p class="read-more"><a href="http://www.knospi.com/2010/waschmaschinenparty/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p>Am Montag dem 15. August 2010 fand im Gemeinschaftsraum des Studentendorfes Klagenfurt die Waschmaschinenparty statt. Im Zuge dieser Feier wurde vom Markus Benedikt und mir, ein Song aufgenommen. Angelehnt an &#8220;Kabinenparty&#8221; von Skero wurde ein Text<span id="more-337"></span> erstellt und von Markus eingesungen. Mit Garageband allein wurde das Lied erstellt und editiert.</p>
<p>Ihr könnt euch den Song hier Downloaden: <a href="http://www.knospi.com/files/Waschmaschinenparty.mp3">Waschmaschinenparty.mp3</a></p>
<p><object style="width: 300px; height: 50px;" classid="clsid:02bf25d5-8c17-4b23-bc80-d3488abddc6b" width="300" height="50" codebase="http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0"><param name="src" value="http://www.knospi.com/files/Waschmaschinenparty.mp3" /><embed style="width: 300px; height: 50px;" type="video/quicktime" width="300" height="50" src="http://www.knospi.com/files/Waschmaschinenparty.mp3"></embed></object></p>
<p>Viel Spass beim hören</p>
<p>Beste Grüße,<br />
Knospi</p>
]]></content:encoded>
			<wfw:commentRss>http://www.knospi.com/2010/waschmaschinenparty/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
<enclosure url="http://www.knospi.com/files/Waschmaschinenparty.mp3" length="3978888" type="audio/mpeg" />
		</item>
		<item>
		<title>Matchmoving in Blender and Voodoo  &#8211; Cube on Desk</title>
		<link>http://www.knospi.com/2009/matchmoving-in-blender-and-voodoo-cube-on-desk/</link>
		<comments>http://www.knospi.com/2009/matchmoving-in-blender-and-voodoo-cube-on-desk/#comments</comments>
		<pubDate>Mon, 09 Nov 2009 13:51:24 +0000</pubDate>
		<dc:creator>Knospi</dc:creator>
				<category><![CDATA[Sonstiges]]></category>
		<category><![CDATA[animation]]></category>
		<category><![CDATA[augmented]]></category>
		<category><![CDATA[blender]]></category>
		<category><![CDATA[camera]]></category>
		<category><![CDATA[capturing]]></category>
		<category><![CDATA[cinematics]]></category>
		<category><![CDATA[cube]]></category>
		<category><![CDATA[desk]]></category>
		<category><![CDATA[effects]]></category>
		<category><![CDATA[match]]></category>
		<category><![CDATA[matchmoving]]></category>
		<category><![CDATA[motion]]></category>
		<category><![CDATA[moving]]></category>
		<category><![CDATA[reality]]></category>
		<category><![CDATA[special]]></category>
		<category><![CDATA[voodoo]]></category>

		<guid isPermaLink="false">http://www.knospi.com/?p=332</guid>
		<description><![CDATA[Followed this tutorial: http://fictionality.co.uk/doku.php?id=tutorials:matchmoving First used Blender to export video footage as tga to voodoo, tracked motion, imported back into blender. Then inserted 3d elements and enabled softbody. Finally shadow and reflection.]]></description>
			<content:encoded><![CDATA[<p><span>Followed this tutorial: </span><a href="http://fictionality.co.uk/doku.php?id=tutorials:matchmoving">http://fictionality.co.uk/doku.php?id=tutorials:matchmoving</a></p>
<p><span>First used Blender to export video footage as tga to voodoo, tracked motion, imported back into blender. Then inserted 3d elements and enabled softbody. Finally shadow and reflection.</span></p>
<p><span><br />
</span></p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="445" height="364" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/hb-QcgFcMhA&amp;hl=en&amp;fs=1&amp;rel=0&amp;border=1" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="445" height="364" src="http://www.youtube.com/v/hb-QcgFcMhA&amp;hl=en&amp;fs=1&amp;rel=0&amp;border=1" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://www.knospi.com/2009/matchmoving-in-blender-and-voodoo-cube-on-desk/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

