Wednesday, April 11, 2007

3D world in browser... just like that

You can get the pdf version with images here

The world is xmlizing... I say. Every data type on the web got to be in XML. That is good, that means open data, human readable data, more accessible for society in all fields, wherever XML is used. XML is ubiquitous these days.
3D in internet has a long and interesting story, it has started with VRML technology. Plenty of companies were making their own plug-ins, selling, showing their enormous functions, but there was no standard. It was hard to think of it, while the OpenGL support was barely standing and HTML was exploding on the net. People started talking how buggy and not efficient that kind of solution is. So VRML stayed in a shadow. That was years ago, some people had this dream about 3D worlds in a browser, true 3D API with decent data for it. Years passed and a successor of VRML came into stage, X3D.
X3D is a ratified standard from Web3D Consortium, it grew up to become next child to fight its way with browsers. X3D is XML based, it includes old parts of VRML such as H-Animation, GeoVRML or Nurbs. It replaces VRML while providing compatibility which VRML existing content (VRML content can be read by X3D reading applications). It was developed so that it is extensible and shrinkable as well. It consists of profiles, which include components. Components are collections of specific features. For instance we have Geo component. The reason of such a construction here is that some companies wouldn’t like to support all of the features available with X3D, so they shrink X3D to their specific X3D data. They can also create new profiles and components. The solution is universal as you can see. There is another very popular XML data for 3D representation – the Collada file (DAE extension). They are very similar as it comes for construction. Both the Web3D and Khronos Group (actual owner of Collada - originally was made by Sony) are collaborating so that they can specify fields where each of them will find its piece of land, they also want to make some of their parts the same (animation etc.) so that the open source society will have more profits. So if both are XML can we...? yes, we can make translations between them. There are XSLT transformations available, free of charge of course. However, in big outline... Collada is considered as a interchange format for standalone DCC (Digital Content Creation) applications, while X3D is focused on web issues. If you want to have a broader view on X3D/Collada there’s a fresh whitepaper from Tony Parisi [1] on this subject. So we have X3D, why I find it so important for GIS Web 3D. Primarily, because it is a standard, a good stable standard, with really some time spent on developing its flexibility. Secondly it has a working group X3D Earth working group which vision is to create X3D representation of the world, I know that’s a big challenge, but they have some serious reinforcements as well (NASA). Anyway, there are also some other non-standard technologies that have something to say if it comes to GIS data. There is very nice cityGML which has some cities already implemented in it (www.cityGML.org), but it’s not yet a standard. At the moment it’s on its way of achieving that with Open Geospatial Consortium. However for web purposes X3D should take the lead. Heh, again cityGML is XML so yes, again XSLT to X3D is possible. More on that topic is covered in Kiwon Lee document[2] about literally speaking cityGML to X3D transformations and mobile GIS 3D. So we are here at the point where we have data type X3D which is supporting our GIS and what is more is web focused, but what about the viewer?
The Web3D Consortium provides us with some free X3D viewers. But all of them are required as new plug-ins for our browsers in case we want to view something, and that’s a bit of a problem. Because a good stable player is also very important if it comes to Internet society, in some way standardized player. I know that if someone really would like to use 3D in web he would download the player and play it. But as far as I know reality, people are not keen on installing new plug-ins, most of them don’t know how to do it (despite it is automated these days). That’s life. My point here is that the 3D that we have to offer should be playable just like that, when opening the web page. Like google maps, that’s why they are so popular. There is NASA WorldWind and Google Earth as well (the standalones), but the usability is what counts nowadays and what makes people speak about it. The practical usage of solution.
There is one plug-in however that is available among society, yes, exactly... Flash Player. Everyone has Flash Player. To be more concrete I will recall the chart from www.adobe.com (Fig.1)

Fig. 1 : The Adobe Flash Player statistics show that Flash content reaches more than 98% of users.

