Apr 10, 2012

Rapid virtual world creation on OpenSim

One beauty of the opensimulator is import and export capability. With a viewer like imprudence we can easily build up the virtual world. It is very good way to start tutorial from opensim artist home. A good collection of OpenSim compatible creations can be found from here. Those are available for  download and just need to give the path of .xml file in extracted folder.
Go to file-> Import+Upload of the viewer.


It will take sometime to upload the file. Once it is done, we can placed it in a preferred position. The other important thing is that we can set up any reusable virtual environment instantly. I have download one of these virtual terrain and using a single command I was able to load that terrain.
terrain load terrain-apple.png 

Finally it is also possible to reuse available world rather try one by one. I try the virtual world called "Tiki Summer Sim" on my own risk. It really easy to be use and just a single line of command is required. Just past with load function + whatever the file name as bellow.
load oar xxx.tgz




 Make sure that what is exactly needed by the simulation. Unnecessary beauty of the scene will be reduce the simulation performance significantly. This example simulation has been consisted around 4275 primes which consumes 1GB memory.. :) 

Apr 8, 2012

GlovePIE: wiimote tracking

One of the sub goal of my project is to track the user's head direction and orientation. And I am mostly preferred low cost approach although there are many commercial trackers which are obviously outer range of undergraduate research budget.
When I was conducting my survey, I found many RnD work on affordable head tracking. Among them wiimote tracking is highlighted (and we already have such resource). Therefore I am trying on some APIs which allows wiimote tracing. One such good application is GlovePIE. I have follow some tutorials via the internet and also there is a descriptive documentation with GlovePIE. I have shortlisted some practicals which I have tried myself.

If you have a good oo programing knowladge like c++, this is not that much hard. A comprehensive tutorial can be found here.

So let's take an example expression.  It will emulate wii mote right button to the right arrow key of the keyboard.
Key.Right = Wiimote.Right            //This can be identified as an object or a variable.
a = var.A                                        //makes a variable A which is equal to the letter a.

In programming syntax,

LValue  =  expression                    //set the LValue to the value of the expression.
  • GlovePIE is constantly looping through your script. 

Hello World Program

The 'debug' command will out put next to the stop/run button.
debug = "Hello World!"

This debugger tool is very powerful and it allows us to figure out what is going on in the emulator.

Check Wiimote's Availability and Battery

debug = "Wiimote On:" + Wiimote1.Exists + " Wiimote Battery Level:" + Wiimote1.Battery

 Wiimote1.Exists -  will be True or False based on whether or not wiimote is ever connected.
 Wiimote1.Battery - put up wiimote Battery Level with a number from 0-192 (192 being a full battery).

example output: Wiimote On:True Wiimote Battery Level:104

Calculate Degree of  Wiimote is at

  • Roll -   debug  =  "Wiimote Roll:" + Wiimote1.Roll 
  • Pitch -  debug  =  "Wiimote Pitch:" + Wiimote1.Pitch
  • Yaw -   debug  =  "Wiimote Yaw:"  + Wiimote1.Yaw
Also note that you should consider the amount of data communicated via Bluetooth.


So up to now I got some basic knowledge to calculate the coordinates of wiimotes. As I have inspired with GlovePIE I have also tried out following stuffs.
  • If condition then statement [ ; ]
 if(Wiimote1.A) then
debug = "Button A is pressed"
else
debug = "Other button is pressed"
endif

Once you press a button 'A', it will print  "Button A is pressed" and "Other button is pressed" otherwise. According to above example I tried extend it further hence I can figure out what is actually going on in my code.

Can we port this to a game controller ?

 if(Wiimote1.A) then
         debug = "Accelerate"
else if(Wiimote1.B) then
         debug = “Break..!”
else if(Wiimote1.Up) then
         debug = “Drive”
else if(Wiimote1.Down) then
         debug = “Reverse..!”
else if(Wiimote1.Left) then
         debug = “Turn Left”
