VRML Part 3 logo

The Virtual Reality Modeling Language

4 Concepts

--- VRML separator bar ----

4.1 Introduction and table of contents

4.1.1 Introduction

This clause describes key concepts in this part of ISO/IEC 14772. This includes how the VRML constructs defined in ISO/IEC 14772-1 are encoded as binary.

4.1.2 Table of contents

See Table 4.1 for the table of contents for this clause.

Table 4.1 -- Table of contents, Concepts

4.1 Introduction and table of contents
  4.1.1 Introduction
  4.1.2 Table of contents
  4.1.3 Conventions used

4.2 Overview
  4.2.1 The structure of a VRML file
  4.2.2 Header

4.3 Binary file syntax
  4.3.1 Binary encoding
  4.3.2 Statements

  4.3.3 Node statement syntax
  4.3.4 Field statement syntax
  4.3.5 PROTO statement syntax
  4.3.6 IS statement syntax
  4.3.7 EXTERNPROTO statement syntax
  4.3.8 USE statement syntax
  4.3.9 ROUTE statement syntax

4.4 VRML and the World Wide Web
  4.4.1 File extension and MIME type
  4.4.2 Scripting language protocols

 

4.1.3 Conventions used

The following conventions are used throughout this part of ISO/IEC 14772:

Italics are used for event and field names, and are also used when new terms are introduced and equation variables are referenced.

A fixed-space font is used for URL addresses and source code examples.

The form "0xhh" expresses a byte as a hexadecimal number representing the bit configuration for that byte.

Throughout this part of ISO/IEC 14772, references are denoted using the "x.[ABCD]" notation, where "x" denotes which clause or annex the reference is described in and "[ABCD]" is an abbreviation of the reference title. For example, 2.[ABCD] refers to a reference described in clause 2 and B.[ABCD] refers to a reference described in annex B.

4.2 Overview

4.2.1 The structure of a VRML file

A VRML file is structured as defined in ISO/IEC 14772-1 4.2--Introduction.

4.2.2 Header

Every Binary-encoded VRML file shall begin with:

#VRML V3.0 binary <profile> [optional comment] <line terminator>

The header is a single line of UTF-8 text identifying the file as a VRML file and identifying the encoding type and profile of the file. It may also contain additional semantic information. There shall be exactly one space separating "#VRML" from "V3.0" , "V3.0" from "<encoding type>", and <encoding type> from <profile>. Also, the "<profile>" shall be followed by a linefeed (0x0a) or carriage-return (0x0d) character, or by one or more space (0x20) or tab (0x09) characters followed by any other characters, which are treated as a comment, and terminated by a linefeed or carriage-return character.

The identifier "binary" indicates a binary encoding. Wherever character strings are allowed in this encoding, the UTF-8 character encoding defined in ISO/IEC 10646-1 (otherwise known as Unicode) shall be used; see 2.[UTF8]. The usage of UTF-8 is detailed in ISO/IEC 14772-1 6.47, Text, node.

4.3 Binary file syntax

4.3.1 Binary encoding

This clause describes the syntax of binary-encoded, human-readable VRML files. A more formal description of the syntax may be found in Annex A, Grammar definition. The syntax of VRML in terms of the binary encoding are presented in this part of ISO/IEC 14772. The semantics of VRML are as defined in ISO/IEC 14772-1.

Description of binary encoding needed here.

Field, event, PROTO, EXTERNPROTO, and node names shall not contain control characters (0x0-0x1f, 0x7f), space (0x20), double or single quotes (0x22: ", 0x27: '), sharp (0x23: #), comma (0x2c: ,), period (0x2e: .), brackets (0x5b, 0x5d: []), backslash (0x5c: \) or braces (0x7b, 0x7d: {}). Further, their first character shall not be a digit (0x30-0x39), plus (0x2b: +), or minus (0x2d: -) character. Otherwise, names may contain any ISO 10646 character encoded using UTF-8. VRML is case-sensitive; "Sphere" is different from "sphere" and "BEGIN" is different from "begin."

4.3.2 Statements

After the required header, a VRML file may contain any combination of the following:

  1. Any number of PROTO or EXTERNPROTO statements (see ISO/IEC 14772-1--4.8, Prototype semantics);
  2. Any number of root node statements (see ISO/IEC 14772-1--4.4.1, Root nodes);
  3. Any number of USE statements (see ISO/IEC 14772-1--4.6.2, DEF/USE semantics);
  4. Any number of ROUTE statements (see ISO/IEC 14772-1--4.10.2, Route semantics).

4.3.3 Node statement syntax

Define binary node syntax here.

4.3.4 Field statement syntax

Define binary field syntax here.

4.3.5 PROTO statement syntax

Define binary PROTO syntax here.

4.3.6 IS statement syntax

Define binary IS syntax here.

4.3.7 EXTERNPROTO statement syntax

Define binary EXTERNPROTO syntax here.

4.3.8 USE statement syntax

Define binary USE syntax here.

4.3.9 ROUTE statement syntax

Define binary ROUTE syntax here.

--- VRML separator bar ---

4.4 Binary VRML files and the World Wide Web

4.4.1 File extension and MIME types

The file extension for binary encoded VRML files is .wrb (for world binary).

4.4.2 Scripting language protocols

The Script node's url field may also support custom protocols for the various scripting languages. For example, a script url prefixed with javascript: shall contain ECMAScript source, with line terminators allowed in the string. The details of each language protocol are defined in the annex for each language. The following example illustrates the use of mixing custom protocols and standard protocols in a single url field (order of precedence determines priority):

Need example of binary encoded Script node here.

--- VRML separator bar ---