Difference between revisions of "Showing Shared Media at the right aspect ratio"

From Second Life Wiki
Jump to navigation Jump to search
m (Text replace - '{{KBmaster}}' to '<noinclude>{{KBmaster}}</noinclude>')
Line 1: Line 1:
{{KBmaster}} {{TOCright}}
<noinclude>{{KBmaster}}</noinclude> {{TOCright}}


[[Shared Media]] is setup to show square media. However, you can '''change this to fit any aspect ratio'''. Doing so isn't instant and could probably be easier in the future. There are three key things you need to know and do:
[[Shared Media]] is setup to show square media. However, you can '''change this to fit any aspect ratio'''. Doing so isn't instant and could probably be easier in the future. There are three key things you need to know and do:

Revision as of 11:44, 26 October 2010

Shared Media is setup to show square media. However, you can change this to fit any aspect ratio. Doing so isn't instant and could probably be easier in the future. There are three key things you need to know and do:

  1. The media's exact dimensions in pixels.
  2. The offset alignment of the media — calculated with an Align button.
  3. The aspect ratio of the media — easily calculated using a tool, as we'll see.

What works?

This page presumes you already know how to add Shared Media to an object and have the URL ready entered. This kind of content works (this isn't a complete list, just examples):

  • Direct links to a supported image type like an animated GIF, JPG, or PNG.
    • By the way, we used to need special converters to show animated GIFs in Second Life as textures, and they'd appear at reduced quality. Now, you can show them as-intended.
  • Rich interactive media like Flash that's isolated on a page.
    • This technique is likely to fail if there's a page with a Flash media embedded in the middle of whole bunch of other stuff, but usually works if the Flash media is the only thing on the page.
  • data: URIs that fall under the above. data: URIs save you time by letting you show content without having to upload a webpage to a server.

Watch this easy video tutorial to see how it all works in action, then as-needed, follow the text steps below:

<videoflash type="youtube">29aVwgvLdkE|640|385</videoflash>

Finding and applying the media's dimensions

First, view the media in an external web browser.

  • If it's an image, most browsers show the size in pixels (like 500x375) in the title bar.
  • If it's Flash media or something else, try viewing the page source (usually available as a context menu option if you right-click the page). Try this example and look for where it says height="433" width="720". Specified dimensions are highly typical in Flash media embed code.

Once you have those dimensions, in the Second Life Viewer:

  1. Right-click the prim and choose Edit.
  2. In the build tools that appear, click the Texture tab.
  3. Click Select face.
  4. Near the bottom-right corner, click the gear icon.
  5. Under the MEDIA SETTINGS' General tab, uncheck Auto Scale Media on Face of Object.
  6. Enter the exact size in the Size fields.
  7. Click OK.

Aligning the media

This is easy. Back in the Texture tab of the build tools, click Align. You should see the media wrap and "hug" the full face of the prim. If it doesn't, there may be elements on the media's source page that interfere with positioning.

Entering the aspect ratio

In your web browser, do a pixels-to-meters conversion:

  1. Open a calculator like the cleverly-named Aspect Ratio Calculator or the Continuum Javascript Ratio Calculator.
  2. In one set of boxes, enter the pixel dimensions of the media you used earlier.
  3. In the other set of boxes, enter one of the desired dimensions of the prim (up to 10.000m for a non-megaprim dimension). The calculator gives you the other number.

Back in the Viewer:

  1. Still in the Object tab of the build tools, enter that second set of metric numbers. The prim resizes and the media should appear at the right aspect ratio without undesired squashing/stretching.

You can tweak the prim further (Torley recommends making a Shared Media template), but you're basically done!