prev up next

Previous: Zusammenfassung Up: Computergrafik Programmierpraktikumsbericht SS 2000 Next: Wuerfel.x3d

X3D Document Type Definition

Endfassung der 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?, Viewpoint*, Group+)>
                                              <!-- root-tag -->
<!ATTLIST X3DScene
        ambientLight   %Float01;    "0.1">  <!-- "Scenelight" -->

<!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->


<!ELEMENT WorldInfo EMPTY> <!-- contains title and informations-->
                           <!-- about the scene -->
<!ATTLIST WorldInfo
        title  CDATA     #IMPLIED
        info   CDATA     #IMPLIED>

<!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->


<!ELEMENT Background (Color?)>   <!-- color for a simple background-->
                                 <!-- This element can be extented. -->

<!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->

        
<!ELEMENT Viewpoint (Position, Orientation)>
<!ATTLIST Viewpoint
        description  CDATA       #IMPLIED
        fieldOfView  %Float0Pi;  "0.785398">
        <!-- description: name of viewpoint; fieldOfView: angle between [0;3.14159] -->


<!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 Orientation EMPTY> <!-- specifies a rotation of the camera -->
<!ATTLIST Orientation
        x  %Float;   "0"
        y  %Float;   "0"
        z  %Float;   "1"
        rad  %Float; "0">

<!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->


<!ELEMENT Group ((Translation|Scale|ScaleOrientation|Rotation)*,
                (Group|Shape|DirectionalLight|SpotLight|PointLight)*)>
<!ATTLIST Group
        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>  <!-- specifies a scale of the coordinate system-->
<!ATTLIST Scale
        x  %UFloat;   #REQUIRED
        y  %UFloat;   #REQUIRED
        z  %UFloat;   #REQUIRED>

<!ELEMENT Translation EMPTY> <!-- specifies a translation of the system-->
<!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 Shape (Material?,
(Sphere|PointSet|IndexedLineSet|IndexedFaceSet)?) >
        <!-- The Shape node has two fields, material and geometry,-->
        <!-- which are used to create rendered objects in the world.-->
<!ATTLIST Shape
        DEF    ID      #IMPLIED
        USE    IDREF   #IMPLIED>
<!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->

<!ELEMENT Material (DiffuseColor?, SpecularColor?)>
        <!-- The fields in the Material node determine how light -->
        <!-- reflects off an object to create colour -->

<!ATTLIST Material
        ambientIntensity %Float01; "0.2"
        shininess        %Float01; "0.2"
        DEF    ID      #IMPLIED
        USE    IDREF   #IMPLIED>
<!-- The specular color and shininess determine the specular highlights.-->
<!-- low shininess: soft glows, high shininess: sharper and small highlights -->

<!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, wave angle -->
<!ATTLIST SpecularColor
        r   %UByte;  "255"
        g   %UByte;  "255"
        b   %UByte;  "255">

<!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->


<!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 PointSet (CoordinateVector, ColorVector?)>
        <!-- a set of 3D points with color and size -->
<!ATTLIST PointSet
        pointsize   %UInt;   "1">


<!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 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 CoordIndex (Polyline*)>   <!-- Vector of polylines -->

<!ELEMENT Polyline (#PCDATA)>       <!-- polyline defined by pointindices -->
                                    <!-- for example: 0 2 1 6 -->


<!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 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 DirectionalLight (LightColor?, Direction)>
        <!-- The DirectionalLight node defines a directional light source that -->
        <!-- illuminates along rays parallel to a given 3-dimensional vector. -->
<!ATTLIST DirectionalLight
        ambientIntensity  %Float01;  "0.0"
        intensity         %Float01;  "1">

<!ELEMENT PointLight (Point, Attenuation?, LightColor?)>
        <!-- A point light source emits light equally in all direction -->
<!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)>
        <!-- The SpotLight node defines a light source that emits light -->
        <!-- from a specific point along a specific direction vector -->
        <!-- and constrained within a solid angle.-->
<!ATTLIST SpotLight
        ambientIntensity %Float01;  "0.0"
        beamWidth        %Float0Pi; "1.570796"
        cutOffAngle      %Float0Pi; "0.785398"
        intensity        %Float01;  "1"
        radius           %UFloat;   "100">
        <!-- Point: location of the light source -->
        <!-- radius: range of 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">

        <!-- SpotLight 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 radius. -->

<!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>

<!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->



Unterabschnitte
prev up next
Previous: Zusammenfassung Up: Computergrafik Programmierpraktikumsbericht SS 2000 Next: Wuerfel.x3d