Digital Resources for Buddhist Studies

Posted in Uncategorized on October 26, 2009 by billmagee

Lately I have been blogging about writing the Buddhist canonical languages in Second Life and OpenSim over at the Digital Resources for Buddhist Studies blog.

My colleagues over there are mainly database guys, so I thought a little metaverse chit-chat might liven things up.

Enjoy your digital resources!

Installing OpenSim-0.6.7

Posted in Uncategorized with tags on October 17, 2009 by billmagee

In my previous post I installed the Diva distribution of OpenSim and began porting my Tibetan language objects into it from Second Life. This has gone well. I have my complete Tibetan classroom running here behind the firewall on Dharma Drum Mountain. Diva has run splendidly. The only problems I have encountered involve saving and loading OARs (opensim archive files). There is a bug such that the OAR loads fine in the root region (SW) but loading an oar file in the other regions causes aproximately 30% of its prims to become phantom. See the bug report here: http://opensimulator.org/mantis/view.php?id=4163

Since I need to exchange OARs with other users, I decided to pass beyond the Diva distro by downloading and compiling the latest OpenSim release: opensim-0.6.7.

This tutorial is very limited: it will describe how I installed a standalone instance of OpenSim onto my Acer laptop running Ubuntu 9.04, mono 2.0.1, and MySQL. If you already use Ubuntu with these packages installed, read on. If you lack these packages or if you want a grid architecture instead of a standalone, I suggest you consult the OpenSim wiki: http://opensimulator.org/wiki/Main_Page

Ubuntu users will also need to install these compiling tools:

sudo apt-get install mono-devel libmono-microsoft8.0-cil libmono-oracle2.0-cil nant

Use MySQL or phpmyadmin (or some other MySQL manager) to create a MySQL database named opensim or such. It does not need to be populated with tables at this point. I named my new database “opensimRelease” to differentiate it from my “opensim” diva database. Make sure you have privileges.

Download opensim source code from: http://dist.opensimulator.org/opensim-0.6.7-release.tar.gz

Unzip it into its own directory somewhere controlled by you.

Then compile:

$ ./runprebuild.sh
$ nant

If there are problems with the compilation, the problem may be your mono installation. Consult the internet. But if all went smoothly, you will need to configure for a standalone server. Begin by copying the OpenSim.ini.example file to an operational ini files:

cp OpenSim.ini.example OpenSim.ini

Now you will edit the ini file.

In OpenSim.ini all references to databases should look like this:

storage_plugin=”OpenSim.Data.MySQL.dll”
storage_connection_string=”Data Source=localhost;Database=yourdatabase;User ID=root;Password=yourpassword;”;

Use XEngine:

DefaultScriptEngine = “XEngine”

This is my network section:

[Network]
ConsoleUser = “Test”
ConsolePass = “secret”
http_listener_port = 9000
default_location_x = 1000
default_location_y = 1000
http_listener_ssl = false ; Also create a SSL server
http_listener_cn = “localhost” ; Use the cert with the common name
http_listener_sslport = 9001 ; Use this port for SSL connections
http_listener_ssl_cert = “” ; Currently unused, but will be used for OSHttpServer
grid_server_url = “http://172.30.102.148:9000″
grid_send_key = “1234″
grid_recv_key = “1234″
user_server_url = “http://172.30.102.148:9000″
user_send_key = “1234″
user_recv_key = “1234″
asset_server_url = “http://172.30.102.148:9000″
inventory_server_url = “http://172.30.102.148:9000″
messaging_server_url = “http://172.30.102.148:9000″

Kill the evil dotnetengine:

[ScriptEngine.DotNetEngine]
Enabled = false

Now the StandaloneCommon.ini must be edited:

cp StandaloneCommon.ini.example to StandAlone.ini

edit it:

StorageProvider = “OpenSim.Data.MySQL.dll”
ConnectionString = “Data Source=localhost;Database=yourdatabasename;User ID=root;Password=yourpassword;”

