Jump to content
Sign in to follow this  
xertz3173

3D max triangulated Physics shape problem

Recommended Posts

Hi :)

Today i was trying to explain to xertz how to make triangle based physics shape (not Analyzed in the uploader) for the walls of a house he was making . When he uploaded a test with a couple of planes on either side of one of the walls and setting the build to Physics shape Prim the physics were wrong .

We had a look at the Physics shapes Develop>Render Metadata>Show Physics) and saw that the 2 planes he had made for the physics wall had collapsed into one large plane which had been scaled up and set at an angle to cover the area of the whole house!

So i suggested that we both create a cube , me in Blender and xertz in 3D max and then in a seperate mesh create 2 planes to represent the physics shapes of an inner and outer wall. The blender physics shape came out as expected when set to Physics type Prim in the features tab of the Edit window but the 3D max version had again collapsed the 2 planes to the center. See screenshots below :3D max question.png

Why is this happening for the physics mesh ? The mesh of the actual house xertz uploads is perfect its only the Physics planes that get " corrupted "

 

Edited to add:

Some of you may have read http://community.secondlife.com/t5/Mesh/Making-physics-HELP/td-p/1750777/page/2 messages 12 to 19 and wonder why I was suggesting to anyone to use triangle based physics shapes (not analysed) for the walls of a building .

Well i made a mock-up of xertz's house to see what kind of LI count he should get when the physics shapes had been set to prim.

Octagonal House.png

First i made a physics mesh using NON Overlapping boxes and used that in the uploader and Analyzed it. When set to Physics Shape : Prim the LI was 18.

Oct house box physics.PNG

Next I tried using planes , (one on each side of the walls ) used that in the Upoader and because of the thread I Linked to above I Analyzed this version aswell  :) When set to Physics Shape : Prim the LI = 16 .

Oct house plane physics.PNG

I didn't want to stop without at least trying the NON Analyzed triangle based shape so uploaded a third time using the Planes physics mesh and NOT Analyzing it . Set to  Physics Shape : Prim the LI had dropped to 7 :)

and for about 30 seconds the physics of this house was working perfectly ......... then the physics disapeared , i could walk through all the walls . After alot of messing about and maybe was only a coincidence but i found that if i linked the house to a prim cube as root . took back into my inventory, rerezzed, unlinked, the house physics was ok again but switched to being "phantom" a couple of times  after that. but later it did seem stable .

I logged into the beta (Natoma) later and the physics was ok all the times i was there , perhaps 3 hours +

Note, when the house appeared to have switched itself to "phantom" and in Show Physics the physics shape had disapeared I still heard the collision sounds made as my avatar walked through the walls.

Another Note: At no time when the physics were behaving themselves was i UNABLE to walk through the door openings which was th problem in the ealier thread as mentioned in the Link above.

One strange thing to add, one time when the non Analysed  7 LI house was rezzed and I thought the physics was borked again , ie I was able to walk through the walls someone else at the same time found that for him the physics were acting as they should be !

Sorry about this long post , but others have posted strange happenings with physics lately . Please don't let this deviate you from answering Xertz original question .

Share this post


Link to post
Share on other sites
Hi Drongle McMahon .here the Physics plane collada (dae)file
 
 
<?xml version="1.0" encoding="utf-8"?>
<COLLADA xmlns="http://www.collada.org/2005/11/COLLADASchema" version="1.4.0">
  <asset>
    <contributor>
      <author></author>
      <authoring_tool>FBX COLLADA exporter</authoring_tool>
      <comments></comments>
    </contributor>
    <created>2012-12-09T06:07:24Z</created>
    <modified>2012-12-09T06:07:24Z</modified>
    <revision></revision>
    <title></title>
    <subject></subject>
    <keywords></keywords>
    <unit meter="0.025400"/>
    <up_axis>Z_UP</up_axis>
  </asset>
  <library_geometries>
    <geometry id="Plane001-lib" name="Plane001Mesh">
      <mesh>
        <source id="Plane001-lib-Position">
          <float_array id="Plane001-lib-Position-array" count="12">
