Programming Course

Chapter 11

3D and the Web

The Internet is the global network connecting many computer networks and is based on a common addressing system and communications protocol called TCP/IP (Transmission Control Protocol/Internet Protocol). From its creation in 1983 it grew rapidly beyond its largely academic origin into an increasingly commercial and popular medium.

By mid-1994 the Internet connected an estimated two million computers in more than 100 countries, serving some 23 million users. Many commercial computer networks and data services also provide, at least, indirect connection to the Internet.

The primary uses of the Internet are the WWW, electronic mail (commonly called "e-mail"), file transfer (using ftp, or file transfer protocol), bulletin boards and newsgroups, and remote computer access (telnet). More recent developments have made book and magazine publishing, video conferencing, and audio broadcasts possible.

The Internet has its origin in a US. Department of Defense program called ARPANET (Advanced Research Projects Agency Network), established in 1969 to provide a secure and survivable communications network for organisations engaged in defence-related research. Researchers and academics in other fields began to make use of the network, and the National Science Foundation (NSF), which had created a similar and parallel network called NSFNet.

Amateur radio, cable television and telephone wires, spread spectrum radio, satellites, and fibre optics all have been used to deliver Internet services. Networked games, networked monetary transactions, and virtual museums are among applications being developed that both extend the network's utility and test the limits of its technology.

11.1.1 Internet Glossary

IP-number (Internet Protocol Number): Every computer that is connected to the Internet needs a unique name to establish communication with others. The computers are numbered using a hierarchical schema, consisting of 4 groups of 4 bytes (0 .. 255) each. Generally, the number are structured like: Country.Organisation.Subnet.computer-ID, that is from general to specific.

DNS (Domain Name System): In order to make these numbers more mnemonic, the DNS was introduced. Here, a hierarchical schema of names is used but, in contrary to the IP number, the ordering is from specific to general. When contacting a computer in the same sub-net, only the name of the computer is necessary, not the entire number. For our server this means.

Name: gray
Aliases: gray.arch.ethz.ch (also gray.ethz.ch)
IP Address: 129.132.27.136 (129 = Switzerland ... 136 = gray)

TCP/IP (Transmission Control Protocol/Internet Protocol): To ensure a correct transmission of the data, a standardised way is needed, for computers to communicate. These standards are called protocols. This involves commands like: 'get in touch', 'send data', 'control reception', etc. The TCP/IP sends data by cutting them in parts of a specific size, labelling them with the IP number of the destination and sending them from one node of the Internet to the next. This mechanism allows for a network of different connection types and different transmission capacities as mentioned about. This in contrast to the telephone, where there has to be a one to one connection first that is open and reserved during the entire time of the communication.

Servers are computer programs that store and transmit documents to other computers on the network when asked to, while

Clients are programs that request documents from a server as the user asks for them. Browser software allows users to view the retrieved documents.

11.1.2 The Web

The World Wide Web (WWW), byname THE WEB, has become the leading information retrieval service for the Internet. The Web gives users access to a vast array of documents that are connected to each other by means of hypertext or hypermedia links--i.e., hyper-links, electronic connections that link related pieces of information allowing a user easy access to them. Hypertext allows the user to select a word from the text to access other documents that contain additional information pertaining to that word; hypermedia documents feature links to images, sounds, animations, and movies. The Web operates within the Internet's basic client-server format.

A hypertext document on the World Wide Web is often referred to as a Web site, or home page. The document, with its corresponding text and hyper-links, is written in HyperText Markup Language (HTML) and is assigned an on-line address called a Uniform Resource Locator (URL).