At this point you should be able to run ./OpenSim.exe from the bin. It will ask you questions about your region. Your answers create a /bin/network/network.ini file. It should be configured like this:

[MY Cool World]
RegionUUID =
Location = 1000,1000
InternalAddress = 0.0.0.0
InternalPort = 9000
AllowAlternatePorts = False
ExternalHostName = your machine’s IP // Note: not 127.0.0.1
MasterAvatarFirstName = Master
MasterAvatarLastName = Avatar
MasterAvatarSandboxPassword = password

If all goes well you will be rewarded with a console prompt. Your region is now ready for use. Visit it with the SL client or Hippo (my favorite). Make sure your loginuri is set to http://127.0.0.1:9000 or whatever your setup demands.

More regions can be added in the /bin/regions/regions.ini file. Each region needs a unique UUID (get them here: http://www.famkruithof.net/uuid/uuidgen) and the coordinates and ports must be increased incrementally. For instance, in the next region the coordinates might be 1000,1001 and the port might be 90001.

Now that I have OpenSim running in standalone mode, my next steps will be to configure it for grid mode and connect my world to the OSGrid.

Added next day: Sucessfully configured the installation to run in grid mode. The process is straighforward. All errors involved wrong port numbers, so be careful about ports. See the Grid Mode section of the wiki:

http://opensimulator.org/wiki/Configuration

Moving to OpenSim

Posted in Uncategorized with tags on October 6, 2009 by billmagee

Wamlabs Mediatronics has been involved in virtual reality education since 2007. One of our projects, the Hopkins Tibetan Treasures Multimedia Archive (http://haa.ddbc.edu.tw), boasts an innovative eLearning platform for teaching Tibetan language in Second Life (http://www.secondlife.com: Catocala 176,107,600). Tibetan students worldwide visit and use this unique facility.

Now, WLM boasts its own OpenSim (http://opensimulator.org/) virtual platform, currently running in stand-alone mode behind the Dharma Drum Buddhist College (Taiwan) campus firewall. We have begun porting the Catocala installation into this sim (using the XML capabilities of the Open Source Meerkat Viewer), and students have successfully connected to our virtual world via their own personal computers.


opensim_terrain

Terraforming without limitations

OpenSim is a BSD Licensed Open Source virtual world capable of supporting standalone or grid-structured servers. OpenSim is written in C#, and can run under Mono or the Microsoft .NET runtimes. Our sim is running the Diva distribution (http://github.com/diva/diva-distribution/downloads) of OpenSim on a normal desktop machine running Ubuntu 9.04. Unlike other OpenSim distributions for linux, Diva is pre-compiled. Installation of the Diva software under Ubuntu is relatively straightforward assuming that the host machine already has a fully-functional Mono installation for LSL script comilation and MySQL database to manage persistence.


Wamlabs OpenSim home

Wamlabs OpenSim home

OpenSim has numerous advantages over the Second Life platform. Site administrators have complete control over all aspects of the sim. There are no corporate-imposed limitations on build size or number of prims allowed in-world. Entire regions can be backed up in XML format to the local hard drive for archival purposes or public distribution. Because it runs locally it is private and free of lag. Upgrades are handled seamlessly by the Diva distro. Since the software is cross-platform, an instance of OpenSim can be installed on almost any machine with two or more gigabites of RAM. Most importantly, it is Open Source and completely free.

Of course, there are disadvantages as well. The current release of OpenSim is alpha. Compared to Second Life, it has limited scripting and voice functionality and users must rely on forums and chat rooms to resolve bugs and other problems. However, these issues are being addressed by the core software developers. OpenSim is certainly usable now, and looks to become fully functional in future releases.

Our future plans include connecting our OpenSim to the OSGrid archipelago (http://www.osgrid.org/elgg/), expanding its size beyond its current four regions, and hosting classes, conferences, and “visiting” dignitaries on our private, Open Source, virtual campus.

Download the Diva distribution here:
http://github.com/diva/diva-distribution/downloads

Consult the OpenSim wiki here:
http://opensimulator.org/wiki/Main_Page

Read about the Open Metaverse here:
http://www.osgrid.org/elgg/

A Tibetan Language Classroom in Second Life

Posted in Second Life with tags on April 12, 2009 by billmagee

I am pleased to announce the opening of the first Tibetan Language Classroom in Second Life.

Tibetan Classroom in Second Life

Tibetan Classroom in Second Life

This digital language-learning platform offers all of the pedagogical advantages of Second Life plus the following Tibetan-specific facilities:

* a programmed object (the Cube of Tibetan Consonants) for learning the Tibetan consonants;

* a programmed object (the Sliding Number Puzzle) for learning the Tibetan numerals;

* a configurable wall (the Wall of Wyliewriters) which parses Wylie Transliteration input into Tibetan;

* 28 pre-programmed lessons for the Wall of Wyliewriters;

* Yang-jen-ga-wa-lo-dro’s “yi ge’i thob thang nyer mkho rab gsal me long” (accessible when the Sliding Number Puzzle is solved);

* a mediatron for playing machinima tutorials;

* 3 machinima tutorials giving detailed explanations on using the facilities (see my web page);

The Tibetan Language Classroom in Second Life can be visited in the Catocala region (172,112,600). Feel free to test-drive the Cube, Puzzle, and Wall. Anyone who would like to conduct classes in the facility or who would like a free copy of the programmed objects should contact Wam7c Macchi in Second Life or email me:

William Magee, Ph.D.
Dharma Drum Buddhist College
Jinshan, Taiwan
billmagee@ddbc.edu.tw

Here is a link to the video: Tibetan Classroom in Second Life. Or view it from my web page.

gtk-recordMyDesktop

Posted in Linux with tags , on March 22, 2009 by billmagee

Yesterday I successfully created a Second Life machinima video (with both microphone and game sound) using gtk-recordMyDesktop. Prior to this I had to boot Windows in order to make machinima. For an Ubuntu true-believer, this is unacceptable.

There are a number of Linux-based screen capture programs available. I have tested a few of them (xvidcap, Cinelerra, Istanbul, and some others) but I could not get the sound capture working right. Then my friend Fred Huffhines in Second Life (visit his Eepaw Shop in Smokey) suggested gtk-recordMyDesktop.

gtk-recordMyDesktop 0.3.8 download and documentation is available here: http://recordmydesktop.sourceforge.net/downloads.php. It is free and open source. On Ubuntu it installs into /usr/bin. Run it from there and it will open a graphical interface widget (the gtk part) that will allow you to select all or part of your desktop for screen capture.

Many people have difficulty getting getting the program to record both microphone sound and Second Life sound. In general, you need to have your sound mixer set for Mix or Wave: this setting will mix all the sounds you hear through your earphones into one channel for sound capture.

In Ubuntu Intrepid, I accomplished it this way:

1. I went into System/Preferences/Sound and set all options to Alsamixer (including setting the Default Mixer option to to SiS Sl7012 alsamixer) [NOTE: SiS is machine-specific. Your mixer name may vary.]

2. Then I ran /usr/bin/gnome-volume-control. Here, under the preferences option, I turned on Mix and Mic. I had to unmute the mike and turn it up. I also set the “Device” option to SiS Sl7012 alsamixer. [See above NOTE]

After I did this, gtk-recordMyDesktop gave me an excellent video recording with microphone and Second Life sounds mixed. The output file was in the .ogv format. I used the command tcprobe -i file.ogv to get info on it:

[tcprobe] OGG Multimedia Container
(probe_ogg.c) OGG stream 1 is of an unknown type (bad header?)
[tcprobe] summary for vidtest.ogv, (*) = not default, 0 = not detected
import frame size: -g -1080675528x-1207620440 \[720x576] (*)
frame rate: -f 0.952 [25.000] frc=0 (*)
audio track: -a 0 [0] -e 48000,0,2 [48000,16,2] -n 0xfffe [0x2000] (*)
bitrate=499 kbps

By the way, tcprobe is part of the transcode program.

Using Mplayer-nogui, I gave my machinima subtitles.

I used mencoder to convert my .ogv file to .avi:

mencoder filename.ogg -oac lavc -ovc lavc -lavcopts abitrate=160 -o filename.avi

(I found this command on Ubuntuforums — thanks to Janie70.)

Here is the info for the .avi file:

[tcprobe] RIFF data, AVI video
[avilib] V: 15.000 fps, codec=FMP4, frames=137, width=704, height=560
[avilib] A: 48000 Hz, format=0×50, bits=0, channels=2, bitrate=160 kbps,
[avilib] 373 chunks, 179040 bytes, VBR
[tcprobe] summary for vidtest.avi, (*) = not default, 0 = not detected
import frame size: -g 704×560 \[720x576] (*)
frame rate: -f 15.000 [25.000] frc=13 (*)
audio track: -a 0 \[0] -e 48000,0,2 [48000,16,2] -n 0×50 [0x2000] (*)
bitrate=160 kbps
length: 137 frames, frame_time=66 msec, duration=0:00:09.133

Finally I wanted a .mov version. Since I was in a hurry for a .mov version, I uploaded the .avi to http://media-convert.com/.

Here is the file info:

[tcprobe] Apple QuickTime movie file
[probe_mov.c] audio codec=twos
[probe_mov.c] video codec=yuv2
[tcprobe] summary for test.mov, (*) = not default, 0 = not detected
import frame size: -g 1280×948 [720x576] (*)
frame rate: -f 29.970 [25.000] frc=4 (*)
audio track: -a 0 [0] -e 22050,16,2 [48000,16,2] -n 0×1 [0x2000] (*)
length: 76 frames, frame_time=33 msec, duration=0:00:02.535

However, I believe I could have used avidemux to convert AVI to MOV using this command:

avidemux --load myfile.avi --output-format MPEG-4 --save myfile.mov --quit

Usually one needs to concatenate numerous AVI files into one big file. Use the cat command for this, then use mencoder to put video and sound back in sync.

mencoder -forceidx -oac copy -ovc copy intro_classroom.avi -o final.avi

Peace!

OpenSim Grids

Posted in OpenSim with tags on January 4, 2009 by billmagee

Second Life is a bizarre and beautiful expression of the human spirit; testimony to the fact that a virtual world inspires the imagination of a hacker in much the same way that a blank canvas inspires a painter. Linden Labs, the San Francisco-based company that enabled the extravagant outpouring of creativity called Second Life, deserves our heartfelt gratitude. Still, they are a corporate entity, and like all corporations (and Universities) their bottom line is money, not people. This breaks my heart, for the cost in human suffering is always high. And as for elf suffering, follow this link to the migration of the elf clan from Second Life to OpenLife Grid.

Luckily, at least in the digital world, there are alternatives to heartless corporate greed-based programs. Open Source Software (OSS) projects are non-corporate volunteer efforts. Many of them function better than their bloated corporate counterparts (Linux and LaTex users know this to be true). Sometimes the learning curve on OSS software is slightly steeper (or even much steeper) than that of a corporate product. But it is a slope worth climbing.

The OpenSimulator Project is an OSS virtual world application that can be used by anyone (http://opensimulator.org/). Central grid and Openlife Grid are two increasingly popular virtual worlds using this software. Here is a learned quote about OpenSim from seanfitzgerald lifted from Bettina Tizzy’s recent blog on the Openlife Grid:

“OpenSim” – http://opensimulator.org/ – is the open source platform that the Openlife Grid is based on. Opensim has been developed by independent developers in conjunction with developers from companies such as IBM and Microsoft.

What Linden Lab released as open source was their Second Life viewer. Despite popular misconception, OpenSim was not back-engineered from the Second Life viewer, but was built from the ground up.

OpenSim grids can be accessed via the official Second Life viewer or a range of other viewers compatible with it.

Openlife Grid is just one of many alternative grids based on OpenSim.

Currently I have not been able to visit any of these alternative grids, since my school’s IT policy inexplicably blocks my access to the ports needed. But I will have access later this month when I return home to the US. In fact, I intend to visit all the OpenSim grids.

Here is a complete list of OpenSim grids:

http://opensimulator.org/wiki/Grid_List

NOTE: it turns out that the elf clan is not migrating at this timel. See the latest
posts here:

http://elfclan.ning.com/profiles/blog/list?user=k26qhb3spjuw

Alas, there is no decent open alternative to Second Life yet. But there will be eventually…

Eloise Pasteur

Posted in Second Life on January 1, 2009 by billmagee

I am a big fan of Eloise Pasteur.  She is a major presence on the Second Life Educators List (SLED) and is the CEO of her own Educational Designs company in Second Life. When I first decided to invent a mediatron for the Tibetan language, I posted a question about it on SLED and Eloise gave me the code I needed. I have a link to her blog over there on the right. Here is a quote from one of her postings that I completely agree with:

First we have a question about approaches to the recession from Hightouch: If you’re an organisation that says people are your most important resource, why are you dismissing people before you consider closing buildings and working remotely with your people? It’s a good question – tiny, tiny organisations like Eloise Pasteur Educational Designs manage to work in a virtual environment. Great big ones like Department for Homeland Security and IBM manage it too. There are free to use tools such as Skype, Gizmo, Yuuguu etc. that let you work smoothly with distant people, and that cost nothing save some bandwidth and installation time. If you really believe your people are the most important resource, doesn’t finding a new way to work with them make sense?

I feel sorry for those who have been thrown out of work so their old companies can heat their big inefficient buildings.  Why can’t employers see the obvious? Buildings do not make money: people at work make money. The day is coming when people will wake up to the economic and human advantages of Virtual Worlds.

Second Life: The Outside of the Box

Posted in Second Life with tags , on December 30, 2008 by billmagee

Second Life is a simulator for encouraging the imagination, a
playground for nourishing the creative process, and a blank canvas for
inspiring innovation. Very few Real Life schools can make these
claims. Compared to the lackluster cubes in which we educate our
children, Second Life is the outside of the educational box.

Here is just a partial list of the capabilities of Second Life as an
educational platform:

ACTIVITY CENTERS
Art studio*
Experiment modeling*
Project design modeling*
Visualization studio**
Seminar classroom*
Conference center*
Meeting space*
Remote office hours**
Language-learning facility*
LSL programming environment**
Community-building*
Socialization and recreation areas*

RESOURCES
Museum*
Library*
Project Poster and Demo center*
Student projects laboratory*
Student projects display center*
Construction facility**
Holodeck**

INFORMATION MANAGEMENT
Database retrieval system
Powerpoint presentation display*
Slide projector*
RSS-feed receiver
Remote connection to Moodle learning-management system**

MULTIMEDIA
streaming audio and video player.
machinima production studio*
movie theater
web browser

COMMUNICATIONS
instant messaging and peer-to-peer text communicator
email client
VOIP-enabled international voice communication system*

* Second Life provides this function at lower cost than common tools
and facilities.
** This function is unique to Second Life.

Rotating Objects With Quaternions

Posted in Second Life with tags , on December 25, 2008 by billmagee

Rotation is a complicated subject in 3D programming. Sometimes you need to rotate objects to a specific vector and hold them there. Sometimes you need to set them rotating around their axes. Neither of these tasks is intuitive in Second Life. Recently, I have learned how to rotate objects to a specific vector.

My lab in Shipley has two floors, but there is no gap for a staircase to get up to the second floor. To fix this problem I wrote a program to hide a section of the second floor and rez a staircase that I can climb to the upper floor. Then another program restores the hidden section and kills the staircase.

The function to rez some object (for instance a staircase) contained in some other object (just some random container) is llRezObject:

llRezObject(object_name, position, velocity, rotation, parameter);

The position must be relative to the position of the container (which can be accessed by llGetPos). After some experimentation I set the position of the rezzed staircase to llGetPos()+<2.0,0.0,3.0>. This placed the staircase exactly where I wanted it, but it was rotated to vector 0,0,0, whereas I wanted it rotated to vector 0,0,270.

Alas, setting the rotation in llRezObject to 0,0,270 did not work. Why not? The problem is that 0,0,270 is a Euler vector whereas Second Life requires rotations to be expressed in quaternions.

Roll, Pitch, and Yaw

Roll, Pitch, and Yaw

The positional orientation 0,0,270 is called a Euler vector. The idea behind Euler vectors is to split the actual rotation into three simpler orientations. Rotation around these three orientations is called roll, pitch, and yaw. If I had direct access to the staircase parameters I could modify its orientation manually by entering 270 as its z-axis yaw. But you can only do that manually; you cannot do it with a program script. LSL (like other 3D programming languages) requires that rotations be expressed in quaternions instead of Euler vectors.

A quaternion has four values, three of which represent the direction an object is facing and a fourth that represents the object’s banking left or right around that direction. Not understanding the math at all, I nevertheless think the fourth value is a factor in accordance with which the other three values are altered during a bank.

Anyway, quaternions are useful in graphics simulations for their ability to accurately express rotations around 3-axes. As I mentioned, LSL scripting requires that Euler vectors be expressed in quaternions. Luckily, there are standard functions for this. Three lines of code are required:

1. vector eul = <0,0,270>;

This is the rotation I want in Euler notation: 270 degrees around the z-axis. So I set that vector to the variable eul. eul now expresses an angle in degrees.an>

2. eul *= DEG_TO_RAD;

Next, degrees are converted to radians. The radian is a unit of angular measure, equal to 180/π degrees, or about 57.2958 degrees. This second line assigns the value (eul * 0.01745329238) to the variable eul. Now we have eul as an angle expressed in radians.

3. rotation quat = llEuler2Rot(eul);

This function llEuler2Rot assigns quat the value of eul converted to a quaternion. Voila! quat is the rotation I need. So I plug quat into the little program below, which rezzes the staircase in the proper position and rotates it 270 degrees around the z axis.

default
{

state_entry() {
llListen(0,”", NULL_KEY, “”);
}
listen(integer channel, string name, key id, string message) {
if (message == “rez_staircase”)
{

vector eul = <0,0,270>
eul *= DEG_TO_RAD;
rotation quat = llEuler2Rot(eul);

llRezObject(llGetInventoryName(INVENTORY_OBJECT,0), llGetPos()+<2,0,3>,ZERO_VECTOR,quat,0);

}
}

}

Merry Christmas!

Wamlabs Mediatronics

Posted in Second Life on December 24, 2008 by billmagee

My name in Second Life is Wam7c Macchi. I am the weird-looking guy with the fedora. My company in SL is Wamlabs Mediatronics. We do educational builds, Asian language instructional programming, and machinima. Currently I am building a technical educational platform for my college in Taiwan. I call the campus the Dharma Drum Buddhist College elearning Beacon. I have written an article about it here.

Wam7c Macchi

Wam7c Macchi

Besides building a campus, Wamlabs is developing innovative language-learning mediatrons (together with Fred Huffhines of the Eepaw Shop in Smoky), making instructional machinima, and researching the best tools for presenting streaming media in Second Life. When I get some time I will blog about these things. The machinima are available on youtube: search for wamagee.

If you would like to visit the campus, you are very welcome. In Second Life teleport to the Catocala region, coordinates 184, 63, 101. And don’t miss our experimental Tibetan language classroom at coordinates 168, 121, 600.