Ab in die Matrix!

Der Geist in der Maschine – so lautete der Titel des jüngsten Webmontag Frankfurt #wmfra , der am 13. Oktober in der Brotfabrik stattfand. Der Titel ist vielversprechend – lässt er doch an Künstliche Intelligenz, digitale Entitäten und virtuelle Realitäten a la Matrix denken.

Aus diesem Grund fanden wir, dass eine Vorstellung der Oculus Rift thematisch ganz gut in den Rahmen dieser Veranstaltung passt. Die zweite Entwicklerversion der Full-Surround-Datenbrille kam im Spätsommer bei uns an und weiß zu begeistern:

Weil das Sichtfeld des Displays in der Diagonalen 110° abdeckt, sind dessen Rändern für den Nutzer nicht sichtbar. Deshalb ist die Immersion – also die Wahrnehmung der digitalen Abbildung als “echter” Raum – besonders stark.

Das zieht drastische Folgen nach sich. Erste Anwendungen für die Oculus Rift ermöglichen beispielsweise eine rasante Achterbahnfahrt durch ein futuristisches Gebäude. Dieses Erlebnis wirkt so real, dass bei zarteren Naturen tatsächlich Schwindel und Unwohlsein einsetzt.

Willkommen in der Matrix – Tom Anyz

Dieses Erlebnis wollten wir den Besuchern des Webmontag näher bringen. Zudem ist Tom davon überzeugt, dass diese Spielart der virtuellen Realität ganze Branchen nachhaltig verändern wird, beispielsweise in der Filmindustrie und bei den Computerspielen.

Nach den Vorträgen konnten die Besucher bei uns die Oculus Rift ausprobieren – und waren begeistert, wie zahlreiche Reaktionen auf Twitter belegen.

Übrigens, wer den Webmontag verpasst hat, bekommt am 13. November zwischen 13:00 und 19:00 Uhr erneut die Gelegenheit zum Testen der Oculus Rift – diesmal bei uns in den appjigger studios. Hier könnt ihr euch anmelden:

Via Xing

Via Facebook

 

 

 

 

1. appjigger Oculus Rift Challenge

10302013_760081120715040_6795588342547509326_nWir haben es hier und sind überzeugt: Das Oculus Rift ist ein Game Changer – das ist durchaus wörtlich zu verstehen.

Wenn ihr die full-surround virtual reality des Oculus Rift selbst einmal ausprobieren möchtet: Am Donnerstag, den 11. September 2014, geben wir euch die Gelegenheit dazu. Schaut zwischen 13.00 Uhr und 19.30 Uhr bei uns in der Kaiserstraße 61 vorbei.

Verbindet den Besuch einfach mit eurer Mittagspause – auf dem Wochenmarkt direkt vor den appjigger studios findet ihr alles, was euer Magen begehrt. Essen solltet ihr allerdings erst NACHDEM ihr mit dem Oculus Ruft eine Achterbahnfahrt oder die Schiffschaukel absolviert habt.

Wir freuen uns auf euch! ;-)

tutorial: create a unity3d live wallpaper with native android preferences using unity2eclipse plugin

a lot of users ask how to add a preference activity to their live wallpapers created with the unity2eclipse plugin. this short tutorial will demonstrate how to toggle between black and white camera background color in your 3d wallpaper. in order to understand the basics of our plugin please read our two basic tutorial first:
passing screen offset values from live wallpaper to unity3d with unity2eclipse
and
Android Live Wallpapers with Unity3d

1. create a new xml layout file that is going to contain the settings elements:

my_prefs_layout.xml

my_prefs_layout.xml

in our (demo) case it’s going to be just a simple CheckBoxPreference:

2. create a new java class in the src folder:

create new class: MyPreferencesActivity

create new class: MyPreferencesActivity.java

this new class will extend the PreferenceActivity and load our previously created layout:

3. find the wallpaper.xml file in res/xml folder:

find the wallpaper.xml

wallpaper.xml

and add the line:

so our wallpaper “knows” that it has an activity that handles its preferences. (replace com.appjigger.advLWP.MyPreferencesActivity with your own class here). it should look like this than:

4. modify the manifest.xml: add the new activity to the application node:

5. prepare your unity project to receive vars from the native android wallpaper service. in our case it is going to be a simple C# public method that changes the camera background color of the player:

6. update the wallpaper service class in order to push the saved settings to the unity player each time the visibility of the LWP changes. find the main class in src:

find your wallpaperService class

find your wallpaperService class

find the onLWPVisibilityChanged method and add this code:

following this tutorial will add a “Settings…” button to your LWP preview that opens a new settings activity:

wp1

wp2

wp1a

this quick tutorial shows a very basic usage of preferences in android/unity. however you can crate a very complex settings activities even using your own widgets as we have done in our popular (none unity3d) LWP – WP clock:

 

 

add adMob banner to your unity3d game using unity2eclipse

a great benefit about using unity2eclipse is the possibility to extend your unity3d projects with native android elements like buttons or layouts. as a practical example we decided to show you the integration of an adMob banner in your game.

first of all you have to create an eclipse project – the easiest way to do that is to use our unity2eclipse plugin of course! ;-) click here to learn how to do that.

once created we add the adMob SDK to the project:
right click on the project name, find Properties in the menu (it is located at the very bottom). selecting the properties will open a settings window – navigate to Java Build Path -> Libraries -> Add External JARs… select the previously downloaded adMob .jar file and click OK.

Java Build Path -> Libraries -> Add External JARs…

the ugly thing about the latest android SDK update is the requirement to copy the adMob .jar  file manually into the libs folder of your project too. i am not sure if this is a bug or a feature, but adding it twice is the only solution that worked for me. just drag & drop it from your finder/windows explorer into eclipse.

additional location of the adMob .jar file

lets start with the more fun part of the tutorial and create a layout file that contains a placeholder for our unity player and the adMob banner – we’ll name it unitylayout.xml and store in res/layout folder of our project.

create a new layout xml file here

the contents of the XML layout:

(replace the “useYourIdHere” with your adMob ID ;-) )
we’ll use a FrameLayout – it will allow us to position widgets on top of each other – in our case the banner view on top of the unity player (learn more about android layouts)

in the next step we’ll adjust the .java class file:
the established way to implement an unity player here is to extend the UnityPlayerActivity:

its fine, but it wont allow you to add any native android widgets to your app. we’ll change it, extend an Activity and push the unity player into the LinearLayout placed in our layout xml file. you can replace the whole content of the class with this code:

the last file that we need to edit is the Manifest.xml located in the root of our project. adMob SDK requires some permissions in order to be displayed correctly:

i hope that this little tutorial will help you to understand how to extend the functionality of your unity android game and to benefit from adMob integration.

tutorial: passing screen offset values from live wallpaper to unity3d with unity2eclipse

remember! creating android live wallpapers with unity2eclipse is experimental and works with unity 3.4.x!

one great thing about android live wallpapers is the possibility to interact with touch events generated when the user swipes through the home screens – this little tutorial will show you how to move (smoothly) the camera on the X-axis:

rename your camera to “myCam” and add this C# script to it:

 

than find your java class in eclipse…

…and update the onLWPOffsetsChanged method with UnitySendMessage() where:

  • myCam is the name of your unity3d object (in this case our camera);
  • SetCamOffsetFactor is the name of the public method in your C# script;
  • String.valueOf(xOffset) is the current screen offset as string (UnitySendMessage) supports string values as parameter only;

it is always nice to have some easy way to test your LWP in your unity3d editor ;-) in this case you can just add this lines into the C# script:

click here to download the demo wallpaper from the google play store