Chapter 12 Visualization on the Web https vtk
Chapter 12 Visualization on the Web https: //vtk. org/documentation/ https: //blog. kitware. com/author/ken-martin/
Visualization on the Web Purposes: • Online visualization of data • Speedy distribution of research results • Web-based collaboration • …
Visualization on the Web Considerations: • Division of visualization pipe line • Speed of generating, transmitting and displaying graphics elements • Interactivities on generating and viewing graphics elements • Compatibility of software
Visualization on the Web
Visualization on the Web
A “Failed” Case of Web Visualization • Live podcast of IBM’s Deep Blue vs. world champion Garry Kasparov • http: //en. wikipedia. org/wiki/Deep_Blue_versus_Garry_Kasp arov • Java Applets: small Java Applications running on the clients) • Right before the game was to start, the network bandwidth was overwhelmed at the server to sent the chess visualization applets to millions of clients who just joined the podcast.
JAVA 3 D : client-side processing User -> HTML page-> Java Applet (embedded) -> Imbedded VTK in Java Applet-> Graphics generation (client side)-> Rendering (client side) Everything is done at the client side after initial download of the applet.
Architecture of a Four-Tier Application Supporting Software App User Interface W E B Application Logic S E R V E R C L I E N T User Interface Database Engine Database DBMS / Database Server Database API Application Server Architecture of a Four-Tier Application
Architecture of a Four-Tier Application Supporting Software App User Interface VTK Database Engine Database DBMS / Database Server Database API Application Server Architecture of a Four-Tier Application W E B S E R V E R C L I E N T
Web. GL: Web Graphics Library VRML: Virtual Reality Modeling Language VRML/Web. GL: Browser-based 3 D Graphics
VRML: Virtual Reality Modeling Language VRML Plug-in: http: //www. cortona 3 d. com/cortona 3 d-viewers Floppy’s VRML Tutorial http: //rvirtual. free. fr/programmation/VRML/tuto_eng/ Web. GL https: //www. khronos. org/webgl/ https: //get. webgl. org/
Server-side Programming Clients “run” the visualization programs on the server, serverside programs dynamically generate web pages for the clients. User -> Web pages with imbedded scripts -> Client interaction -> Server-side processing -> Dynamically generated web pages -> Client browser
Both-side processing: VRML/Web. GL HTML forms-> Client selections -> Server-side programs-> Dynamically generated VRML/Web. GL pages-> Client browser (renders VRML/Web. GL) • 3 D graphical elements are generated at the server. • 3 D graphics elements are rendered at the client. • Regenerate graphics elements if geometry or attributes are changed. • Can change display parameters (vantage point, zoom level, …) at the client without regenerating graphics elements at the server
VRML: Virtual Reality Modeling Language
VRML: Virtual Reality Modeling Language #VRML V 2. 0 UTF 8 Shape { appearance Appearance { material Material { diffuse. Color 1 0 0 } } geometry Box { } }
VRML: Virtual Reality Modeling Language Indexed. Face. Set { coord Coordinate { point [ -2 0 2, 2 0 -2, -2 0 -2 -2 4 2, 2 4 -2, -2 4 -2] } coord. Index [ 0 4 7 3 -1 1 2 6 5 -1 4 5 6 7 -1 2 3 7 6 -1 ] solid FALSE } • List points in an array of (xyz) values • Index into it to form a polygonal surfaces • -1 to end the list of points forming the surface
VRML: Virtual Reality Modeling Language Web-based 3 D graphics programming. VTK can generate VRML (. wrl) files. vtk. VRMLExporter *exp= vtk. VRMLExporter: : New(); exp Set. Render. Window(ren. Win); exp Set. File. Name(“Vrml. Test. wrl”); exp Write();
VRML: Virtual Reality Modeling Language There are many ways to send the dynamically generated VRML page to the client. • CGI (Common Gate Interface) which takes the standard output from any server program and sends it to the client. For vis, the standard output should be a VRML embedded HTML page. • ASP. NET takes an ASP ((Active Server Page) generated by the application and sends it the client browser via the web server. The application can be written in any language supported by. NET (C#, C++, Java, Basic, …) • J 2 EE (Java Enterprise Edition) is a server side container that takes the output generated by a server side Java program, e. g. , JSP (Java Server Page), to the client.
VRML Server: CGI example Add form action in the. html page. <FORM METHOD=’POST’ ACTION=’/cgi-bin/make-vis. csh’> CGI programs can be C++ vtk programs in the cgi-bin directory. vtk. VRMLExporter *exp= vtk. VRMLExporter: : New(); exp Set. Input(ren. Win); exp Set. File. Pointer(stdout); exp Write(); // generating VRML file
JAVA 3 D Java + 3 D Graphics (More powerful in computing than VRML)
JAVA 3 D : both-side processing User -> Client interactions -> Server side JSP VTK processing -> Dynamically generated Java 3 D web pages -> Client browser with Java 3 D plug-in 3 D graphics elements rendered
Java Script & Web. GL : both-side processing User -> Client interactions -> Server side VTK processing -> Dynamically generated Web. GL web pages -> Client browser with Web. GL support 3 D graphics elements rendered
EAI: External Authoring Interface • Provides the same power as Java 3 D. • Allows interactions between VRML and Java. • Java + VRML + EAI == Java 3 D
Future of Web Visualization • Bandwidth (Vis Grid, OARNet 100 Gbit network). • Interface and language may change. • The algorithms in VTK remain.
- Slides: 25