else if(Wiimote1.Left) then
         debug = “Turn Right”
else
         debug = "Constant velocity"
endif

Now I thought this conceptual game controller. It will make easier me to debugging.. :)

Apr 7, 2012

First experience with wiimote

I have no practical experience with wii mote although I have read a lot about it. There are a lots of tutorials have been available for deal with wii mote. But I am rather happy to share my own experience with you.

Firstly you have to make sure the wiimote is properly connected via Bluetooth with your PC. There are different Bluetooth drivers have been available, called Bluetooth stacks. But if you are using windows, Microsoft Bluetooth stack is preferred. As I showed my previous post, you should keep pressing 1 & 2 buttons on the wii mote for a while, to connected with your PC. In my case I have to take several attempts to make install drivers properly.

Then you may need an input emulator which emulates input devices by using other input devices. I used GlovePIE as the input emulator. But unfortunately the site has been hacked by the exploiters. However I have the last updated version. :) You can fined many tutorials to learn about the GlovePIE emulator.

I just interested about it because it can be easily configured for wiimote's inputs. Flowing code I have used for transform wii mote inputs to keyboard interrupts.  

GlovePIE script for wii mote


If the wii mote is connected properly its LEDs should be turn on, just after you are running the emulator code. Now emulator maps each wii mote inputs to specified key board inputs. This is smiler to the functionality of PreTranslateMessage in windows API. You can also know about this of you have MFC programming knowledge. 

Now go to the notepad. And press 1 or 2 button of the wiimote and you will see 'a's and 'b's will be typed on the notepad. If it so, yes you are done.


Now run your openSim region on your favorite viewer. I used imprudence as it has may functionaries. Once you loin just pressing the up/down buttons of the wii. Yes, there you are...Now you can move your avatar with wii mote. :) 


Apr 6, 2012

Connect Wii Remote to the Computer

Nintendo RVL-CNT-01

It was taken some time me to connect wii to my own PC. But it was not too hard. Just you have to be remember that you must make it discoverable when computer searches for the device. Press 1 and 2 button consecutively so that it can be detected by the computer.
If your wii is working properly the LED lights should be blinking on each pressing. Also it is better if you can use rechargeable AA-batteries.

After few days I have encountered another problem when connecting wii to my laptop.Although it is working properly previously now it always try to update the driver via internet. I set windows to automatically update and install but wiimote is not like to be connected. So I disconnect the internet so that I was able to connect wii without any problem.

Mar 10, 2012

Configure OpenSim in Windows

OpenSim is the best free and open source server platform for hosting virtual worlds. While evaluating the game engines during the last week I noticed that OpenSim has been used in many researches. OpenSim works in two modes according to the perpose of the simulation. One is standalone mode and other is grid mode. In grid mode the service which is needed for the simulation, is not the part of region server process. Hence here the execution process is bit complex.

If you are new to OpenSim it is better to understand the simulation process in standalone mode first. When you are using OpenSim as a simulation engine you will have a good community support with strong documentation. Meantime you can reuse huge number of virtual objects and regions. Here are the steps of configure it in Windows.

  1. First you have to solve certain dependencies which OpenSim requires. As per current situation it is required .NET Framework 3.5 under windows. If you are using windows XP, be remember to update it at least Service Pack2.
  2.   Download the latest OpenSim simulator distribution.
  3. Unzip the package and go to /bin.
  4. In bin folder you will find OpenSim launcher.   (32-bit version of Windows: OpenSim.exe and 64-bit version of Windows: OpenSim.32BitLaunch.exe)
  5. As you are running the OpenSim for first time you have to set up a region and a user account. Give the proper answerer in the command prompt. These settings are written in to /bin/Region/Reagons.ini file.
