Saturday, October 16, 2010

How to compile VTBuilder in Ubuntu Lucid

VTBuilder with ETOPO data on Ubuntu Lucid


I use VTBuilder as a GIS data converter and preprocessor for creating terrain for OpenSim. Unfortunately there is not Ubuntu package for it and I had to use the windows version. I really don't like to move to another computer or reboot in the middle of a creative experience so I want VTBuilder in my Ubuntu box. But the "General Unix Build Instructions for the VTP Software" at http://www.vterrain.org/Distrib/unix_build.html did not work for my Ubuntu Lucid. So after two sleepless nights I was able to hack the makefiles and successfully ran VTBuilder in Lucid. I still do not know how stable this is or what will work and not work.

Warning: The following information is for people who knows how to compile software from source files in Ubuntu GNU/Linux. It is for an amd64 flavor only. I have not tested it on a 32 bit flavor and anyone wanting to do so, may need to modify the Make.defs file in the vtp4lucid files I've included in this post.

I assume you have an amd64 Ubuntu Lucid box with all the developer files for compiling software e.g. gcc, make, patch, x11proto dev files, etc.

**Files needed**


Source code of the Virtual Terrain Project (VTP) http://www.vterrain.org/
VTBuilder is a tool in this suite.

Get it via svn from http://code.google.com/p/vtp/source/checkout

**Dependencies**

Most of the dependencies are in the repositories. Issue the following:

sudo apt-get install openscenegraph openscenegraph56 libgdal1-1.6.0 
libgdal1-dev libproj-dev proj proj-data zlib1g-dev zlib1g-dbg netcdf-bin 
libnetcdf-dev libnetcdf4 netcdf-dbg tcsh libwxgtk2.8-0 libwxgtk2.8-dev 
libwxgtk2.8-dbg bzip2 libbz2-dev libbz2-1.0 libtiff4-dev  libpng12-0 
libpng12-dev libjpeg62-dbg libjpeg62 libjpeg62-dev libglut3-dev libglut3 
freeglut3 freeglut3-dev freeglut3-dbg glutg3 glutg3-dev libcurl3-gnutls 
libcurl4-gnutls-dev

I may be missing something so check again if errors are encountered during compilation. Some of these files may not be needed but I really do not know, so I probably included more than necessary.

There are three libraries not in the repositories that needs to be built first. These are squish, libMini and Quikgrid. I failed to compile quikgrid so it is not included here.

**Squish**

Fortunately there is a ppa of the squish libraries here https://launchpad.net/~kervala/+archive/ppa. The list of files needed are the following.

libsquish1_1.10.26~lucid0_amd64.deb
libsquish-dev_1.10.26~lucid0_amd64.deb
libsquish1-dbg_1.10.26~lucid0_amd64.deb
squish-extra-dbg_1.10.26~lucid0_amd64.deb
squish-extra_1.10.26~lucid0_amd64.deb

I have included this in the vtp4lucid tools below. Install them with Gdebi starting with libsquish1_1.10.26~lucid0_amd64.deb. Or cd to the folder where you extracted the deb files and issue the following command in a terminal:

sudo dpkg -i *.deb

**LibMini**

The Mini library source code can be downloaded here http://stereofx.org/download. I also included this in the vtp4lucid tools. It's very easy to build and install. You will need tcsh for this one.

