[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
X3D.dtd und Testdateien
Hallo!
Hier ist die fast fertige X3D-dtd. Aenderungswuensche bitte mitteilen.
Zudem haben wir einige Testdateien in X3D angefuegt, die sich parsen
lassen.
Viele Gruesse.
<!-- Vorlaeufige DTD -->
<!ENTITY % Boolean "(true|false|0|1)"> <!-- Boolean -->
<!ENTITY % UByte "CDATA"> <!-- unsigned number between 0 and 255 -->
<!ENTITY % Float "CDATA"> <!-- Float -->
<!ENTITY % Float01 "CDATA"> <!-- Float between 0 and 1 -->
<!ENTITY % UFloat "CDATA"> <!-- unsigned Float -->
<!ENTITY % Float0Pi "CDATA"> <!-- Float between 0 and 3.14159 -->
<!ENTITY % UInt "CDATA"> <!-- unsigned integer -->
<!ELEMENT X3DScene (WorldInfo?, Background?, Group+)> <!-- root-tag -->
<!ATTLIST X3DScene
ambientLight %Float01; "0.1"> <!-- "Scenelight" -->
<!ELEMENT WorldInfo (Title?,Info?)> <!-- contains title and informations about the scene -->
<!ELEMENT Title (#PCDATA)>
<!ELEMENT Info (#PCDATA)>
<!ELEMENT Background (Color?)> <!-- color for a simple background-->
<!-- This element can be extented. -->
<!ELEMENT Group (Group|Shape|Transformgroup|Viewpoint|DirectionalLight|SpotLight|PointLight)*>
<!ATTLIST Group
DEF ID #IMPLIED
USE IDREF #IMPLIED>
<!ELEMENT Shape (Material?, Geometry+)+ >
<!ATTLIST Shape
DEF ID #IMPLIED
USE IDREF #IMPLIED>
<!ELEMENT Geometry (Sphere|PointSet|IndexedLineSet|IndexedFaceSet)>
<!ELEMENT ColorVector (Color*)> <!-- vector of RGB-Colors -->
<!ELEMENT Color EMPTY> <!-- one RGB-Color -->
<!ATTLIST Color
r %UByte; #REQUIRED
g %UByte; #REQUIRED
b %UByte; #REQUIRED
DEF ID #IMPLIED
USE IDREF #IMPLIED> <!-- RGB-Color-Values between 0 and 255 -->
<!ELEMENT CoordinateVector (Point*)> <!-- Vector of 3D-Coordinates of floats -->
<!ELEMENT Point EMPTY> <!-- one coordinate of floats -->
<!ATTLIST Point
x %Float; #REQUIRED
y %Float; #REQUIRED
z %Float; #REQUIRED>
<!ELEMENT Material (DiffuseColor?, SpecularColor?)>
<!ATTLIST Material
ambientIntensity %Float01; "0.2"
DEF ID #IMPLIED
USE IDREF #IMPLIED>
<!ELEMENT DiffuseColor EMPTY> <!--diffuseColor includes coefficient of diffuse reflection -->
<!ATTLIST DiffuseColor
r %UByte; "204"
g %UByte; "204"
b %UByte; "204">
<!ELEMENT SpecularColor EMPTY> <!-- specularColor includes coefficient of specular reflection -->
<!-- ,shininess and wave angle -->
<!ATTLIST SpecularColor
r %UByte; "255"
g %UByte; "255"
b %UByte; "255">
<!ELEMENT NormalVector (Normal*)> <!-- Vector of 3D-normals of floats -->
<!ELEMENT Normal EMPTY> <!-- one normal of floats -->
<!ATTLIST Normal
x %Float; #REQUIRED
y %Float; #REQUIRED
z %Float; #REQUIRED>
<!ELEMENT PointSet (CoordinateVector, ColorVector?)> <!-- a set of 3D points with color and size -->
<!ATTLIST PointSet
pointsize %UInt; "1">
<!ELEMENT CoordIndex (Polyline*)> <!-- Vector of polylines -->
<!ELEMENT Polyline (#PCDATA)> <!-- polyline defined by pointindices -->
<!-- for example: 0 2 1 6 -->
<!ELEMENT IndexedLineSet (CoordinateVector, CoordIndex, ColorVector?)> <!-- 3D geometry formed by polylines -->
<!ATTLIST IndexedLineSet
linesize %UInt; "1"
DEF ID #IMPLIED
USE IDREF #IMPLIED>
<!ELEMENT IndexedFaceSet (CoordinateVector, CoordIndex, ColorVector?, NormalVector?)> <!-- 3D shape formed by polylines -->
<!-- coordinates orientated against counterclockwise -->
<!ATTLIST IndexedFaceSet
DEF ID #IMPLIED
USE IDREF #IMPLIED>
<!ELEMENT Sphere (Longitude, Latitude)?> <!-- defaulted coordinates of the center: (0|0|0) -->
<!ATTLIST Sphere
radius %UFloat; "1"
DEF ID #IMPLIED
USE IDREF #IMPLIED>
<!ELEMENT Longitude EMPTY>
<!ATTLIST Longitude
longi %UInt; #REQUIRED>
<!ELEMENT Latitude EMPTY>
<!ATTLIST Latitude
lati %UInt; #REQUIRED>
<!ELEMENT Viewpoint (Position, Orientation, Description?)>
<!ATTLIST Viewpoint
fieldOfView %Float0Pi; "0.785398"> <!-- angle between [0;3.14159] -->
<!ELEMENT Orientation EMPTY> <!--orientation specifies a rotation of the camera -->
<!ATTLIST Orientation
x %Float; "0"
y %Float; "0"
z %Float; "1"
rad %Float; "0">
<!ELEMENT Description (#PCDATA)> <!-- gives a name to the viewpoint/camera -->
<!ELEMENT Position EMPTY> <!--in default-position and orientation the viewer is on the -->
<!-- Z-axis looking down the -Z-axis -->
<!ATTLIST Position
x %Float; "0"
y %Float; "0"
z %Float; "10">
<!ELEMENT Transformgroup ((Rotation|Scale|Translation|ScaleOrientation)*,Group+)>
<!ATTLIST Transformgroup
DEF ID #IMPLIED
USE IDREF #IMPLIED>
<!ELEMENT Rotation EMPTY> <!-- (0,0,0) and (x,y,z) define the axis, rad is a radian of the rotation -->
<!ATTLIST Rotation
x %Float; #REQUIRED
y %Float; #REQUIRED
z %Float; #REQUIRED
rad %Float; #REQUIRED>
<!ELEMENT Scale EMPTY>
<!ATTLIST Scale
x %UFloat; #REQUIRED
y %UFloat; #REQUIRED
z %UFloat; #REQUIRED>
<!ELEMENT Translation EMPTY>
<!ATTLIST Translation
x %Float; #REQUIRED
y %Float; #REQUIRED
z %Float; #REQUIRED>
<!ELEMENT ScaleOrientation EMPTY> <!-- shear:specifies scales in arbitrary orientation>-->
<!ATTLIST ScaleOrientation
x %Float; #REQUIRED
y %Float; #REQUIRED
z %Float; #REQUIRED
rad %Float; #REQUIRED>
<!ELEMENT DirectionalLight (LightColor?, Direction)>
<!ATTLIST DirectionalLight
ambientIntensity %Float01; "0.0"
intensity %Float01; "1">
<!ELEMENT PointLight (Point, Attenuation?, LightColor?)>
<!ATTLIST PointLight
ambientIntensity %Float01; "0.0"
intensity %Float01; "1"
radius %UFloat; "100">
<!-- radius: maximum distance from location that may be illuminated by the light source -->
<!ELEMENT SpotLight (Point, Attenuation?, LightColor?, Direction)>
<!ATTLIST SpotLight
ambientIntensity %Float01; "0.0"
beamWidth %Float0Pi; "1.570796"
cutOffAngle %Float0Pi; "0.785398"
intensity %Float01; "1"
radius %UFloat; "100">
<!-- radius: maximum distance from location that may be illuminated by the light source -->
<!-- beamWidth specifies the inner solid angle -->
<!-- cutOffAngle specifies the outer bound of the solid angle -->
<!ELEMENT Attenuation EMPTY>
<!ATTLIST Attenuation
a %UFloat; "1"
b %UFloat; "0"
c %UFloat; "0">
<!-- PointLight node's illumination falls off with distance as specified by three -->
<!-- attenuation coefficients. The attenuation factor is -->
<!-- 1/max(attenuation[0] + attenuation[1]*r + attenuation[2]*r^2, 1), where r is the -->
<!-- distance from the light to the surface being illuminated. -->
<!ELEMENT LightColor EMPTY>
<!ATTLIST LightColor
r %UByte; "255"
g %UByte; "255"
b %UByte; "255">
<!ELEMENT Direction EMPTY>
<!ATTLIST Direction
x %Float; #REQUIRED
y %Float; #REQUIRED
z %Float; #REQUIRED>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE X3DScene SYSTEM "X3D.dtd">
<X3DScene>
<Group>
<Transformgroup>
<Translation x="1" y="3" z="4"/>
<Group>
<Shape>
<Material>
<diffuseColor r="122" g="121" />
</Material>
<Geometry> <Sphere/> </Geometry>
</Shape>
</Group>
</Transformgroup>
</Group>
</X3DScene>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE X3DScene SYSTEM "X3D.dtd">
<X3DScene>
<Group>
<Shape DEF="pyramide">
<Geometry>
<IndexedFaceSet>
<CoordinateVector>
<Point x="0" y="3" z="0"/>
<Point x="0" y="0" z="-2"/>
<Point x="-2" y="0" z="0"/>
<Point x="0" y="0" z="2"/>
<Point x="2" y="0" z="0"/>
</CoordinateVector>
<CoordIndex>
<Polyline> 4 3 2 1 </Polyline>
<Polyline> 0 1 2 </Polyline>
<Polyline> 0 2 3 </Polyline>
<Polyline> 0 3 4 </Polyline>
<Polyline> 0 4 1 </Polyline>
</CoordIndex>
<ColorVector>
<Color r="0" g="255" b="255"/>
<Color r="255" g="0" b="0"/>
<Color r="255" g="255" b="0"/>
<Color r="0" g="255" b="0"/>
<Color r="0" g="0" b="255"/>
</ColorVector>
</IndexedFaceSet>
</Geometry>
</Shape>
<Transformgroup>
<Rotation x="2" y="3" z="0" rad="23"/>
<Group USE="pyramide">
<Shape USE="pyramide"/>
</Group>
</Transformgroup>
</Group>
</X3DScene>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE DTD4 SYSTEM "X3D.dtd">
<Scene>
<Background> <color r="24" g="243" b="47"/> </Background>
<Group>
<Transformgroup>
<Transform> <Rotation x="3" y="2" z="0"/></Transform>
Title: Test der DTD
Mo, um 13.48 Uhrgeschrieben.
Position1
0 1 3 2