Also note that you can give default as it suggested, if it is your first time with OpenSim installation.
  • New region nameThis is the name for your region.
  • Region UUID Unique ID of your region. You can keep the default value.
  • Region Location – This is the location of your region in the grid. You can safely leave these as the default (1000, 1000).
  • Internal IP address / Port IP address and Port to connect to your region.
  • One here onwards you can leave other parameters as default. But if you are using OpenSim 0.7 or later you need to create an estate manager account. In standalone mode you will ask to create an state manage account.  Don’t forget the account of the master avatar (in 0.6.9) or the estate manager (in 0.7 and later). These user accounts allow you to configure the in-world settings for your region and you can use the account to perform your initial login test. In addition to that you can create a user with ‘create user’ command other than an estate manager.
  • There are many 3rd party viewers to connect with OpenSim and view your region. Install one of them on your pc and lunch the viewer program. Before connecting make sure the server ‘OpenSim.exe’ is up and running. Enter first name, last name and password of the user account.


 Congratulations..!!! You just successfully log on to your own world. Now you can build up your own imaginations and be the master of your virtual arena. 

Feb 14, 2012

Microsoft Kinect for xBox360 Console


Microsoft Kinect, the project officially launch for xBox360 console. As you can see in the picture the main equipment is the Kinect sensor. Kinect SDK for Windows gives developers easy access to the capabilities offered by the Microsoft Kinect device connected to computers running the Windows 7 operating system and Windows 8 developer preview (desktop apps only).

It is easy to use. Basically you download. All you have to do is plunging the Kinect into a free USB socket and start programming. You can create applications in C#, VB or any .NET language including C++. Its only disadvantage is that it has a non-commercial licence which means you cannot use it to make any profit or even use it at all within a profit making organization.

Introduction to Hardware

There is a plug on the end of the cable that comes out of the Kinec. It is a proprietary connector designed to allow the Kinect to be plugged into the new black XBOX 360 without the use of an external power supply. Older XBOXes don't have the special connector and they come with an external power supply which has an adaptor to convert the Kinect plug into a standard USB connector and power supply connector.If you have bought a Kinect with a recent XBox as a bundle then you will need to buy the adaptor/power supply. At the moment these are only available from the Microsoft store.

Prices The initial retail price of Kinect sensor is about $149.00. But if you haven't xBox360 console you should considered abut xBox360 console and bundle pack.

Kinect Sensing

With Kinect for Xbox 360, you are the controller. Easy to use and instantly fun, Kinect gets your whole body in the game. Imagine controlling movies and music with the wave of a hand or the sound of your voice. With Kinect, technology evaporates, letting the natural magic in all of us shine. And the best part is Kinect works with every Xbox 360.
Kinect has following sensors to detect humans' activities.
  • Motion sensor 
  • Skeletal tracking 
  • Facial recognition 
  • Voice recognition 
What we can  with Kinect without xBox360? read

Jan 21, 2012

Virtual Object Interaction

I am really interesting on virtual reality concepts and its application. Therefore I thought to note down some knowledge, I gained while reading for my research. Please note that if you are using these details you must refer original papers in your publication. I just note down them in point form.

When you are navigating in a virtual world you may need to interact with virtual objects sometimes. Those objects may be dynamic or static virtual objects.

Let's consider a foot ball that you are given to play in a foot ball game. What are you going to do if the ball coming towards you? Depending on the team which you are playing, you will hit to ball along your desired direction. And what happen if you are the referee in the game? In that kind of situations you may need to grab the attention from team players and sometimes you also need to grab the ball.

Considering about an immersive virtual environment the situation may be different than previous example. Someone can argue that issuing an abstract command is sufficient instated using metaphors. But if the user is navigating on a immersive virtual environment, metaphors are needed to be interact with virtual objects in the VE. The virtual interaction can be described in two cases. Those are grabbing or selection and manipulation. In this article I discuss about virtual object grabbing and manipulation techniques which I encountered during the literature review in my research. 

Grabbing and Manipulation  

  • Arm Extension Technique 