The development of the World Wide Web began in 1989 by Tim Berners-Lee and his colleagues at CERN, an international scientific organisation based in Geneva, Switzerland. They created a protocol, HyperText Transfer Protocol (HTTP), which standardised communication between servers and clients. Their text-based Web browser was made available for general release in January 1992. The World Wide Web gained rapid acceptance with the creation of a Web browser called Mosaic, which was developed in the United States by Marc Andreessen and others at the National Center for Supercomputer Applications at the University of Illinois and was released in September 1993. Mosaic allowed people using the Web to use the same sort of "point-and click" graphical manipulations that had been available in personal computers for some years. In April 1994 Andreessen cofounded Netscape Communications Corporation, whose Netscape Navigator became the dominant Web browser soon after its release in December 1994. By the mid-1990s the World Wide Web has millions of active users.

A short formula for the web: WWW = URL + HTTP + HTML

URL = The unique Internet address (Uniform Resource Locator). An externsion to the IP-number, for example: http://machine.edu/subdir/file.html

HTTP = The protocol (HyperText Transfer Protocol)

HTML = The data format (HyperText Markup Language)

11.1.3 HTML

HTML (HyperText Markup Language) is a text based description of documents consisting of different media like: text, images, movies, sound, etc. and links that connect the documents. The description is done by using "Tags" that are embedded in the text. A tag consists of a "<", a "directive", zero or more parameters and a ">". Matched pairs of directives, like "<title>" and "</title>" are used to delimit text which is to appear in a special place or style. Links to other documents are in the form

<a href="http://machine.edu/subdir/file.html">foo</a>

where "a" and "/a" delimit an "anchor" called tag, and "href" introduces a hypertext reference, which in this case is a Uniform Resource Locator (URL) (the thing in double quotes in the example above). The text "foo" will be the label appearing on the link in the browser.