-83.284119 78.615768 0.462189
-83.284149 -78.615768 0.462189
-83.284088 78.615768 156.550232
-83.284119 -78.615768 156.550232
</float_array>
          <technique_common>
            <accessor source="#Plane001-lib-Position-array" count="4" stride="3">
              <param name="X" type="float"/>
              <param name="Y" type="float"/>
              <param name="Z" type="float"/>
            </accessor>
          </technique_common>
        </source>
        <source id="Plane001-lib-Normal0">
          <float_array id="Plane001-lib-Normal0-array" count="18">
-1.000000 0.000000 0.000000
-1.000000 0.000000 0.000000
-1.000000 0.000000 0.000000
-1.000000 0.000000 0.000000
-1.000000 0.000000 0.000000
-1.000000 0.000000 0.000000
</float_array>
          <technique_common>
            <accessor source="#Plane001-lib-Normal0-array" count="6" stride="3">
              <param name="X" type="float"/>
              <param name="Y" type="float"/>
              <param name="Z" type="float"/>
            </accessor>
          </technique_common>
        </source>
        <source id="Plane001-lib-UV0">
          <float_array id="Plane001-lib-UV0-array" count="8">
0.000000 0.000000
1.000000 0.000000
0.000000 1.000000
1.000000 1.000000
</float_array>
          <technique_common>
            <accessor source="#Plane001-lib-UV0-array" count="4" stride="2">
              <param name="S" type="float"/>
              <param name="T" type="float"/>
            </accessor>
          </technique_common>
        </source>
        <vertices id="Plane001-lib-Vertex">
          <input semantic="POSITION" source="#Plane001-lib-Position"/>
        </vertices>
        <polygons count="2">
          <input semantic="VERTEX" offset="0" source="#Plane001-lib-Vertex"/>
          <input semantic="NORMAL" offset="1" source="#Plane001-lib-Normal0"/>
          <input semantic="TEXCOORD" offset="2" set="0" source="#Plane001-lib-UV0"/>
          <p>0 0 0 1 1 1 3 2 3</p>
          <p>3 3 3 2 4 2 0 5 0</p>
        </polygons>
      </mesh>
    </geometry>
    <geometry id="Plane002-lib" name="Plane002Mesh">
      <mesh>
        <source id="Plane002-lib-Position">
          <float_array id="Plane002-lib-Position-array" count="12">
83.284111 78.615768 0.462189
83.284157 -78.615768 0.462189
83.284081 78.615768 156.550232
83.284126 -78.615768 156.550232
</float_array>
          <technique_common>
            <accessor source="#Plane002-lib-Position-array" count="4" stride="3">
              <param name="X" type="float"/>
              <param name="Y" type="float"/>
              <param name="Z" type="float"/>
            </accessor>
          </technique_common>
        </source>
        <source id="Plane002-lib-Normal0">
          <float_array id="Plane002-lib-Normal0-array" count="18">
-1.000000 -0.000000 -0.000000
-1.000000 -0.000000 -0.000000
-1.000000 -0.000000 -0.000000
-1.000000 -0.000000 -0.000000
-1.000000 -0.000000 -0.000000
-1.000000 -0.000000 -0.000000
</float_array>
          <technique_common>
            <accessor source="#Plane002-lib-Normal0-array" count="6" stride="3">
              <param name="X" type="float"/>
              <param name="Y" type="float"/>
              <param name="Z" type="float"/>
            </accessor>
          </technique_common>
        </source>
        <source id="Plane002-lib-UV0">
          <float_array id="Plane002-lib-UV0-array" count="8">