1. Open a terminal (it would be bash)
2. type tcsh (you're now in tcsh)
3. cd to the mini source code folder
4. issue the following command

sudo ./build.sh install

It will install the following:

/usr/local/lib/libMini.a
/usr/local/include/mini  folder
/usr/share/mini folder

5. type exit and you will be back in bash

**VTP4Lucid tools**

Download: http://www.mediafire.com/file/enb4ioqdgnxq6dc/vtp4lucid.tar.gz (2.76 MB)

Download the modified makefiles and other needed files including mini and squish at . Extract in your vtp folder. It should replace Make.defs in the root of the vtp folder and Makefiles in the TerrainApps folder. It will also put Data/Culture and Data/WorldMap folders in TerrainApps. These are needed by VTBuilder but not included in the source code.

The Makefiles were modified by changing lgdal to lgdal1.6.0 because it could not find the gdal library in Lucid. The Make.defs file library paths were modified for Lucid.


**Building VTP**

A. Compiling TerrainSDK

1. open a terminal and issue the following commands

export GDAL_DATA=/usr/share/gdal16
export PROJ_LIB=/usr/share/proj

2. cd to TerrainSDK folder
3. type

sudo make install

it will install libraries and header files in /usr/local/lib and /usr/local/include respectively

4. after it successfully compiled issue the following commands in the terminal

sudo export LD_LIBRARY_PATH=/usr/local/lib:/home/dilis/OPT/vtp/TerrainSDK/vtdata:/home/dilis/OPT/vtp/TerrainSDK/vtlib/vtosg:/home/dilis/OPT/vtp/TerrainSDK/xmlhelper:/home/dilis/OPT/vtp/TerrainSDK/vtui:/home/dilis/OPT/vtp/TerrainSDK/unzip:/home/dilis/OPT/vtp/TerrainSDK/minidata

Make sure to replace the path of TerrainSDK above with your setup. There is a need to make the environment variables persistent but I forgot how :-( while doing this build. This may help https://help.ubuntu.com/community/EnvironmentVariables#System-wide%20environment%20variables.


B. Building VTBuilder

You may build VTBuilder alone or the entire VTP suite. I don't know what Enviro and CManager is for. VTBuilder and Enviro worked but CManager did not. When I ran it, it spew out the following error:

Warning: winsize 0 0
Error: OpenGL version test failed, requires valid graphics context.
The program 'CManager' received an X Window System error.
This probably reflects a bug in the program.
The error was 'GLXBadDrawable'.
  (Details: serial 816 error_code 130 request_code 128 minor_code 11)
  (Note to programmers: normally, X errors are reported asynchronously;
   that is, you will receive the error a while after causing it.
   To debug your program, run it with the --sync command line
   option to change this behavior. You can then get a meaningful
   backtrace from your debugger if you break on the gdk_x_error() function.)

1. VTBuilder

a. cd to TerrainApps folder
b. issue the following command in a terminal

sudo make VTBuilder

c. cd to the VTBuilder folder
d. run VTBuilder with

./VTBuilder

2. VTP

To build the VTP suite

a. cd to TerrainApps folder
b. issue the following command in a terminal

sudo make

c. cd to the Cmake, Enviro, and VTBuilder folder
d. run the apps in the same manner as above

Update: SETTING ENVIRONMENT VARIABLES SYSTEM WIDE

1. Put this in /etc/environment file after PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games"

GDAL_DATA="/usr/share/gdal16"
PROJ_LIB="/usr/share/proj"


2. LD_LIBRARY_PATH

a) create /etc/ld.so.conf.d/*.conf e.g.
sudo touch /etc/ld.so.conf.d/*.conf

b) open *.conf in gedit
sudo gedit /etc/ld.so.conf.d/*.conf

c) enter the following in *.conf

/home/dilis/OPT/vtp/TerrainSDK/vtdata
/home/dilis/OPT/vtp/TerrainSDK/vtlib/vtosg
/home/dilis/OPT/vtp/TerrainSDK/xmlhelper
/home/dilis/OPT/vtp/TerrainSDK/vtui
/home/dilis/OPT/vtp/TerrainSDK/unzip
/home/dilis/OPT/vtp/TerrainSDK/minidata

d) run
ldconfig -v
in a terminal

that's all there is to it. Now you can double click on VTBuilder and it will open.



Have fun,

Roel Cantada
http://matangdilis.blogspot.com

update: April 1, 2011, Enviro screenshots. Enviro is looking for a terrain, but I don't know what it is. As you can see the earth view shows only a blank sphere.


Friday, October 15, 2010

How to visualize Philippine GIS data in OpenSim

Here is how I was able to terraform the OpenSim server using elevation data for the Philippines.  I will document the procedure here.

**Software needed**

1. VTBuilder http://www.vterrain.org/Doc/VTBuilder/overview.html (Windows)
http://vterrain.org/dist/VTBuilder_090826.exe
(Note: The vtbuilder listed here only works with Windows. But the VTP software suite can be compiled in Linux. I'll post on that later on.)

2. L3DT Standard Edition http://www.bundysoft.com/L3DT/downloads/standard.php
(Note: L3DT can run on Wine in Ubuntu)

3. The Gimp
4. Opensim Server
5. Hippo Opensim viewer or Imprudence viewer
6. Gimp Terrain http://dominodesigns.info/project/gimpterrain
7. Blank SL raw terrain file - available with terrainerizer script http://stringofbits.net/terrainerizer/

**Elevation data**

1. DTED Philippines GIS Data Depot http://data.geocomm.com/catalog/RP/datalist.html
2. ETOPO1 Global Relief Model  www.ngdc.noaa.gov/mgg/global/global.html

**Procedure**

//Preparing geospatial data for 3D visualization//

DTED data in VTBuilder


  1. Import elevation data in VTBuilder
  2. Use the Area Tool to select the Philippines
  3. In the Area Tool menu open the Match Area and Tiling to Layer dialog
  4. Set Tile LOD0 Size:  to 256
  5. Now open the Area Tool->Merge and Resample Elevation dialog
  6. Select To file and fill in the path to filename of .bt file
  7. Click ok to write the .bt file
  8. Close VTBuilder

ETOPO data in VTBuilder



//Preparing the PNG heightfield map//

L3DT Screenshot

  1. Open L3DT and import the .bt file
  2. Calculate the other maps (I found the water map useful for masking sea level elevation)
  3. Clip unknown data via Operations→Heightfield→Clip heightfield. Set to  Clip below and To height to something like -100.  Unknown data will result into an abyss in OpenSim where the avatar may fall endlessly until it is regenerated in the home position.
  4. Export heightfield map, and for the DTED elevation data, export the water map as .png files.  These maps should have a size of 2048x2048 pixels.
  5. Close L3DT


//Preparing the SL raw files//

//Additional image editing for DTED files//

The DTED elevation data had sea level as the lowest elevation.  This results in the entire region being dry land and no ocean.  I needed to lower the sea level so that there will be oceans in OpenSim.  To do this I turned the water map into a mask in the Gimp.
  1. Open the water map .png file in the Gimp.
  2. Color select ocean.
  3. Create new layer with alpha.
  4. Copy and paste color selected ocean.
  5. Bucket fill with black (html notation 000000)
  6. Delete the original water map layer
  7. Open the heightfield map
  8. Copy and past the mask over the heightfield map
  9. Save as .png file
//Tiling the image (The pro version of L3DT can do this automatically)//
  1. Set Edit->Preferences->Default Grid->Spacing to 256 pixels height and width
  2. You'll need to restart Gimp for the change to take effect
  3. Open the heightfield .png image in Gimp.
  4. Enable the following
  5. View->Show Grid
  6. View->Show Guides
  7. View->Snap to Guides
  8. View->Snap to Grid


The 256x256 grid should be displayed.  There will be 8x8 tiles.  Pull out guidelines from the ruler and match them exactly to the gridlines.

Then Image->Transform->Guillotine. Gimp will open 64 windows of each tile.  You'll have to save each file.  The produced DTED tiles for my sample is shown below:



//Creating the SL raw files//

Install the Gimp Terrain plugin by copying the file_slraw.py file to your Gimp plug-ins directory.
Open the blank.raw file that comes with terrainerizer.

   1. Open your blank terrain file (blank.raw) and the heightmap in the Gimp.
   2. Using the Rectangle Select tool, select a 256×256 pixel section of the heightmap, starting in the upper-left corner.
   3. Click Edit -> Copy
   4. Select the terrain file and make sure the Height layer is selected.


   5. Click Edit -> Paste. You should see the section of the heightmap you copied appear as a floating layer.
   6. Click Layer -> Anchor Layer. The Height layer should now look like the copied portion of the heightmap.
   7. Click File -> Save As and save this file as a new file with the .raw extension.

Now, repeat this process for every 256×256 pixel section in your original heightmap."

Close The Gimp.


//Preparing the adjacent multiple region in OpenSim//


In the OpenSim server console issue these commands for every region

create region RegionName

It will ask for some information, the following are important.

  • location
  • port address
  • master avatar firstname, lastname and password


The map above list the location (in red) and port numbers (in blue) for each Etopo tile:


It grows eastward and northward, as the reference increases. e.g.

  • x, y
  • 1000, 1000 - origin region
  • 1000, 1001 - north
  • 1001, 1000 - east



//Uploading the raw terrain files to OpenSim//

Issue the following commands in the OpenSim server console

change region RegionName
terrain load /path/to/xxx.raw
terrain multiply 0.2
terrain elevate 18.75
terrain bake
terrain save xxx.raw

0.2 and 18.75 are numbers for the DTED data.  The ETOPO data required terrain lower 164.5 and there was no need to multiply it.
Saving the terrain makes sure all the modifications are in the raw files.

//Editing terrain in OpenSim//

This is not a 2d drawing in OpenSim but the generated Philippine map based on the data.


Run the Hippo Openmetaverse viewer (or Imprudence viewer).
View the terrain.  Fly around.
I've noticed a problem with sea level land like Central Luzon and Manila which are flooded.  (How do they keep these places dry? dikes?).  There are also problems with inland lakes like Taal lake and Lake Lanao.  These are above sea level and will appear dry.  I would probably need prim water for these lakes.

Comparison of ETOPO and DTED data visualization in OpenSim

DTED Laguna
ETOPO Laguna
DTED Corregidor Island
ETOPO Corregidor Island


In my opinion the DTED data is best for land above water, while the ETOPO data is best for undersea land. Rivers are not seen in the ETOPO data.
The DTED data is very rough compared to the Etopo data.

To edit the terrain, click on Build and then Terrain (Bulldozer icon).  Lower, raise smooth whatever needs editing.  Remember you can always reload the raw data in the server if things get too ugly.

OpenSim as a visualization tool for GIS data will not only be useful for teaching geography at a distance but may also be useful for GIS training and geology.



**References**

Amante, C. and B. W. Eakins, ETOPO1 1 Arc-Minute Global Relief Model: Procedures, Data Sources and Analysis. NOAA Technical Memorandum NESDIS NGDC-24, 19 pp, March 2009. Available at http://www.ngdc.noaa.gov/mgg/global/global.html

Are these data and images copyrighted?
No, all of our data and images are in the public domain, unless specifically marked otherwise - with the notable exception of trademarks, logos, and trade names such as the NOAA emblem and the Department of Commerce seal which are the property of the U.S. Government and are trademarks of the Commerce Department and require permission for use. All other images, and data, are available for your use. We would appreciate a link/credit/byline, as appropriate. For example:

    "Computerized digital images and associated databases are available from the National Geophysical Data Center, National Oceanic and Atmospheric Administration, U.S. Department of Commerce, http://www.ngdc.noaa.gov/."

We also ask that you please cite the original data contributors and sources of funding when you use data from NGDC. As required by 17 U.S.C. 403, third parties producing copyrighted works consisting predominantly of the material produced by U.S. government agencies must provide notice with such work(s) identifying the U.S. Government material incorporated and stating that such material is not subject to copyright protection.

For more information, please see the NGDC disclaimer and copyright notice. http://www.ngdc.noaa.gov/ngdcinfo/privacy.html#disclaimer

http://www.ngdc.noaa.gov/mgg/faq.html


GIS Data Depot http://data.geocomm.com/catalog/RP/datalist.html
All of the data available via the GIS Data Depot is free of a copyright.

L3DT Standard Edition
L3DT Standard is the freely available general-use version of L3DT.

VTBuilder
This software is entirely free to use and redistribute, with this license. http://www.vterrain.org/Doc/VTBuilder/license.txt


Balthazar. Large 3D Terrain.  In B's World [Blog]. http://balthazarsin.blogspot.com/2007/09/large-3d-terrain.html.

Balthazar. Digital Terrain Elevation Data. In B's World [Blog]. http://balthazarsin.blogspot.com/2007/09/digital-terrain-elevation-data.html

Using L3DT. In OpenSim wiki. http://opensimulator.org/wiki/Using_L3DT

Wiggins, P. (2009, September 8). Tutorial: Creating OpenSim terrain with Blender. In A Random String of Bits [Blog]. http://stringofbits.net/2009/09/tutorial-creating-opensim-terrain-with-blender/

Marama, D. (2009, July 28). Second Life Terrain Import and Export for The Gimp. http://dominodesigns.info/project/gimpterrain

Thursday, October 14, 2010

Philippine terrain in OpenSim

I had to drop this from my project as it involve 64 sims. GIS data was used to create the terrain. I'm going to post the documentation on how I did it later.  This proves that OpenSim is not just a toy, it can be used for teaching GIS, geography and geology at a distance.



Some screenshots of the islands...

North Luzon

South Luzon

Central Visayas
Samar-Leyte

Mindanao-Zamboanga Peninsula

Mindanao-Davao

Sunday, October 10, 2010

How to create animated sculpties for OpenSim in Blender part 2

In part 1 we have created the sculpty maps for an animated sculpty with Blender/Primstar. Now we will rez the animated sculpty in OpenSim.

I assume you have a running OpenSim server and know how to use a viewer like Imprudence or Hippo.





Prepare the Primstar box for rezzing the sculpty

     1. Build a box and name it "Primstar". Make sure the first letter P is capitalized.
     2. Take this box into your inventory.
     3. Build another box, we will call Box-X.
     4. Edit the Box-X and in the contents, drop the Primstar box into it.
     5. Upload all your sculpt maps from the previous tutorial.
     6. Drop the sculpt maps in Box-X contents.
     7. Create a new script inside Box-X.
     8. Open the lsl script exported by Primstar in an editor outside your OpenSim viewer e.g. gedit or notepad.
     9. Select all and copy.
   10. Paste the contents in the new script in Box-X in OpenSim and save.
   11. Close the OpenSimn editor.
   12. Box-X will ask for the permission to link objects. Answer “yes”.
   13. Click Box-X to generate your sculpty.

For additional information on creating multi-sculpties in Primstar please check out this tutorial: http://blog.machinimatrix.org/2010/04/02/sculpted-prims-part-iii/

Edit the sculpty. Delete extra appendages.

   14. You can now take Box-X to your inventory as we will no longer need it.
   15. In the horse example in this tutorial there will be a lot of legs. One sculpty prim for each leg.
   16. Unlink all the extra legs and delete. We only need the original. If you want you could've taken care of this during the baking of the sculpty in Blender/Primstar. Select only the original mesh and bake a new SL lsl file. Do not overwrite your animated sculpty lsl directory! You can use this second lsl file to generate the sculpty so you don't have to erase legs.
   17. Drop all of the leg sculpt maps in the horse.
   18. Create a new script in the contents of the horse.
   19. Copy and paste this trot lsl script I've written.

//Trot sculpty animation script. 
//Copyright (C) 2010 Roel Cantada.
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program.  If not, see .
//


string flegLrest="flegL"; //legs at rest or standing position
string flegRrest="flegR";
string hlegRrest="hlegR";
string hlegLrest="hlegL";


string flegLmap;
string flegRmap;
string hlegRmap;
string hlegLmap;


//make sure number of sculptmaps for all list are the same! Put all maps in the prim with the script.
list flegLsculpts=["flegL2", "fleg4", "flegL6", "flegL8"]; //left front leg frames
list flegRsculpts=["flegR2", "flegR4", "flegR6", "flegR8"]; //right front leg frames
list hlegRsculpts=["hlegL2", "hlegL4", "hlegL6", "hlegL8"]; //right hind leg  frames
list hlegLsculpts=["hlegR2", "hlegR4", "hlegR6", "hlegR8"]; //left hind leg  frames

integer count;
float speed=0.2; //speed of frame change in seconds
integer framelen = 4; //number of sculpt maps per leg


default
     {
     state_entry()
          {
          llSetTimerEvent(0);

//make sure the link number of the child prim is correct, 1 is the root prim and the rest are child prims.
//the last prim to be linked will be 2.
          llSetLinkPrimitiveParams(8,[PRIM_TYPE, PRIM_TYPE_SCULPT, flegLrest, PRIM_SCULPT_TYPE_CYLINDER]);
          llSetLinkPrimitiveParams(7,[PRIM_TYPE, PRIM_TYPE_SCULPT, flegRrest, PRIM_SCULPT_TYPE_CYLINDER]);
          llSetLinkPrimitiveParams(6,[PRIM_TYPE, PRIM_TYPE_SCULPT, hlegRrest, PRIM_SCULPT_TYPE_CYLINDER]);
          llSetLinkPrimitiveParams(5,[PRIM_TYPE, PRIM_TYPE_SCULPT, hlegLrest, PRIM_SCULPT_TYPE_CYLINDER]);
          }

     touch_start(integer num)
          {
          state walk; //switch to walk state
          }     
     }
     
state walk
     {
     state_entry()
         {
         llSetTimerEvent(speed);  //start trot
         }
    
     touch_start( integer num )        //stop trot
         {
         state default;
         }

     timer()
         {
         if (count == framelen) 
             {
             count=0;
             }
         flegLmap=llList2String(flegLsculpts, count);
         flegRmap=llList2String(flegRsculpts, count);
         hlegRmap=llList2String(hlegRsculpts, count);
         hlegLmap=llList2String(hlegLsculpts, count);

//make sure the link number of the child prim is correct, 1 is the root prim and the rest are child prims.
//the last prim to be linked will be 2.

          llSetLinkPrimitiveParams(8,[PRIM_TYPE, PRIM_TYPE_SCULPT, flegLmap, PRIM_SCULPT_TYPE_CYLINDER]);
          llSetLinkPrimitiveParams(7,[PRIM_TYPE, PRIM_TYPE_SCULPT, flegRmap, PRIM_SCULPT_TYPE_CYLINDER]);
          llSetLinkPrimitiveParams(6,[PRIM_TYPE, PRIM_TYPE_SCULPT, hlegRmap, PRIM_SCULPT_TYPE_CYLINDER]);
          llSetLinkPrimitiveParams(5,[PRIM_TYPE, PRIM_TYPE_SCULPT, hlegLmap, PRIM_SCULPT_TYPE_CYLINDER]);
         ++count;
         }

     }




   20. Make sure that the child prims' link numbers are in order. 1 is for root prim, 2 for the last prim to be linked etc.
   21. Click on the horse and watch it run. Click on it again to stop.

The trot script makes the horse run in place. There is still a need to probably merge this script with a drive script to make the thing run around OpenSim.

Have fun!


Downloads:

http://www.mediafire.com/file/iq5k1njwa5o0nby/animkabayo.iar (172.9 KB ) licenese under Creative Commons Attribution-ShareAlike 3.0 Philippines . Copyright (C) Roel Cantada 2010.

http://www.mediafire.com/file/8rrwq5u76aq1v2k/trot.lsl.zip (1.18 KB) licensed under GNU GPLv3.0. Copyright (C) Roel Cantada 2010.

Saturday, October 9, 2010

How to create animated sculpties for OpenSim in Blender part 1



Prerequisites: This tutorial assumes you know how to use Blender 2.49b with the Primstar plugin and OpenSim.


I found very little information on how to create animated sculpties in Blender in the Internet. What we need are sculpty maps for every frame of animation and an lsl script to change those maps in a loop.  In this part of this tutorial we will create the sculpty maps in Blender with the Primstar plugin.

I will not teach you how to model or rig meshes. I assume you already have a fully rigged sculpty mesh.



Create the sculpty in Blender/Primstar



     1. Select the object you wish to animate and copy (shift-d) in Blender Object mode.
     2. Move the copy to another layer
     3. Go to Blender pose mode and pose the copy
     4. Apply the armature modifier. The armature modifier is in the editing buttons group, modifier panel.



     5. Clear your transformations to reset the original. Blender pose mode Menu-Pose-Clear-Clear User Transform.



Notice that we did not use frames. The animated frames are separate object copies of the original sculptie mesh.





Warning: Do not move/transform the copy in Blender Object mode or the center will change. Change it only in Blender Pose Mode or Edit mode.

The copy will have the original UV image assigned to it. We will need to create new UV images for each copy.

     6. Select each new object
     7. Go to Blender Edit mode
     8. Select all vertices of the copy
     9. In the Blender UV/Image editor click Image-New. Create a 64x64 image and save.




Unfortunately this will be a labor intensive endevour if you use a lot of frames. It will also be prone to error. I hope someone could come up with an automatic way to do this.

Check your sculpty




Make sure the following requirements for baking multi-prim sculpties are followed:

     10. Go to Blender Object mode
     11. Select all objects
     12. Menu-Clear/Apply-Apply Scale/Rotation to ObData
     13. Check if you parented the original and copies to the root mesh. You can check this in the Blender Outliner window. There should only be the root mesh listed at the highest node of the tree.
     14. If you mirrored any of the parts then mirror the UV as well in the Blender UV/Image. Otherwise your sculpty will be inside out in OpenSim.
          a. Select the object mesh
          b. Select all vertices so that the UVs menu item will appear in the UV/Image editor
          c. Go to the UV/Image editor and select all the UV vertices. Your UV grid should be colored yellow.
          d. Click UV/Image editor-UVs-Mirror-X Axis (or Y Axis depending on how you mirrored the object mesh)

Bake the Sculpt Meshes

     1. Go to Blender Object mode
     2. Select all objects (including static parts)
     3. Blender top menu-Render-Bake Sculpt Meshes



     4. Check "Keep Center"




     5. Bake

Save the sculpty as an SL LSL file

     1. Click on Blender top menu-File-Export-Second Life LSL (to dir)

You should have an lsl file and the sculpt maps.

Note that I did not included the textures of the sculpty. For information on texturing sculpty meshes in Primstar see  http://blog.machinimatrix.org/2010/03/10/sculpted-prims-ii-blenderjass2/.

Part two will deal with rezzing the animated sculpty in OpenSim.

Downloads:

The example here uses the Alex horse rig by Wayne Dixon which is licensed under the Creative Commons Attribution 2.5 Australia
http://creativecommons.org/licenses/by/2.5/au/ and can be downloaded at http://www.blendswap.com/3D-models/animals/alex-2-5-2/.


Horse mesh by Roel Cantada copyright 2010.
Creative Commons Attribution-ShareAlike 3.0 Philippines 



http://www.mediafire.com/file/2jdvjrtwlczjtvq/animsculptkabayo.blend.zip (1.1 MB)

Tuesday, October 5, 2010

Garrote prim object

The garrote is a humane execution machine, at least in the same sense as a guillotine.  Humane here is measured in terms of speed of death rather than justice. Contrary to popular belief it is not meant to slowly strangle the victim but to sever the spinal cord with a spike or metal blade attached to the screw. Unfortunately if the executioner do not know how to operate it, it may take a few more tries.


 This is a good example of using Virtual Worlds for NPIRL historical situations. One application is to "garrote" your students when they fail your tests ;-).


In the downloads below I used a basic sit script by Mo Hax posted here http://www.osgrid.org/forums/viewtopic.php?f=5&t=91&start=0. You can replace that with your own sit script.



Downloads

http://www.mediafire.com/file/cobpah7vdlrn8b1/garrote.iar (202.18 KB )

http://www.mediafire.com/file/bn1b6sfo178bz6j/garrote_xml.zip (198.5 KB )

Copyright Roel Cantada 2010
 
Creative Commons License
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License.