3Dstream Report
Total Page:16
File Type:pdf, Size:1020Kb
3DStream Vision, Graphics and Interactive Systems project Florent Guillaumie Romain Klein Thierry Plesnar 10th semester, Fall 2010 To be evaluated on June 14th 2011 3DStream 10th semester VGIS PROJECT TITLE: 3D Stream PROJECT PERIOD: VGIS10, SYNOPSIS: From February 1st 2011 to June 31st 2011 This project evaluates several ways to stream huge 3D ob- jects on the Internet. The sys- PROJECT GROUP: tem had to allow the user to 1025 see these objects in his browser and in real time, despite a size GROUP MEMBERS: that can reach several hundred Florent Guillaumie mega bytes. Romain Klein This project was made in col- Thierry Plesnar laboration with the C2RMF - Louvre museum. It will mainly SUPERVISOR: focus on the streaming of work Claus Brøndgaard Madsen of arts which are digitized in the PLY format. CENSOR: The discussion will have to ad- Helge B.D. Sørensen dress the performance issues because of the size of the ob- NUMBER OF COPIES: 5 jects which have to be handled. REPORT PAGES: 62 APPENDIX PAGES: 4 TOTAL PAGES: 66 1/66 Acknowledgement We would like to thank the Aalborg University staff who supervised, supported and helped us during both researches and implementation of our project: Claus Brøndgaard Madsen, who supervised our work and the general project progress. We would like also to thank the “Centre de recherches et de restauration des musées de France” of the Palais du Louvre team, especially: David Kolin and his assistants, Yann Ledudal and Guillaume Blaise. A lot of work and improvement have also been made thanks to feedbacks from the following persons which we would like to thank. They helped us designing our final application by participating in our usability and user tests, giving us their personal opinion about it, and helping us to adapt our first idea to a useful and practical application: Gabrielle Tranchet, Paweł Pankiewicz, Anders Nørgaard, Alexandre Ma- jetniak, Branko Plesnar, Iraporan Plesnar, Simone Klein, Dominique Klein, Agnès Guillaumie, Philippe Guillaumie, Jérôme Arlet, Élise Arlet, Ninna Marie. 2 Preface Technology notice This document has been written with LATEX, the document markup language and compiled with pdftex. The images in this document are all free of rights or have references, and have been partially retouched with Adobe Photoshop CS5 and PixelMator. The graphics have been made with Microsoft Office Project 2007. The application has been developed in Javascript and WebGL. Linux server uses Apache and MySQL on an Ubuntu 10.10 distribution. Report outline This document goes from the very beginning of our project to the final user testing. First, in a quick introduction, we will present you an overview of our product, the purpose of the study and the different fields involved. Then, in the requirements analysis part, we will state the basis of the project, identify the stakeholders and give an overview of the technologies encountered such as the WebGL. Also, in the design section, the way we planned to develop our application will be presented using mostly UML diagrams. Afterwards, the implementation part will go deeper into our technical so- lutions to solve the problem. Finally, the system will be tested and the results will be given in the tests section. To conclude, this report sums up our investment into this project and gives us some working methods for the future. 3 Contents Acknowledgements 1 Preface 2 1 Introduction 8 1.1 Project overview . 8 1.2 Purpose of the study / Problematics . 14 1.3 Domains involved in the study . 14 1.3.1 PLY files . 14 1.3.1.1 Introduction to PLY file format . 14 1.3.1.2 The digital Michelangelo Project . 14 1.3.1.3 PLY file format . 15 1.3.2 JavaScript . 17 2 Paper overview 19 3 Requirements analysis 20 3.1 Pre-requisites . 20 3.1.1 User characteristics . 20 3.1.2 Software system features . 21 3.1.3 Use case . 22 3.2 Candidate technologies . 23 3.2.1 Technologies based on heavy clients . 23 3.2.2 Technologies displaying 3D shapes in a web browser 24 3.2.2.1 Flash . 24 3.2.2.2 Java . 25 3.2.2.3 O3D . 26 3.2.2.4 VRML / X3D . 26 3.2.2.5 WebGL . 27 3.2.2.6 Image displaying, server rendering . 27 4 3DStream 10th semester VGIS PROJECT 3.2.2.7 Decision based on the requirements . 28 3.2.3 Streaming optimization . 29 3.2.3.1 Bandwidth concerns . 29 3.2.3.2 PLY file reduction . 31 3.3 Additional information . 33 3.3.1 Data storage . 33 3.3.2 Planning . 33 4 Design 34 4.1 WebGL . 34 4.1.1 WebGL libraries benchmark . 34 4.1.1.1 Decision . 37 4.2 Database / File . 38 4.3 Mock-ups . 39 5 Implementation 43 5.1 Server side . 43 5.2 Client side . 45 5.2.1 File preparation . 45 5.2.1.1 Javascript arrays . 46 5.2.1.2 File chunks . 47 5.2.2 Viewer . 48 5.2.2.1 XB-PointStream PLY parser . 48 5.2.2.2 X3DOM with JavaScript arrays . 49 5.2.2.3 X3DOM with direct DOM injection . 51 6 Performance test 52 6.1 Comparison between several browsers . 52 6.1.1 Firefox 4 . 52 6.1.2 Internet Explorer 9 . 53 6.1.3 Google Chrome . 54 6.2 Comparison between two different configurations . 54 6.2.1 Testing machine configurations . 54 6.2.2 Results . 54 6.3 Comparison with two different model sizes . 56 6.4 Complete benchmark results . 56 Bibliography 59 Appendices 63 5/66 List of Figures 1.1 Example: A Thai Statue rendered in Meshlab . 9 1.2 A coordinate measuring machine . 11 1.3 A lidar time-of-light scanner . 12 1.4 Triangulation principle schema . 12 1.5 The NextEngine scanner . 13 1.6 Laser scan of the David. The Digital Michelangelo Project. 15 1.7 Result: The red cube rendered in Meshlab . 17 3.1 Use Case: Collaborative Work between curators and researchers 22 3.2 Anticipated bandwidth requirements, BuddeComm based on NTA data. 30 3.3 Comparison between ellipsoids and vertices [9](Fig.3) . 31 4.1 Request comparison Database / File . 38 4.2 Mockup(1): Login page [14] . 40 4.3 Mockup(2): 3D model main page [14] . 40 4.4 Mockup(3): 3D model annotation [14] . 41 4.5 Mockup(4): 3D model comments [14] . 41 4.6 Mockup(5): 3D model curator contact [14] . 42 5.1 Asus EEEPC 701 4G . 43 5.2 Screen capture of test server speed test . 44 6.1 Firefox WebGL support testing . 53 6.2 IE 9 WebGL support testing . 53 6.3 Alienware laptop streaming performance test . 55 6.4 Samsung netbook streaming performance test . 55 5 Specific planning . 65 6 Global planning . 66 6 List of Tables 3.1 Technologies used to display 3D models in web-browsers . 29 6.1 Chrome medium resolution model . 57 6.2 Chrome high resolution model . 57 6.3 Firefox 4 medium resolution model . 57 6.4 Firefox 4 high resolution model . 57 7 Chapter 1 Introduction 1.1 Project overview Nowadays, the tendency to go from the 2D to the 3D is real. This comes directly from the fact that the viewer will find it more realistic. The most common example is that more and more movies are now in 3D to enhance the experience of the audience. The use of 3D objects is also increasing at the expense of images, but for different reasons. 3D allows to have way more details on the object than simple images could ever provide because of the interactive control of the viewpoint. But it has a cost, the size of such files can reach hundreds of mega bytes. The issue with such large files is that you need to entirely download it before being able to observe it thanks to a local application. For instance, the 3D file at page 9, which comes from The Stanford 3D Scanning Repository1, has a size of 180Mb. If we arbitrarily consider that the average download speed is between 500Kb/s and 4Mb/s, we can estimate that it would take between 45 seconds and 6 minutes to get it. Then you still need to manually open this file with your local application which will take some extra seconds to load it. In the end, it takes quite a long time to be able to examine a 3D object and this is the problem we want to address. The solution we decided to explore to answer this problem, is the streaming of the 3D object over the Internet. This technique allows the viewer to watch the object appearing on his screen as it is being downloaded and keeps the model from being distributed (for copyright reasons). 1http://graphics.stanford.edu/data/3Dscanrep/ 8 3DStream 10th semester VGIS PROJECT Figure 1.1: Example: A Thai Statue rendered in Meshlab The web technologies to manipulate 2D images are really advanced and well established. People are finally realizing that the technology for the visual- ization of 3D models online is now available. Such a technology can be quite useful to improve the user experience on the web. For instance, by having virtual visits of museums, ordering a personalized kitchen online and being able to change any part of it while seeing directly the result, etc. The first 3D technology for the web was actually presented in 1994 and was called VRML (Virtual Reality Modeling Language). It was simply based on a text file describing a virtual scene. However, this language required a plugin to be installed in the browser of the user and used a lot of processing power.