0.000000 0.000000
1.000000 0.000000
0.000000 1.000000
1.000000 1.000000
</float_array>
          <technique_common>
            <accessor source="#Plane002-lib-UV0-array" count="4" stride="2">
              <param name="S" type="float"/>
              <param name="T" type="float"/>
            </accessor>
          </technique_common>
        </source>
        <vertices id="Plane002-lib-Vertex">
          <input semantic="POSITION" source="#Plane002-lib-Position"/>
        </vertices>
        <polygons count="2">
          <input semantic="VERTEX" offset="0" source="#Plane002-lib-Vertex"/>
          <input semantic="NORMAL" offset="1" source="#Plane002-lib-Normal0"/>
          <input semantic="TEXCOORD" offset="2" set="0" source="#Plane002-lib-UV0"/>
          <p>0 0 0 1 1 1 3 2 3</p>
          <p>3 3 3 2 4 2 0 5 0</p>
        </polygons>
      </mesh>
    </geometry>
  </library_geometries>
  <library_visual_scenes>
    <visual_scene id="RootNode" name="RootNode">
      <node id="Plane001" name="Plane001">
        <matrix sid="matrix">1.000000 0.000000 0.000000 0.000000 0.000000 1.000000 0.000000 -0.000000 0.000000 0.000000 1.000000 0.000000 0.000000 0.000000 0.000000 1.000000</matrix>
        <instance_geometry url="#Plane001-lib"/>
      </node>
      <node id="Plane002" name="Plane002">
        <matrix sid="matrix">1.000000 0.000000 0.000000 0.000000 0.000000 1.000000 0.000000 0.000000 0.000000 0.000000 1.000000 0.000000 0.000000 0.000000 0.000000 1.000000</matrix>
        <instance_geometry url="#Plane002-lib"/>
      </node>
    </visual_scene>
  </library_visual_scenes>
  <scene>
    <instance_visual_scene url="#RootNode"/>
  </scene>
</COLLADA>
 
 
 
Here my mesh model Collada (dae) file
 
 
<?xml version="1.0" encoding="utf-8"?>
<COLLADA xmlns="http://www.collada.org/2005/11/COLLADASchema" version="1.4.0">
  <asset>
    <contributor>
      <author></author>
      <authoring_tool>FBX COLLADA exporter</authoring_tool>
      <comments></comments>
    </contributor>
    <created>2012-12-09T06:07:24Z</created>
    <modified>2012-12-09T06:07:24Z</modified>
    <revision></revision>
    <title></title>
    <subject></subject>
    <keywords></keywords>
    <unit meter="0.025400"/>
    <up_axis>Z_UP</up_axis>
  </asset>
  <library_geometries>
    <geometry id="Box001-lib" name="Box001Mesh">
      <mesh>
        <source id="Box001-lib-Position">
          <float_array id="Box001-lib-Position-array" count="24">
-78.740158 -78.740158 0.000000
78.740158 -78.740158 0.000000
-78.740158 78.740158 0.000000
78.740158 78.740158 0.000000
-78.740158 -78.740158 157.480316
78.740158 -78.740158 157.480316
-78.740158 78.740158 157.480316
78.740158 78.740158 157.480316
</float_array>
          <technique_common>
            <accessor source="#Box001-lib-Position-array" count="8" stride="3">
              <param name="X" type="float"/>
              <param name="Y" type="float"/>
              <param name="Z" type="float"/>
            </accessor>
          </technique_common>
        </source>
        <source id="Box001-lib-Normal0">
          <float_array id="Box001-lib-Normal0-array" count="108">
