Virtual Reality Modeling Language YASH PAL, March 28, 2021November 20, 2024 Virtual worlds are created using a computer language called Virtual Reality Modeling Language (VRML). this language instructs computers on how to build 3D geometric objects. VRML is a 3D equivalent to HTML but with more capabilities than just putting a 3D shop on your web page. VRML Imagine the Internet as a place where you could walk through three-dimensional worlds. you will pick up objects, examine them, and go to other internet locations by flying or walking through doors. what happens if you could be inside 3D flats, just like you can walk through a city or a building? This is all that we call virtual Reality (VR in short). you will find many virtual worlds you can explore on the Internet. you will be able to walk through a giant computer, explore bizarre art galleries, visit outer space, go to the sites of what seem like ancient ruins, and explore inside the human brain. The future of the Internet may be seen in the evolving 3D formats with which real or imaginary spaces are depicted in perspective, and the user has the ability to move (walk or fly) around, viewing the space from multiple angles. A VRML world is created by an ASCII text file containing VRML language commands. Graphic files can be added to this world as well. because the virtual world is only an ASCII file, with few graphic files, it can be downloaded quickly to your computer from the Internet. When a virtual world is created, it is posted on an Internet server. when you want to visit that world, you will type in its URL or click on a link to it, just as you do to visit any other location on the WWW. to display the virtual world, you will need a program that is able to display the world either a separate virtual reality browser or a plug-in player that configures itself to your normal web browser. VR on the Internet is being used for much more. For example, VR is used to create views of the brain and of the molecules. it has been used by astronomers to show the rotating of gas molecules in a galaxy undergoing active star formation. VR can eventually be used for things that today none of us can imagine. One main problem in creating VR worlds is that they tend to be very large files. because of that, they can be very slow to load and interact with due to the current limited bandwidth of the internet. as bandwidth increases, those problems may be solved automatically. VRML (Virtual Reality Modeling Language) The newly developed language VRML lets people create 3D worlds to describe the geometry of a scene. VRML files are text files that contain instructions for drawing the VRML world. these files end in the “.WRL” extension. after a file is created, it is posted on a Web server. VRML 1.0 Versus 2.0 There are now two official versions of VRML. however, unlike HTML versions, there is no backward compatibility. you need to make a choice of the version that you are going to use. Version 1.0 was limited to creating static scenes. in this way, it is not much better than a standard web page. a user can wander about, click on links to other worlds or pages, and enjoy the scenery. version 2.0 of VRML introduces programmable behaviors. it means things are really starting to live up to that virtual reality tag. Along with the addition of behaviors, VRML 2.0 adds many other things. The most important for general-world design is the ability to incorporate real 3D sound and video file formats. VRML 2.0 is much more complex than Version 1.0 there are only a few browsers available for 2.0 as compared to the 10-15 available for version 1.0. Netscape’s VRML browser, Live3D, supports VRML 2.0. VRML browsers come in two types: stand-alone and plugins for HTML browsers. if you are going to view only your VRML world, then a stand-alone browser works satisfactorily. However, if you’re planning to create mixed HTML and VRML worlds, particularly using Frames, then you need a plugin browser. Netscape and Live3D Live3D is distributed as a standard part of browsers from Navigator version 3 onward. it offers most of the standard features that you find in the other browsers. Microsoft and ActiveVRML Microsoft markets the ActiveVRML against VRML 2.0. and it does have the potential to read VRML 1.0 files. However, ActiveVRML is not a true VRML, Microsoft released an alpha version of their ActiveVRML browser in 1996. Intervista’s WorldView WorldView is available either as a stand-alone program or as a plugin to Netscape Navigator as well as for Microsoft’s Internet Explorer. WorldView has one advantage over Live3D in that it can run in any of your favorite browser environments. one of WorldView’s nice features is its ability to navigate your own camera positions while navigating a world and then return back to them. the rendering is very smooth, but it is not very accurate for handling mesh objects. Sony’s CyberPassage CyberPassage was the first VRML 2.0 browser to be available for the Internet. CyberPassage only operates as a stand-alone product. CyberPassage supports Java for scripting, which makes it much more extendable. VRML Modeling Tools The easiest and quickest way to construct a VRML world is to use a modeling package. Modelers can be divided into three categories: Those that export to another format and use an external converter. Those with internal support through plug-in exporters or native exporters. Those dedicated to VRML tools. VRML Exports from Traditional Tools One of the first ways that complex VRML models were constructed was with non-VRML modeling tools like AutoDesk’s 3D Studio. These tools export to a standard format like DXF, which then has a third-party converter like wcvt2pov change that into VRML. this provides a very quick working base for many VRML worlds. Internal support through plugin exporters or native exporters Today a number of these tools contain plugin exporters that can automatically produce VRML output files. one of the most widely used ones is Syndesis Corporation’s Interchange. interchange acts as a plug-in file exporter for the most popular modeling tools which supports VRML 2.0 export. However, it only exports static scenes. another exporter comes from Kinetix which plugs into 3D Studio. this exporter uses the whole capability of the 3D Studio products. Dedicated VRML Modelers One of the most interesting effects of VRML is the number of software companies that have released separate, dedicated VRML authoring tools, which are based on their non-VRML modeling tools. the best way to produce a product is to use a tool designed for the job. there is a wide range of tools available, ranging from those that barely hide VRML from you to those that can create any sort of file format. VRealm Builder is one of the most popular tools used in the VRML community today. VRealm Builder presents a four-view layout on the right side while you see the structure of the VRML file graphically produced on the left. Setting up the Web Server VRML files end with the extension .wrl. sometimes you may see them with “.wrl.gz.” these are files that have been compressed to make them smaller. both kinds are legal, and the Web browsers will handle them properly. on the server end, you need to make sure that your web server is configured for the correct MIME type. most servers come with the configuration already done, but you need to check that it serves up the type of x-world/x-VRML for VRML files. Using VRML 2.0 VRML 2.0 provides more than just 3D scenes. it includes the ability to create arbitrary behaviors. it includes native support for 3D sound and video input as well. File Header VRML files are characterized by the first line which states the type of file, the version, and the type of character encoding. VRML is encoded as UTF8 (a close relative of Unicode used in Windows 95/NT). the header looks like the following: #VRML V2.0 utf8 Basic Node Concepts VRML 2.0 is very strict about the parent-child relationship. there is a collection of rules about what nodes are legal and where. For instance, a geometry node like Box cannot exist by itself. it must be a child of the Shape node. there are two broad categories of nodes: Group and Leaf nodes. Group nodes are those that can contain other nodes, even more, Group nodes, but the Leaf nodes cannot contain others. A Shape node is classified as a Leaf node, yet it is the only way that geometry nodes can be mode visible. the difference is that the Shape node is only allowed two children, and they are of a specific type. #VRML V2.0 utf8 Shape { appearance Appearance { material Material { emissiveColor 0.4 0.4 0.1 } } geometry Cylinder { height .8 radius 0.20 } } VRML 2.0 uses a tree-type structure in the file. you will notice in a VRM 2.0 file that if a node is capable of having children, it includes a field called children. However, the order that you declare the modes within that children’s field no longer matters. if a node is to affect the properties of another, it must be higher up the hierarchy. The group node can contain any number of children of any type. as an example, the geometry nodes only contain information about the geometry i.e. what the radius is or how it is. They contain no information about where they are located in space or what color they are made up of. the listing in the above code gives a VRML file to produce the trunk of a tree. in this file, there are four nodes used. These are: Shape Appearance Material Cylinder The Shape node is the overall controlling parent. none of the other nodes are legal unless they have this parent. you also find that the word appearance is written twice. the first one is one of the fields of the Shape node. However the second is the declaration of the Appearance node. whenever a node (for example, Shape) is to have a particular node as the child for a field (for example, Appearance), then the field is named the same as the node to be used. If we declare the Shape node without the geometry or Appearance node because defaults have been specified then the cylinder defaults to black in color. the material node defines any color-based properties for the geometry. the appearance node can control other properties as well such as texture maps. Adding the leaves to make it look like a Tree Adding leaves is done by adding a cone that has been translated to the right position. in order to add the moving nodes or changing their dimensions, it can be handled by the Transform node as you could see in the given below code. #VRML V2.0 utf8 # The tree trunk Shape { appearance Appearance { material Material { emissiveColor 0.4 0.4 0.1 } } geometry Cylinder { height .8 radius 0.20 } } # A cone for leaves Transform { translation 0 1.4 0 children { Shape { appearance Appearance { material Material { emissiveColor 0.1 0.6 0.1 } } geometry Cone {} } } } The translation properties are handled by the translation field and the geometry that is to be translated is placed in the children field. the translation does not affect any other nodes except those declared as its children. note that the cone is declared with none of the fields set, which is indicated by the empty set of brackets. when you declare a node in this manner, the node will use the default values. Reusing Nodes VRML includes a mechanism so that you only need to define an object once and then reuse it. to define a node to be reused, you use the DEF keyword followed by a name and then the node definition. by resuing a node, you only create a pointer to the original. if you change any property in the original, it automatically flows onto all of the copies. Lighting VRML defines 3 sources. These are: PointLight: A Point light is a point in space representing a place where the light shines from. Spotlight: The SpotLight focuses a beam of light in a certain direction. DirectionLight: DirectionLight puts out parallel rays as though the light were from an infinite source like the Sun. PointLight and SpotLight do not suffer such restrictions. that is the other objects that belong to parent or sibling nodes are also affected by the light source. Default Views In VRML you can specify a list of positions to view the picture. In version 2.0, these positions are called viewpoints. A viewpoint uses the same model as the one used in VRML 1.0. first, you place it somewhere and then you give it an axis to rotate about. The rotation is always relative to the axis pointing in the minus Z-direction. Also, read What is a common gateway interface Characteristics of internet Digital communication engineering subjects internet Digital communicationengineering subjects