Yes I know that can be a bit exaggerated (those are Adobe statistics), but It’s hard to admit that the Flash Player is not ubiquitous.
So Flash, Flash, wasn’t that just for 2D vivid graphics? Yes it was, it is, and it’s evolving. But in the mean time we want to get started here with new Adobe Flex 2.0 technology which also uses Flash Player as a run-time environment. I gave you before an example what Flex ArcWeb Explorer is, and how ESRI was fascinated about it. Imagine now connecting 3D options to it. Well I believe it’s fully applicable. As I said before, we want to create very portable and practical solution. The point I’m making here is that in my opinion the X3D, Flex + Papervision3D bundle gives as a gate to develop really nice looking environments in a really fast way. There are many gaps still to be filled with some coding, but the outline is there, steady and ready. Ok so are we ready to show some graphics? what else do we need? ... Rationality! and again the practical attitude. I’m going to keep repeating that till the end of my days. The public destination of that solution and the availably for everyone is a really important issue. People are creating standards these days, not companies. So which part of our gate needs to be replaced?... what about X3D, do we have some data implemented in it? is it really in practical, wide usage? No it isn’t. My sentiment about X3D is similar to this expressed by French president Charles De Gaulle about Brazil: It has a great future … and always will. We need something practical, what is already in wide use, and its growing in the hand of the users, and moreover we need it now. X3D is supported by NASA and it maybe going to be a standard but nowadays we need to pick up something reasonably, that will strongly support us with existing data. The best way to see what I mean is to compare NASA World Wind and Google Earth. Google Earth is starting to be created by users for users, and that is what I call a standard. So what I advise to myself, is to use the kind of data that is using Google Earth to represent environment. So here we are now with KML (it seems that we are going through all the alphabet +ML extension). You see, the easiness with I am switching the data types is also because of the fact that all of them are XML based and its possible to make translations between them, we are not risking much. So again,my target is the type of that data that will be most suitable for wide audience providing ease of use and data creation perspectives. So what about this KML you ask?

KML stands for KeyHole Markup Language. The word Keyhole is an earlier name for the software that became Google Earth. The software was produced in turn by Keyhole, Inc, which was acquired by Google in 2004. The term "Keyhole" actually honors the KH reconnaissance satellites, the original eye-in-the-sky military reconnaissance system now some 30 years old. At the moment it is a standard of representing data for Google Earth apps. It is constructed with really simple structure. Let’s say we want to mark a point on Google maps. The KML file would be as follows :

example in pdf version;

That gives us points, nothing special. But the KML can support us with polygons descriptions :

example in pdf version;

Fig. 2 : Different types of polygons in KML, opened and placed on a specific location in Google Earth.

What is more, we can use Google Earth to create that kind of polygons using real world raster map as a drawing layer. So that way we can acquire polygon boundaries created on real world blue prints with real world coordinates. That is kind of fun. I wouldn’t lie if I say that starting from now, with no experience in Google Earth, I can create in few hours an outline of a small city and export it to KML files, or create KMZ archive (collection of KML files). Just like that, that is what I call simplicity. Ok let’s go further. Starting from KML version 2.1 Google made a big step towards 3D worlds, we have a support for intermediate 3D modeling file format, guess… yes, our gaming friend Collada (thought about X3D, huh?).

So… plenty of new possibilities now open. Game creators can move their actual work to Google Earth engine. Anyone can model buildings in his favorite application save it to Collada file and place it in the Earth on a specific coordinates. I don’t have to tell what kind of options it gives. Can you imagine games in real 3D environment or millions of people creating 3D models of their homes? Well, it’s going to happen faster than we think, I think. In the mean time… where were we with our lounge of chosen technologies?

Fig. 3 : The KML file with a Collada .dae model attached to it, opened in Google Earth.

Our gate for creating 3D worlds, based on true Geographical data, open for everyone in a common browser is : Flex with PaperVision3d + KML file format which includes Collada files. In my opinion that could be a really interesting solution solver for Web based GIS 3D. It is really easy to develop, and if you take a deeper insight on options which each of these technologies give, you will see that you can create some really fresh outlook of content in a web browser… just like that.

By Marcin Czech


References :
[1] ”Developing Web Applications with COLLADA and X3D” by Dr. RĂ©mi Arnaud and Tony Parsi
[2] “Prototype Implementations for Multi-typed 3D Urban Features
Visualization on Mobile 3D and Web 3D Environments “ by Lee Kiwon