0.000000 0.000000 -1.000000
0.000000 0.000000 -1.000000
0.000000 0.000000 -1.000000
0.000000 0.000000 -1.000000
0.000000 0.000000 -1.000000
0.000000 0.000000 -1.000000
0.000000 0.000000 1.000000
0.000000 0.000000 1.000000
0.000000 0.000000 1.000000
0.000000 0.000000 1.000000
0.000000 0.000000 1.000000
0.000000 0.000000 1.000000
0.000000 -1.000000 0.000000
0.000000 -1.000000 0.000000
0.000000 -1.000000 0.000000
0.000000 -1.000000 0.000000
0.000000 -1.000000 0.000000
0.000000 -1.000000 0.000000
1.000000 0.000000 0.000000
1.000000 0.000000 0.000000
1.000000 0.000000 0.000000
1.000000 0.000000 0.000000
1.000000 0.000000 0.000000
1.000000 0.000000 0.000000
0.000000 1.000000 0.000000
0.000000 1.000000 0.000000
0.000000 1.000000 0.000000
0.000000 1.000000 0.000000
0.000000 1.000000 0.000000
0.000000 1.000000 0.000000
-1.000000 0.000000 0.000000
-1.000000 0.000000 0.000000
-1.000000 0.000000 0.000000
-1.000000 0.000000 0.000000
-1.000000 0.000000 0.000000
-1.000000 0.000000 0.000000
</float_array>
          <technique_common>
            <accessor source="#Box001-lib-Normal0-array" count="36" stride="3">
              <param name="X" type="float"/>
              <param name="Y" type="float"/>
              <param name="Z" type="float"/>
            </accessor>
          </technique_common>
        </source>
        <source id="Box001-lib-UV0">
          <float_array id="Box001-lib-UV0-array" count="48">
1.000000 0.000000
0.000000 0.000000
1.000000 1.000000
0.000000 1.000000
0.000000 0.000000
1.000000 0.000000
0.000000 1.000000
1.000000 1.000000
0.000000 0.000000
1.000000 0.000000
0.000000 1.000000
1.000000 1.000000
0.000000 0.000000
1.000000 0.000000
0.000000 1.000000
1.000000 1.000000
0.000000 0.000000
1.000000 0.000000
0.000000 1.000000
1.000000 1.000000
0.000000 0.000000
1.000000 0.000000
0.000000 1.000000
1.000000 1.000000
</float_array>
          <technique_common>
            <accessor source="#Box001-lib-UV0-array" count="24" stride="2">
              <param name="S" type="float"/>
              <param name="T" type="float"/>
            </accessor>
          </technique_common>
        </source>
        <vertices id="Box001-lib-Vertex">
          <input semantic="POSITION" source="#Box001-lib-Position"/>
        </vertices>
        <polygons count="12">
          <input semantic="VERTEX" offset="0" source="#Box001-lib-Vertex"/>
          <input semantic="NORMAL" offset="1" source="#Box001-lib-Normal0"/>
          <input semantic="TEXCOORD" offset="2" set="0" source="#Box001-lib-UV0"/>
          <p>0 0 0 2 1 2 3 2 3</p>
          <p>3 3 3 1 4 1 0 5 0</p>
          <p>4 6 4 5 7 5 7 8 7</p>
          <p>7 9 7 6 10 6 4 11 4</p>
          <p>0 12 8 1 13 9 5 14 11</p>
          <p>5 15 11 4 16 10 0 17 8</p>
          <p>1 18 12 3 19 13 7 20 15</p>
          <p>7 21 15 5 22 14 1 23 12</p>
          <p>3 24 16 2 25 17 6 26 19</p>
          <p>6 27 19 7 28 18 3 29 16</p>
          <p>2 30 20 0 31 21 4 32 23</p>
          <p>4 33 23 6 34 22 2 35 20</p>
        </polygons>
      </mesh>
    </geometry>
  </library_geometries>
  <library_visual_scenes>
    <visual_scene id="RootNode" name="RootNode">
      <node id="Box001" name="Box001">
        <matrix sid="matrix">1.000000 0.000000 0.000000 0.000000 0.000000 1.000000 0.000000 0.000000 0.000000 0.000000 1.000000 0.000000 0.000000 0.000000 0.000000 1.000000</matrix>
        <instance_geometry url="#Box001-lib"/>
      </node>
    </visual_scene>
  </library_visual_scenes>
  <scene>
    <instance_visual_scene url="#RootNode"/>
  </scene>
</COLLADA>
 
 

Share this post


Link to post
Share on other sites

Did you clicked "Analyze" and set it to Prim ? Mine are blue. I will quote Drongle here:

