www.cb.uu.se/~aht Anders.Hast@it.uu.se Two Research Schools become ONE 1996 213 27 1
www.cb.uu.se/~aht Anders.Hast@it.uu.se Collaboration between Two Research Initiatives 2
www.cb.uu.se/~aht Anders.Hast@it.uu.se 3
www.cb.uu.se/~aht Anders.Hast@it.uu.se 4
www.cb.uu.se/~aht Anders.Hast@it.uu.se People Anders Hast Hans Karlsson Michael Hanke Ingela Nyström Pavlin Mitev Dan Henningsson Elias Jarlebring 5
www.cb.uu.se/~aht Anders.Hast@it.uu.se Mission To give basic training in fields where the use of e-science is emerging A meeting place for graduate students using e-science tools and techniques Identify areas where courses within e-science are needed 6
www.cb.uu.se/~aht Anders.Hast@it.uu.se What is escience? System Experts Applications Application Experts HPC Storage Visualisation Big Data 7
www.cb.uu.se/~aht Anders.Hast@it.uu.se A Typical Course 5 Credits 3 Weeks Study at home university Lectures & Computer Exercises Project Work & Examination 8
www.cb.uu.se/~aht Anders.Hast@it.uu.se Benefits for Graduate Students Travel Grant 1 Generally No fees!! Networking Access to top Resources General Topics Special Topics Experienced Teachers 9
www.cb.uu.se/~aht Anders.Hast@it.uu.se Some Courses Basic & Advanced Advanced Molecular Dynamics Visualisation Scientific Computing Topics in CFD PDC Summer School High Performance Computing Stochastic Methods 1
Scientific Visualisation, 5hp 11
Teachers Anders Hast Associate Professor Computer Graphics/ Visualisation Stefan Seipel professor Computer Graphics Johan Nysjö PhD student 12
Assignments Two obligatory assignments 13
Project Use your own data! Or do a Earthquake visualisation 14
A picture is worth a thousand words refers to that complex stories can be described with a single image. This expression is valid also in scientific visualisation. 15
When large and complex data sets are resulting from experiments and computations, visualisation is a way to give deeper insight and knowledge. You will learn how! to select appropriate methods, possibilities and limitations with methods,! and to use visualisation toolkits. A focus will be on using script programming: Python in combination with VTK (the Visualisation Toolkit). 16
Dictionary vi su al ize! To form a mental image of; envisage: try to visualise the scene as it is described! To make visible Visualisation offers a way to see the unseen
Visualisation purposes! Communication of information (emphasizing, narrating)! Improve understanding (illustrating, interpreting, finding)! Decision support (analyzing, extrapolation)! Answering questions (diagnosing, interpreting)! Support creativity (inspiration)! Making new discoveries through interaction!
Graphs are one type of visualisation Example: Which Swedish town(s) have warmer than 2 C and less than 1 mm of rain?
Visualisations help us getting insight When data is complex: Collected/Computed When numeric data is to bee understood When complex relations must be understood When multiple variables have to be analyzed Visualisation is not a substitute to, but in addition to, statistical analysis and other quantitative methods Visualisation takes advantage of human sensory abilities Pattern recognition, Trend discovery, etc.
Graphs are one type of visualisation Example: Which Swedish town(s) have warmer than 2 C and less than 1 mm of rain? 3, 22,5 15, Temp.[C] Rain [mm] 7,5, Kiruna Östersund Umeå Sundsvall Mora Västerås Gävle Uppsala Halmstad Karlskrona Stockholm Örebro Lund Malmö Göteborg
Graphs are one type of visualisation Example: Which Swedish town(s) have warmer than 2 C and less than 1 mm of rain? 3, 22,5 15, Temp.[C] Rain [mm] 7,5, Kiruna Östersund Umeå Sundsvall Mora Västerås Gävle Uppsala Halmstad Karlskrona Stockholm Örebro Lund Malmö Göteborg
Graphs are one type of visualisation Example: Which Swedish town(s) have warmer than 2 C and less than 1 mm of rain? 3, 22,5 15, Temp.[C] Rain [mm] 7,5, Kiruna Östersund Umeå Sundsvall Mora Västerås Gävle Uppsala Halmstad Karlskrona Stockholm Örebro Lund Malmö Göteborg
Graphs are one type of visualisation Example: Which Swedish town(s) have warmer than 2 C and less than 1 mm of rain? 3, 22,5 15, Temp.[C] Rain [mm] 7,5, Kiruna Östersund Umeå Sundsvall Mora Västerås Gävle Uppsala Halmstad Karlskrona Stockholm Örebro Lund Malmö Göteborg
Some more sophisticated examples Nuclear, Quantum, and Molecular Modeling Structures, Fluids, and Fields Advanced Imaging and Data Management
Some classical examples Dr. John Snow; The Cholera Epidemic in London 1854 Used spot-map to graphically depict cholera incidents. Spatial clusters led to him to the hypothesis that cholera was communicated through contaminated water. Identification and removal of contaminated pump led to reduced mortality and partly confirmed his hypothesis. Note: The visualisation did not prove anything. But was influential to the development of the novel hypothesis which was later proved true.
27
Florence Nightingale 28
Scientific Visualisation! Scientific visualisation is the process of exploring, transforming, and viewing data as images! The data describes natural or physical phenomena or quantities! Often observed (measured) or simulated data! Visualisation is often interactive! We are not trying to create realistic images, but to visualise data in an informative way! Application dependent
General development of visualisation Rather new discipline still developing into subareas Tool users vs. tool developers Collaboration among computer scientists and computational scientists Faster computers, high-speed networks, new user-interfaces
Ch 3: Computer Graphics Primer Creating images with a computer 3D Pixar Animation Studios, All Rights Reserved. http://www.pixar.com/
Computer Graphics Computer graphics aims at creating pictures by mimicking the image formation process that occurs in conventional photography. Purposes: Simulate real things (entertainment) Make visible what cannot really be seen -> CG is the foundation of Visualisation Visualisation is more than computer graphics!
Computer Graphics - Examples Simulate and visualise real things Interior design (Linus Karlsson, CCG 211) Interactive Games Make visible what cannot really be seen Visualisation of semantic networks in SemNet. Hard-Disk utilization (WinDirStat)
Computer Graphics - Ingredients What is needed to mimic photography i.e. to render images with a computer? Virtual objects: 3D models, geometry, material properties Virtual light sources: position, color, attenuation, etc. Virtual camera: position, direction, lens projection Illumination model: Rendering algorithms that model the propagation of light and its interaction with objects in the scene.
Computer Graphics & Visualisation Graphical rendering is one pillar of Scientific/Information Visualisation Graphical Model Lights Camera(s) 3D Objects Computer Graphics Rendering Algorithms Colorful Pictures
Computer Graphics & Visualisation Graphical rendering is one pillar of Scientific/Information Visualisation Scientific/Information Visualisation Graphical Model Lights Camera(s) 3D Objects Computer Graphics Rendering Algorithms Colorful Pictures We gain Insight Ah Ha!!! Data Transfor- Mation & Mapping Conceptual Model Visualisation is more than computer graphics!
3.2 Elements of colour
Visible spectrum
Colour The eye s and the brain s impression of electromagnetic radiation in the visual spectra How is colour perceived? detector rods & cones light source reflecting object red-sensitive green-sensitive blue-sensitive
RGB color space RGB - for additive colour mixing, e.g., on a computer screen
HLS colour space Hue Lightness Saturation Hue: dominant wavelength, tone Lightness: intensity, brightness Saturation: purity, dilution by white Important aspects: Intensity decoupled from colour Related to how humans perceive colour
Color angles for the hue = Red 6 = Yellow 12 = Green 18 = Cyan 24 = Blue 3 = Magenta
3.3 Lights o Point Light: Light is emitted in all directions from a single point in space o Parlallel Light: One can simplify by assuming an infinitely distant point light source! Far distance implies parallel rays o Intensity is constant compared to 1/ distance 2 relationship
3.4 Surface properties The Phong reflection model = Ambient reflection + Diffuse reflection + Specular reflection l θ n v φ r
Putting it all together ambient + diffuse + specular => composed color
46
47
48
3.5 Cameras
Camera movements
3.6 Coordinate systems 4 coordinate systems Model: where the object is defined World: 3D space where actors are positioned View: what is visible to the camera Display: (x, y) pixel locations See Figure 3-14
3.7 Coordinate transformations o 3D to 3D and 3D to 2D o Homogeneous coordinates o 4x4 transformation matrices o Rotation, translation, scaling o (Perspective) projection
Coordinate transformations o Matrix-Vector Multiplication Transformation represented as a M n,k where n=4, k=4. The resulting matrix has n=4 rows and l=1 columns m 11 m 12 m 13 m 14 P = M. m P = 21 m 22 m 23 m 24 y = m 31 m 32 m 33 m 34 m 41 m 42 m 43 m 44 x z 1 m 11 x + m 12 y + m 13 z + m 14 m 21 x + m 22 y + m 23 z + m 24 m 31 x + m 32 y + m 33 z + m 34 m 41 x + m 42 y + m 43 z + m 44
Coordinate transformations o Basic geometric transforms Scale Translation Rotations S = & S $ $ $ % x S y S z #!!!" Doesn t work R x R y & 1 = $ $ cosθ $ % sin θ & cosθ = $ $ $ % sin θ 1 # sin θ!! cosθ!" sin θ #!! cosθ! " R z = & cosθ $ $ sin θ $ % sin θ cosθ #!! 1! "
Coordinate transformations o Homogenous Coordinates! Scale Translation Rotations!!!! " # $ $ $ $ % & = 1 1 1 1 z y x d d d T!!!! " # $ $ $ $ % & = 1 z y x S S S S!!!! " # $ $ $ $ % & = 1 1 cos sin sin cos θ θ θ θ R z etc,),, ( z y x = v ),1,, ( z y x p = Vector Point
Coordinate transformations o Projective transform (3D -> 2D) (x,y,z,1) -> (x p,y p,const,1) Perspective Projection Matrix: Vertex (normalized homogenous coordinates): Vertex projection: Vertex normalization:
3.9 Rasterisation (scan conversion) Converting a explicit geometric representation into raster image Primitives: Point, Line, Polyline, Polygon, Triangle Strip e.g. Line drawing DDA digital differential analyzer (Bresenham algorithm) e.g. Polygon filling Flood filling Scan conversion
Rasterization Informationsteknologi "Pixel colour is set in a scanline fashion 3D 2D Projection Rasterization Scanline Institutionen för informationsteknologi www.it.uu.se
Polygonal shading Various shading modes differ in how often the illumination equation is evaluated during rasterization! Flat Gouraud Phong Per polygon Per vertex Per pixel
Hidden Surface Removal (HSR) Same object (polygons), shading and and perspective, but different appearance Incorrect occlusion occurs if graphical primitives are rasterized * in arbitrary order * without visibility control
z-buffer algorithm z-buffer Algorithm: Image space hidden surface algorithm -> it maintains visibility control per pixel. Objects are rendered without specific order pixel position (x,y) Depth test is performed in the rasterization process for every pixel z-buffer stores the closest distance of an object that has been drawn at pixel position (x,y) z-buffer (depth - value) Maintains correct occlusion Observer Frame Buffer, Color Buffer (pixel color RGBA)
z-buffer algorithm (Ed Catmull) fill z-buffer with infinite distance for all polygons for each pixel calculate z-value if z(x,y) is closer than z-buffer(x,y) draw pixel z-buffer(x,y)=z(x,y) end end end
Ch 4: The Visualisation Pipeline Visualisation addresses the issues! transformation and representation Transformation:! converting data from its original form into graphics primitives and into computer images Representation:! the internal data structures and the graphics primitives Visualisation transforms a computational form into a graphical form
Visualisation pipeline, cont d The pipeline consists of! objects to represent data! objects to operate on data! indicated direction of data flow (arrow connections between objects)
Process objects Operate on input data to generate output data New data or new form Source objects initiate (read, generate) visualisation data flow Filter objects maintain visualisation data flow Mapper objects terminate (write, graph) visualisation data flow
4.2 A visualisation pipeline Data Object Computational methods, Measured data Process Object Display Source Filter Mapper Procedural, Reader Transforms the data Creates geometric primitives
4.4 Executing the pipeline Causing each process object to operate Most frequent executions due to user interaction! change parameters of process object! change input to process object For efficiency reasons, see to that only execute the process objects whose input has changed Synchronization between process objects required prior to execution
Conclusion Visualisation helps to understand the data and get insight on the data It also is a tool to discover the data and find hidden truths in the data Visualisation use Computer Graphics 68