A specific place within an HTML document can be specified by following the document name with a hash (#) and the name of an anchor at that position. Other common tags include <p> for a new paragraph, <b>..</b> for bold text, <ul> for an unnumbered list, <pre> for pre-formatted text, <h1>, <h2> .. <h6> for headings, etc. HTML supports some national characters through special escape sequences.

11.1.4 History of the Internet

1973DARPA (Defense Advanced Research Projects Agency) Research project: "The Internetting Project". ARPANet
1986NSF (National Science Foundation) Structure of the actual us-wide connections established
19915,000 local nets
700,000 computer
4,000,000 users
International and commercial expansion. Many universities, schools and research institutes.
E-mail and file transfer.
mid 19942 Mio. computers

23 Mio users.

HTML was developed in 1992 and Mosaic, the first software for the WWW, was introduced in January 1993.
end 1996> 4 Mio. computers

> 50 Mio users.

The Internet is already at about 50% commercial.

11.2 Three-dimensional Data

11.2.1 VRML 1.0

VRML is an acronym for "Virtual Reality Modeling Language". It is a file format for describing interactive 3D objects and worlds to be experienced on the world wide web (similar to how HTML is used to view text). The first release of The VRML 1.0 specification was created by Silicon Graphics, Inc. released in May 1995 based on the Open Inventor file format. VRML has become the most important standard for descriptions of three dimensional models and scenes on the Internet.$

The first version of VRML allows for the creation of virtual worlds with limited interactive behaviour. These worlds can contain objects which have hyper-links to other worlds, HTML documents or other media types. When the user selects an object with a hyper-link, the appropriate media viewer is launched. When the user selects a link to a VRML document from within a correctly configured WWW browser, a VRML viewer is launched.

11.2.2 VRML and Inventor

The Open Inventor ASCII File Format by Silicon Graphics was chosen from several possible candidates. The Inventor File Format supports complete descriptions of 3D worlds with polygonally rendered objects, lighting, materials, ambient properties and realism effects. A subset of the Inventor File Format, with extensions to support networking, forms the basis of VRML. Since you worked with the structure of Inventor before, you are familiar with most of syntax and the elements of this description.

11.2.3 A VRML Example

The following example shows all the important elements of VRML. This file specifies a simple world defining a view of a red cone and a blue sphere, lit by a directional light. The sphere has a hyper link that leads to our 'CAAD Programming' course home page. (Source of the File: ~prog/www/vrml/u12_simple.wrl or in Webspace: http://caad.arch.ethz.ch/~prog/vrml/u12_simple.wrl)

#VRML V1.0 ascii

DEF Viewer Info {string "walk"} # set the view to walk type

Separator {

DirectionalLight {

direction 0 0 -1 # Light shining from viewer into world

}

PerspectiveCamera {

position -8.6 2.1 5.6

orientation -0.1352 -0.9831 -0.1233 1.1417

focalDistance 10.84

}

WWWInline { # Inline files are placed into the scene

name " http://caad.arch.ethz.ch/~prog/vrml/arrow.wrl"

}

WWWAnchor { # The red sphere with a link = an anchor

name "http://caad.arch.ethz.ch/~prog/index.html"

# A HTML Link

description "CAAD Programming Homepage"

Material {

diffuseColor 1 0 0 # Red

}

Translation { translation 3 2 1 }

Sphere { radius 2.3 }

}

Separator { # The blue cube

Material {

diffuseColor 0 0 1 # Blue

}

Transform {

translation -4.4 1 1

rotation 0 1 1 .9

}

Cube {}

}

}

Lets have a look at the elements of this syntax:

For easy identification of VRML files, every VRML file must begin with the characters:

#VRML V1.0 ascii

Any characters after these on the same line are ignored. The line is terminated by either the ASCII newline or carriage-return character. The '#' character begins a comment; all characters until the next newline or carriage return are ignored. Blanks, tabs, newlines and carriage returns are whitespace characters wherever they appear outside of string fields. Whitespace characters are used to separate the syntactical entities in VRML files, where necessary. VRML is case-sensitive; 'Sphere' is different from 'sphere'.

After the required header, a VRML file contains exactly one VRML node. That node may of course be a group node, containing any number of other nodes.

Node names must not begin with a digit, and must not contain spaces or control characters, single or double quote characters, backslashes, curly braces, the sharp (#) character, the plus (+) character or the period character.

Field names start with lower case letters, node types start with upper case letters. The remainder of the characters may be any printable ascii (21H-7EH) except curly braces {}, square brackets [], single ' or double " quotes, sharp #, backslash \\ plus +, period . or ampersand &.

11.2.4 VRML 2.0 - Moving Worlds

Version 2.0 of the VRML standard - also called "Moving Worlds" - has been established in1996. This second release of VRML adds significantly more interactive capabilities. It was designed by the Silicon Graphics' VRML 1.0 team with contributions from Sony Research and Mitra. VRML 2.0 was reviewed by the E-mail moderated VRML discussion group, and later adopted and endorsed by a plethora of companies and individuals. Even thought the structure is quite similar to VRML 1.0, some changes in the syntax and the keywords were made. The programm webspaceauthor which can be used for the exercise will save the files in VRML 2.0 format

11.2.5 Internet Sources

For additional technical keywords take a look in the 'Free On-line Dictionary of Computing': http://wfn-shop.princeton.edu/cgi-bin/foldoc

VRML sources:

http://vrml.wired.com
http://www.sdsc.edu/vrml
http://vag.vrml.org
http://vrml.sgi.com

11.3 Exercise 11 - VRML

We want you to participate in the design of a virtual environment. Using VRML models, there are two different tasks to do:

All the participants of the programming course will build up their own personal space in which all other students of the course are represented and that contains links to all of them. We have prepared a template VRML document, with all the links to the other members that needs to be extended. The file is already in your prog account, you just have to extend it. (Depending on your account name (prog01 to prog29, the file could be: ~prog00/www/u12/env.wrl - the corresponding web document can be reached under: http://caad.arch.ethz.ch/~prog00/u12/env.wrl).

Additionally, everybody will create his/her own, personal 3D logo which is placed in all the environments by the inline commands (file: /homes10/prog00/www/u12/logo.wrl). Create the VRML files (V1.0 or V2.0) by using the Inventor export function in AutoCAD or another tool that can create Inventor files (for example Sculptor). Use webspace / webspaceauthor to view/modify the models. You don't have to submit anything - all the changes that you do are automatically available on the net.