O'Reilly Hacks
oreilly.comO'Reilly NetworkSafari BookshelfConferences Sign In/My Account | View Cart   
Book List Learning Lab PDFs O'Reilly Gear Newsletters Press Room Jobs  



Giving a PowerPoint Presentation in Second Life
If you ever plan to give a talk or presentation in Second Life, you might want to back yourself up with something like a Microsoft(R) PowerPoint(R) presentation. The problem here is that you can't import a PowerPoint(R) presentation into Second Life. Except you can.

Contributed by:
andrewburton
[01/27/06 | Discuss (9) | Link to this hack]

If you ever plan to give a talk or presentation in Second Life, you might want to back yourself up with something like a Microsoft(R) PowerPoint(R) presentation. The problem here is that you can't import a PowerPoint(R) presentation into Second Life.

Except you can.

PowerPoint(R) allows you to export presentation slides as GIF, JPEG, or PNG files. To give your presentation in Second Life, you need to export all the frames as JPEG files. Next, upload the frames to your inventory -- this will cost you L$10 per image, so make sure you have enough for the whole presentation.

Once your images are uploaded as textures, create a new cubical prim. Resize your prim so that one dimension is 3.2 meters and another is 2.4 meters. The size is really up to you, but the 4-to-3 ratio is how most monitors, and thus most PowerPoint(R) frames, are sized. Following this ratio will keep your frames from being distorted.

With your prim sized, copy the uploaded textures from your inventory into the inventory of the prim in order of how you want them to appear. PowerPoint(R) will name the images Slide1, Slide2, etc., which means keeping them in order should be easy enough.

Now that all your slides are in the prim, it's time to do a bit of programming. Don't worry, I've included all the code you'll need in the hack. Click on the "New Script" button. When the script editor appears, delete everything in that window and replace it with the collowing LSL code:

'----- START CODE BLOCK -----

integer invCount;
integer invLoopCount;

default
{
    state_entry()
    {
        invCount = llGetInventoryNumber(INVENTORY_TEXTURE);
    }

    touch_start(integer total_number)
    {                
        llSetTexture(llGetInventoryName(INVENTORY_TEXTURE, invLoopCount), ALL_SIDES);
        
        invLoopCount++;
        
        if (invLoopCount == invCount)
        {
            invLoopCount = 0;
        }
    }
}

'----- END CODE BLOCK -----

Save the script. If you've typed everything in properly, it should start automatically. (If it gives you an error, go back and compare what you types against this code.) The prim won't appear any different at first. Go on and close both the script editor and the prim editor windows. Now you're ready.

To view your presentation, touch the prim. The very first slide should appear on all the faces of the prim. Another touch will display the second slide, and so forth. When you reach the final slide, another touch will take you back to the beginning of your presentation.

NOTE: If you to use this for another presentation, or just add slides to this presentation, delete just the slides in the prim inventory. Then add your new presentation slides. With the new slide textures in place, simply resetting the script will allow you to cycle through the new presentation.


O'Reilly Home | Privacy Policy

© 2007 O'Reilly Media, Inc.
Website: | Customer Service: | Book issues:

All trademarks and registered trademarks appearing on oreilly.com are the property of their respective owners.