Viewer for POLYGONS with holes (ph)

Does anybod know a viewer which is able to show a collada file with polygons which have holes?

Here is my simple example with a quad which has a smaller quad as a hole inside. Unfortunately i can’t open in a viewer, but i can import it in maya and it works fine.


<?xml version="1.0" encoding="utf-8"?>
<COLLADA xmlns="http://www.collada.org/2005/11/COLLADASchema" version="1.4.1">
  <asset>
    <contributor>
      <author>trisha</author>
      <authoring_tool>COLLADA Maya2008</authoring_tool>
      <comments>ColladaMaya export options: bakeTransforms=0;exportPolygonMeshes=1;bakeLighting=0;isSampling=0;
curveConstrainSampling=0;removeStaticCurves=1;exportCameraAsLookat=0;
exportLights=1;exportCameras=1;exportJointsAndSkin=1;
exportAnimations=1;exportTriangles=0;exportInvisibleNodes=0;
exportNormals=1;exportTexCoords=1;
exportVertexColors=1;exportVertexColorsAnimation=0;exportTangents=0;
exportTexTangents=0;exportConstraints=1;exportPhysics=1;exportXRefs=0;
dereferenceXRefs=1;cameraXFov=0;cameraYFov=1</comments>
      <source_data>hole.mb</source_data>
    </contributor>
    <created>2008-06-05T17:17:06Z</created>
    <modified>2008-06-05T17:17:06Z</modified>
    <unit name="centimeter" meter="100"/>
    <up_axis>Y_UP</up_axis>
  </asset>
  <library_materials>
    <material id="phong1" name="phong1">
      <instance_effect url="#phong1-fx"/>
    </material>
  </library_materials>
  <library_effects>
    <effect id="phong1-fx">
      <profile_COMMON>
        <technique sid="common">
          <phong>
            <emission>
              <color>0 0 0 1</color>
            </emission>
            <ambient>
              <color>0 0 0 1</color>
            </ambient>
            <diffuse>
              <color>0.4888 0.152898 0.046436 0.8</color>
            </diffuse>
            <specular>
              <color>0.5 0.5 0.5 1</color>
            </specular>
            <shininess>
              <float>20</float>
            </shininess>
            <reflective>
              <color>0 0 0 1</color>
            </reflective>
            <reflectivity>
              <float>0.5</float>
            </reflectivity>
            <transparent opaque="RGB_ZERO">
              <color>0 0 0 1</color>
            </transparent>
            <transparency>
              <float>1</float>
            </transparency>
          </phong>
        </technique>
      </profile_COMMON>
    </effect>
  </library_effects>
  <library_geometries>
    <geometry id="geom-LOD3spShape" name="LOD3spShape">
      <mesh>
        <source id="geom-LOD3spShape-positions">
          <float_array id="geom-LOD3spShape-positions-array" count="24">0 0 0 10 0 0 10 10 0 0 10 0 2 2 0 7 2 0 7 7 0 2 7 0</float_array>
          <technique_common>
            <accessor source="#geom-LOD3spShape-positions-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="geom-LOD3spShape-normals">
          <float_array id="geom-LOD3spShape-normals-array" count="24">0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1</float_array>
          <technique_common>
            <accessor source="#geom-LOD3spShape-normals-array" count="8" stride="3">
              <param name="X" type="float"/>
              <param name="Y" type="float"/>
              <param name="Z" type="float"/>
            </accessor>
          </technique_common>
        </source>
        <vertices id="geom-LOD3spShape-vertices">
          <input semantic="POSITION" source="#geom-LOD3spShape-positions"/>
        </vertices>
        <polygons material="phong1SG" count="1">
          <input semantic="VERTEX" source="#geom-LOD3spShape-vertices" offset="0"/>
          <ph>
            

0 1 2 3</p>
            <h>4 7 6 5</h>
          </ph>
        </polygons>
      </mesh>
      <extra>
        <technique profile="MAYA">
          <double_sided>1</double_sided>
        </technique>
      </extra>
    </geometry>
  </library_geometries>
  <library_visual_scenes>
    <visual_scene id="hole">
      <node id="LOD3sp" name="LOD3sp" type="NODE">
        <translate sid="translate">0 0 0</translate>
        <rotate sid="rotateZ">0 0 1 0</rotate>
        <rotate sid="rotateY">0 1 0 0</rotate>
        <rotate sid="rotateX">1 0 0 0</rotate>
        <scale sid="scale">1 1 1</scale>
        <instance_geometry url="#geom-LOD3spShape">
          <bind_material>
            <technique_common>
              <instance_material symbol="phong1SG" target="#phong1"/>
            </technique_common>
          </bind_material>
        </instance_geometry>
      </node>
    </visual_scene>
  </library_visual_scenes>
  <scene>
    <instance_visual_scene url="#hole"/>
  </scene>
</COLLADA>

Not surprising it is difficult to find a viewer that display polygon with holes.

COLLADA is designed to be able to represent data that is close to the representation in tools (such as polygons, although most DCC tools do not support the notion of hole), and to be able to represent the data in a way that is close to the hardware (such as triangle / triangle strips).

This is the job of the content pipeline to convert the data from the DCC friendly form into the form friendly to the application. Please check the conditioners/refinery on sourceforge.