[WF-Protocols] first attempt with xml schema
Matze Braun
matze at braunis.de
Sun Jul 6 22:09:22 PDT 2003
Hi,
to get things a bit more concrete I started creating a xml schema
definition for parts of the spec. You can find the files here:
http://www.stud.uni-karlsruhe.de/~uxsm/omf.xsd
http://www.stud.uni-karlsruhe.de/~uxsm/material.xsd
http://www.stud.uni-karlsruhe.de/~uxsm/mesh.xsd
http://www.stud.uni-karlsruhe.de/~uxsm/model.xsd
http://www.stud.uni-karlsruhe.de/~uxsm/skelton.xsd
http://www.stud.uni-karlsruhe.de/~uxsm/test.xml
An examplefile looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<model xmlns="http://www.stud.uni-karlsruhe.de/~uxsm/omf"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.stud.uni-karlsruhe.de/~uxsm/omf
omf.xsd"
name="Hugo The Testmodel">
<mesh name="Head" material="sunnyface">
<vertices>
<v x="-1" y="-1" z="-1"/>
<v x="1" y="-1" z="-1"/>
<v x="-1" y="1" z="-1"/>
<!-- More vertices come here. -->
</vertices>
<normals>
<!-- This sections assigns normals to vertices:
-The first normal belongs to the first vertex...
-Normals have to be normalized :)
-->
<n x="1" y="0" z="0"/>
<n x="0" y="1" z="0"/>
<n x="0" y="0" z="1"/>
</normals>
<texturecoords>
<!-- The texturecoordinates assign UV coordinates to vertices:
-The first texture coord belongs to the first vertex the 2nd
texture
coord to the 2nd vertex...
-You might have several texturecoords sections. You may specify
exactly
which textureunit to use as attribute in the texturecoords
section
-->
<t u="0" v="0"/>
<t u="0" v="1"/>
<t u="1" v="1"/>
</texturecoords>
<polygons>
<p>0 1 2</p>
<!-- More polygons come here. Notes:
-Polygons are specified as space separated list of vertex indices,
vertices are indexed starting at 0
-Polygons are 1 sided
-Polygons have to be convex
-all vertices of a polygon have to be on the same plane
-The vertices are in clockwise order (this is used for determining
normals if none are given).
-->
</polygons>
</mesh>
<!-- More meshes follow here...
<mesh name="Big Head" material="face">
...
</mesh>
<mesh name="Right Leg">
</mesh>
-->
<meshgroup name="Head">
<!-- This group defines swappable meshparts. Only 1 of the meshes here
is
used at once. You are able to switch between meshes here.
The first mentioned mesh is used as default...
-->
<mesh>Head</mesh>
<mesh>Big Head</mesh>
</meshgroup>
</model>
Now some notes I wrote down while doing this stuff, where I'm waiting for
comments:
-should we use space separated vertex list in polygons or tags?
<p>0 1 2</p> vs. <p> <v>0</v><v>1</v><v>2</v> </p>
-How should we reference to the textureunits? currently you can give a
integer
number like this:
<texturecoords textureunit="1"/>
-Should we allow swappable parts? If yes how?
-Should names have special constraints? (At the moment I'm allowing every
string, we could even think about UTF-8...)
-I didn't include support for special datatypes like trianglestrips or
trianglefans. Do they make sense in the format? Can't we let the
converters calculate such special formats?
-I didn't include support for LOD yet as I was unsure how todo it.
-Also I wonder if the method of grouping meshs should be more flexible
(ie. multiple meshes for 1 part...)
I'm waiting for comments.
Greetings,
Matze
More information about the Protocols
mailing list