When considering of a natural metaphor such as an arm user must be within the length of arm. In an arm extension techniques user is able to grow the virtual arm to the desired length.In this technique grabbing is easy but manipulation may be difficult due to virtual hand must be positioned within the object, which may be small or distinct.  
    •   Go-Go Technique
In this technique a virtual hand is moving in one-to-one mapping with physical hand of the user. At some point, say a threshold, the virtual hand is growing faster than physical hand. Therefore this technique allows user to reach objects which are situated at greater distance from the user. Another advantage of one-toone mapping area is user able to manipulate virtual objects as he does in the normal manner. Similar to this technique, another technique has been introduced which named as 'fast go-go' techniques. This has quick growing function of virtual hand in the no local area of the user.

  •   Ray Casting Techniques
 A virtual light is used in this technique to grab the attentions of a virtual object. The direction of the light should be along with users' hand.  Therefore grabbing task would be easy since user needs to pointing to an interested object. But using this method manipulation is become difficult.  
The major problem of this technique is called "lever-arm" problem. As the object is attached to the end of the ray, there is no way to rotate around the object except axis of the ray itself. And it gives 1 digree of freedom which rotation around the axis may be controlled. If user needs to move the object vertically he must also translate it and rotate it in another direction. 

  • Stretch Go-Go
In this technique the different constant growing speeds for the users' hand is assigned in three different regions. Using this techniques any length of the arm can be obtained. Only difference is in this technique user allows stretching his arm using arm motion controlling. If the arm is brought back virtual hand retracts in the same speed. This is cognitively challenging for the go-go technique but it does also allow for the arm to be placed at any distance. 
  • Indirect Stretching
In this technique user is able to stretch or retract his arm using two buttons of a 3D mouse.This is far away from natural metaphor of stretching the arm hence we cannot use this kind of technique for our research. But this technique is more precise and easy to use. 

  • Fishing Reel Metaphore 
 As earlier mentioned ray casting has certain limitation with object manipulation. This technique is an enhancement of ray casting technique. Using this metaphor user able to reel the object closer or further away with two mouse buttons. Therefore it would improve one additional degree of freedom of ray casting although it is indirect way of object selection.  

User Study
  • Indirect stretching and go-go technique was popular among users but it was noted some difficulties.
  • Users  almost  unanimously found  go-go to be the  most  natural  technique,  but  many  evaluators  preferred other techniques.
  • Indirect stretching was preferred by several subjects as it offers more precise control of the hand and less physical work on the part of the user. 
  • Due to lack of physical work has to be done ray casting with reeling was preferred by some of the user.
  • Almost every users are commented that ray casting is the best way to grab an object other than any of arm extension techniques. It requires no arm stretching and just need to point to an object and releases the mouse buttons while arm extension techniques one must place the hand within the object. Hence for grabbing ray casting is preferred. But non of them are easy to use for entire iteration: grabbing, manipulation and releasing.
Hybrid Approach

Based on user feedback, we have designed and  implemented  new techniques which  are  hybrids of the best features from  those discussed above,  but  still retain  ease of  use and  simplicity. These techniques use  ray-casting for  object grabbing  and  hand-centered manipulation, since these methods  were thought to be the easiest  to  use and  most efficient by almost all  subjects. We call this the HOMER  ( H and-centered
O bject M anipulation  E xtending  R ay-casting) technique.

sources

  • D. A. Bowman and L. F. Houges, “Formalizing the design,  evaluation,  and  application  of  interaction techniques for immersive virtual environments,”  Journal  of  Visual Languages and Computing, vol. 10, no. 1, pp. 37-53, Feb. 1999.
  • S.  Lee,  J.  Seo,  G.  P.  Kim,  and  Park  Chan-Mo, “Evaluation  of  pointing  techniques  for  ray  casting selection in virtual environments,” in Third International Conf.  Virtual  Reality  and  Its  Application  in  Industry, 2003, pp. 38-44.