I don’t know the actual numbers, but the color indicates the magnitude of the physics weight, that is the strain it puts on the physics engine. Blue is nice and simple, going from green to yellow to orange to red as the weight becomes excessive.

It shows you that the default convex hull is smaller than it should be!

 

Share this post


Link to post
Share on other sites

 i upload your dae file u upload here and i no clicked "Analyze" and set to prim is blue 

and i do myself the mesh and two plane..no clicked "Analyze" and set to prim is red . lol

Share this post


Link to post
Share on other sites

Hmm the only difference between both files is in the scale of the boxes/phys planes. Try scaling all down and resetting the xforms. Other than that .. mystery :)

Share this post


Link to post
Share on other sites

Various problems evident from the collada files...

1. The visible file contains only one mesh object (collada <node>) while the physics file has two, one for each plane. The uploader tries to match each mesh object in the high LOD mesh file with one in the lower LOD and the physics files. If there aren't enough, it will give you an error, missing LOD. If there are too many, it will omit the extra ones. So in this case, it just uses one of the meshes from the physics file, which is only one plane. You can use two planes. They don't need to be connected, but they must be parts of the same mesh (as Maniac suggested).

2. Now if you join the two planes into one mesh, we encounter another problem. Your planes are not completely flat. I recently reported a bug with triangle-based flat planes, in which very small deviations from complete flatness of simple flat planes could cause huge increases in physics weight, up to 10000 and more. The effect gets smaller as the deviation gets larger. The bug was recognised as a fault in the physics weight calculation, but was closed as "Unactionable" on the grounds that a fix might break existing content. In your case, the unflatness is giving you a smaller invrease. If you make the planes completely flat, the physics weght drops below 1.

As far as my investigations went, this problem is mitigated (though possibly not completely removed) when you have joined triangles ar substantial angles. So if you join up the separate walls in your physics shape for your building, the problem should go away.

3. Both your planes are facing the same direction. I have only recently come across a new problem which I suspect is from recent changes to the physics engine, where it is easy to walk through a triangle-based shape from the back (in the direction of the normal), while it is impenetrable from the front. So with this kind of double-skinned wall, it is advisable to make normals point outward from the wall o both sides.

 PS - you can hide things like the collada files inside a spoiler tag - the smiley with a hand over its eyes.

Share this post


Link to post
Share on other sites

Hi :)

Now xertz has his question answered perhaps you can consider mine .

The door openings in the octagonal house I mocked up (using planes as physics shapes for the walls and NOT Analysed in the uploader) allow me to walk through even though the wall thickness's is les than 0.5m. If you remember from last week (link in my first post of this thread) using the same method for creating a physics shape I was UNABLE to walk through the opening if the space between the 2 physics planes was less than 0.5m .

opening physics ok why .png

I re-uploaded the wall this morning to see if something had changed and no, if it is less than 0.5m I am unable to walk through the opening ?

So my question is why does the openings work in a complete building but not in a single wall.

Note: the red/white/green thing is my measuring block, intervals set at 0.1m .

Share this post


Link to post
Share on other sites

The physics shape type of any mesh object is invisibly changed to Convex Hull on the server if any dimension is less than 0.5m. This does not show up in the physics shape display, or in the edit dialog, but it does stop you walking through concave openings like doors. If your mesh is just one wall like this, it will be 0.5m when the planes are 0.5. apart. If the mesh contains other walls that are not in the same plane, it will remain much bigger even though the individual walls may be less than 0,5m apart. So then the limit is not reached.

The 0.5m limit is presumably imposed to limit stress on the physics engine in the general case. I don't think thinner walls like this actually have any different resource consumptionj whether they are 0.01 or 1 m thick. It's still just the same triamgles. So flat walls suffer as a side effect. The limit used to be 0.1m, but was changed some time after mesh release. I imagine that was because of data collected after release that indicsted a higher limit was justified.

Share this post


Link to post
Share on other sites

ok, I guess I missed that bit about the overall mesh size and not individual walls was what mattered in the other thread.

Thanks again for explaining :)

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...