Mesh/Decomposing a mesh for physics shape

From Second Life Wiki
Jump to navigation Jump to search


MeshWalkthrough-Decomposing Physics-Splash.png

This walkthrough will go through how to make the physical shape that can be bumped into.

One key thing to understand first is that the model that you see and the model that you bump into can be defined by different meshes. We're ideally looking to make a physical shape that is only detailed enough to give the illusion that you are bumping into the shape that you see, because if the physical shape is extremely detailed, the simulator will slow down when the model collides with objects or avatars.

Obtain a Second Life compatible mesh file

The first step is to get a mesh file onto your computer that you want to upload to SL. SL's mesh import is able to read COLLADA (".dae") files. For the purposes of creating a physics shape, you can pretty much use any model that you can successfully import into SL, so we'll use the basic duck here.


Upload the mesh file to Second Life

Import Model Menu

Next, take the file that you downloaded to your computer and upload it to SL. (Note that during beta, uploading is free!)

  • Open the main menu "Build" menu, choose "Upload", click "Model...".
    (Alternately, open your Inventory View, click the "+" menu button, "Upload" > "Model...").
    This will cause a file dialog box will open.
  • Find and select the "duck.dae" file from your computer.
    The Import Model window will then appear.
  • Click the "Generate LOD" button at the top of this window.
    The viewer will take a moment to process this.
Physics Representation
  • Find the drop down item called "Physical Shape", choose "Triangle Limit".
    A text field will appear to enter the triangle limit, and the preview will show a single triangle.
  • Type "500" into the text field and then hit enter.
    Note: You can choose a different number, although using a very large number will cause the next steps to take longer to process. 500 is high enough to make a good approximation of the duck shape for most physics purposes.
  • A duck will appear in the preview window, at lower resolution than your original duck.
    This is just the physics representation; it doesn't mean that your duck will appear in-world in that low resolution.
Physics Decomposition Menu
  • Click the >> button next to "Physical Shape" to open the "Physics Decomposition" tool window.
  • In the "Physics Decomposition" tool window, set the "Decompose Quality" dropdown to "Normal".
  • Set the "Method" dropdown to "Surface".
  • Click the "Decompose" button.
Decomposition Results
  • The viewer will take a few seconds to process
  • Slide the Explode slider to see the Decomposed shape. (The explode slider does not change the Decomposed shape, it only moves it away from the Mesh visually so you can see it clearly.)

MeshWalkthrough-Explode view.png

  • Slide the Detail Scale to 0.075
  • Set Simplify Method = Detail
  • Click Simplify
  • The Decomposed pieces are simplified into a few objects.

MeshWalkthrough-Simplify.png

  • Click the Upload button to upload the mesh with this simplified Physics Shape.
  • Rez the Model
  • Enable the Develop menu with ctrl-alt-q
  • Enable Develop menu > Render Metadata > Physics Shapes

MeshWalkthrough-Physics Shapes setting.png

  • Objects will display a color overlay. A blue overlay indicates the

object's physics are efficient and will produce very little load on the sim. A red overlay indicates the object could potentially cause high physics lag on the region.

MeshWalkthrough-Physics Shape efficiency visualized.png