3D Theory - XML Schema

Prerequisites

This page suggests a possible way to store the physics information using XML. If you are not familiar with XML you may like to look at the following pages first:

The fields used in this schema are described in detail here:

Schema

Here is a draft XML schema for storing a simulation of solid bodies using Newtonian mechanics.

Physics Schema

This schema is intended to be used with the x3d schema but I have not yet separated the out the namespaces correctly.

There is a lot more work that needs to be done and a lot of fundamental issues to be resolved, for instance:

Listing

<?xml version="1.0" encoding="utf-8" ?>
<xs:schema targetNamespace="http://tempuri.org/XMLSchema.xsd" elementFormDefault="qualified" xmlns="http://tempuri.org/XMLSchema.xsd" xmlns:mstns="http://tempuri.org/XMLSchema.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema" id="physicsSim">
<xs:element name="kinematics">
<xs:annotation>
<xs:appinfo />
<xs:documentation source="http://www.euclideanspace.com/threed/animation/datastructure/usescenegraph/index.htm" />
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element name="position" type="SFVec3f" />
<xs:element name="velocity" type="SFVec3f" />
<xs:element name="acceleration" type="SFVec3f" />
<xs:element name="angularPosition" type="SFRotation" />
<xs:element name="angularVelocity" type="SFRotation" />
<xs:element name="angularAcceleration" type="SFRotation" />
<xs:element name="randomMinMax" type="SFVec2f" />
<xs:element name="initPosition" type="SFVec3f" />
<xs:element name="initVelocity" type="SFVec3f" />
<xs:element name="initAcceleration" type="SFVec3f" />
<xs:element name="initAngularPosition" type="SFRotation" />
<xs:element name="initAngularVelocity" type="SFRotation" />
<xs:element name="initAngularAcceleration" type="SFRotation" />
<xs:element name="enable" type="SFBool" />
<xs:element name="rewind" type="SFBool" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Dynamics">
<xs:annotation>
<xs:appinfo />
<xs:documentation source="http://www.euclideanspace.com/threed/animation/datastructure/usescenegraph/index.htm" />
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element name="collideWith" type="Transform" />
<xs:element name="mass" type="xs:double" />
<xs:element name="centreOfMass" type="SFVec3f" />
<xs:element name="inertiaMatrix" type="xs:string" />
<xs:element name="gravity" type="xs:double" />
<xs:element name="material" type="xs:string" />
<xs:element name="solid" type="SFVec3f" />
<xs:element name="friction" type="SFVec3f" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="constraints">
<xs:annotation>
<xs:appinfo />
<xs:documentation source="http://www.euclideanspace.com/threed/animation/datastructure/usescenegraph/index.htm" />
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element name="constrainTranslation" type="xs:string" />
<xs:element name="minTranslation" type="SFVec3f" />
<xs:element name="maxTranslation" type="SFVec3f" />
<xs:element name="constrainRotation" type="xs:string" />
<xs:element name="minRotation" type="SFRotation" />
<xs:element name="maxRotation" type="SFRotation" />
<xs:element name="chain" type="xs:string" />
<xs:element name="action" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="collisionDetect">
<xs:annotation>
<xs:appinfo />
<xs:documentation source="http://www.euclideanspace.com/threed/animation/datastructure/usescenegraph/index.htm" />
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element name="overlap" type="SFBool" />
<xs:element name="flag" type="SFBool" />
<xs:element name="clearFlag" type="SFBool" />
<xs:element name="other" type="Transform" />
<xs:element name="useGeometry" type="SFBool" />
<xs:element name="impactLocation" type="SFVec3f" />
<xs:element name="impactTime" type="xs:time" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="CollisionAction">
<xs:annotation>
<xs:appinfo />
<xs:documentation source="http://www.euclideanspace.com/threed/animation/datastructure/usescenegraph/index.htm" />
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element name="collideWith" type="xs:string" />
<xs:element name="actionThis" type="xs:string" />
<xs:element name="actionOther" type="xs:string" />
<xs:element name="CreateNew" type="xs:string" />
<xs:element name="CreateNumber" type="xs:int" />
<xs:element name="CreateAt" type="xs:string" />
<xs:element name="Counter" type="xs:int" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Multiple">
<xs:annotation>
<xs:appinfo />
<xs:documentation source="http://www.euclideanspace.com/threed/animation/datastructure/usescenegraph/index.htm" />
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element name="type" type="xs:string" />
<xs:element name="initialInstances" type="xs:int" />
<xs:element name="maximumInstances" type="SFVec3f" />
<xs:element name="addInstance" type="xs:string" />
<xs:element name="removeInstance" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Transform">
<xs:annotation>
<xs:appinfo />
<xs:documentation source="http://www.web3D.org/technicalinfo/specifications/vrml97/part1/nodesRef.html#Transform" />
</xs:annotation>
<xs:complexType mixed="false">
<xs:complexContent mixed="false">
<xs:extension base="X3DGroupingNode">
<xs:attribute name="center" type="SFVec3f" default="0 0 0" />
<xs:attribute name="rotation" type="SFRotation" default="0 0 1 0" />
<xs:attribute name="scale" type="SFVec3f" default="1 1 1" />
<xs:attribute name="scaleOrientation" type="SFRotation" default="0 0 1 0" />
<xs:attribute name="translation" type="SFVec3f" default="0 0 0" />
</xs:extension>
</xs:complexContent>
</xs:complexType>
</xs:element>
<xs:element name="SFVec3f">
<xs:complexType>
<xs:sequence>
<xs:element name="x" type="xs:double" />
<xs:element name="y" type="xs:double" />
<xs:element name="z" type="xs:double" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="SFRotation">
<xs:complexType>
<xs:sequence>
<xs:element name="w" type="xs:double" />
<xs:element name="x" type="xs:double" />
<xs:element name="y" type="xs:double" />
<xs:element name="z" type="xs:double" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="SFVec2f">
<xs:complexType>
<xs:sequence>
<xs:element name="x" type="xs:double" />
<xs:element name="y" type="xs:double" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="SFBool">
<xs:complexType>
<xs:sequence>
<xs:element name="value" type="xs:boolean" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>


metadata block
see also:
Correspondence about this page

Book Shop - Further reading.

Where I can, I have put links to Amazon for books that are relevant to the subject, click on the appropriate country flag to get more details of the book or to buy it from them.

cover If you are interested in 3D games, this looks like a good book to have on the shelf. If, like me, you want to have know the theory and how it is derived then there is a lot for you here. Including - Graphics pipeline, scenegraph, picking, collision detection, bezier curves, surfaces, key frame animation, level of detail, terrain, quadtrees & octtrees, special effects, numerical methods. Includes CDROM with code.

Commercial Software Shop

Where I can, I have put links to Amazon for commercial software, not directly related to this site, but related to the subject being discussed, click on the appropriate country flag to get more details of the software or to buy it from them.

 

This site may have errors. Don't use for critical systems.

Copyright (c) 1998-2015 Martin John Baker - All rights reserved - privacy policy.