Introduction to VRML for generating 3-D display

Slides:



Advertisements
Similar presentations
11.1 si31_2001 SI31 Advanced Computer Graphics AGR Lecture 11 VRML - An Introduction.
Advertisements

DEVELOPMENT OF A COMPUTER PLATFORM FOR OBJECT 3D RECONSTRUCTION USING COMPUTER VISION TECHNIQUES Teresa C. S. Azevedo João Manuel R. S. Tavares Mário A.
Computer Graphics- SCC 342
Three Dimensional Viewing
CS 376b Introduction to Computer Vision 04 / 21 / 2008 Instructor: Michael Eckmann.
MAT 105 SP09 Functions and Graphs
Image Maps and Graphics Internet Basics and Far Beyond! Mrs. Wilson.
1 Mesh Generation and Delaunay-Based Meshes Jernej Barbic Computer Science Department Carnegie Mellon University.
Computer Science 103 Chapter 2 HyperText Markup Language (HTML)
Object Orientated Data Topic 5: Multimedia Technology.
Computer Graphics Inf4/MSc Computer Graphics Lecture 11 Texture Mapping.
Introduction to WebCT Sheridan College Architectural Technology.
Make the Main Title with Large Bold Type Your Name and Title Here Your Department Here Texas A&M Health Science Center Make the Main Title with Large Bold.
COMP 175: Computer Graphics March 24, 2015
Virtual reality. Tasks 3D digital model from planes 3D digital model of existing objects Office work Field observations Solid modeling Photogrammetry.
3D Programming Concepts How objects are described in 3D and Rendering Pipelines – A conceptual way of thinking of the steps involved of converting an abstract.
VRML - 1 Virtual Reality Modeling Language (VRML) Peter O’Grady.
Abstract # 0000 Make the Main Title with Large Bold Type Use Smaller Type for the Subtitle. Above Type is 105pt. This Type is 70pt. Make authors’ names.
CP2022 Multimedia Internet Communication1 HTML and Hypertext The workings of the web Lecture 7.
Part 6: Graphics Output Primitives (4) 1.  Another useful construct,besides points, straight line segments, and curves for describing components of a.
Buffers Textures and more Rendering Paul Taylor & Barry La Trobe University 2009.
CS 450: COMPUTER GRAPHICS REVIEW: INTRODUCTION TO COMPUTER GRAPHICS – PART 2 SPRING 2015 DR. MICHAEL J. REALE.
1 Virtual Reality Modeling Language (VRML97) ©Anthony Steed
Object Orientated Data Topic 5: Multimedia Technology.
Geometric Modeling. Volumetric o Collection device obtains regular grid of measurement values Examples: CT, MRI, PET, Ultrasound o Values are interpreted/visualized.
ITIS 1210 Introduction to Web-Based Information Systems Chapter 40 How Virtual Reality Works.
Addison Wesley is an imprint of © 2010 Pearson Addison-Wesley. All rights reserved. Chapter 2 Graphics Programming with C++ and the Dark GDK Library Starting.
Computer Graphics Chapter 6 Andreas Savva. 2 Interactive Graphics Graphics provides one of the most natural means of communicating with a computer. Interactive.
VRML virtual reality modeling language. what is it? standardised (sort of) notation for virtual reality over the web text file (use normal text editor)
Rigid Motion in a Plane Chapter 9 Section 1.
Network for Computational Nanotechnology (NCN) MEEPPV User Guide Xin Tze Tee Electrical and Computer Engineering Purdue University West Lafayette, IN
VRML Anthony Steed Department of Computer Science University College London ©Anthony Steed
Lecture 6 Rasterisation, Antialiasing, Texture Mapping,
Earthworks Volume Computation Algorithm CASLE Jamaica Regional and International Conference 10/10/12 H.A. Nandalal, Trinidad & Tobago Land Surveyor -
12/24/2015 A.Aruna/Assistant professor/IT/SNSCE 1.
Chapter 9 Creating a Reference Document with a Table of Contents and an Index Microsoft Word 2013.
Chapter 3 Device Monitor Screen Otasuke GP-EX! Chapter 3 Device Monitor Screen Chapter 3 Device Monitor Screen.
CS COMPUTER GRAPHICS LABORATORY. LIST OF EXPERIMENTS 1.Implementation of Bresenhams Algorithm – Line, Circle, Ellipse. 2.Implementation of Line,
Holt Geometry 12-1 Reflections 12-1 Reflections Holt Geometry Warm Up Warm Up Lesson Presentation Lesson Presentation Lesson Quiz Lesson Quiz.
Chapter 1: Image processing and computer vision Introduction
© TMC Computer School HC20203 VRML HIGHER DIPLOMA IN COMPUTING Chapter 6 – Texture Maps.
`. Lecture Overview HTML Body Elements Linking techniques HyperText references Linking images Linking to locations on a page Linking to a fragment on.
Chapter 10 Measurement Section 10.5 Surface Area.
Train Body The next series of slides will guide you through the construction of the train body. Start a new drawing and save it as Train Body.
PowerPoint Vocabulary Tabs 1. Backgrounds: Backgrounds are used in presentations to create a more interesting eye-pleasing look. Backgrounds may include.
OpenGL CS418 Computer Graphics John C. Hart. OpenGL Based on GL (graphics library) by Silicon Graphics Inc. (SGI) Advantages: Runs on everything, including.
Viewing. Classical Viewing Viewing requires three basic elements - One or more objects - A viewer with a projection surface - Projectors that go from.
EQ: How can you use transformations to determine if two shapes are congruent? Demonstrated in writing in summary of notes. Warm-Up Reflect this triangle.
1 Chapter 1: Introduction to Graphics. 2 What is computer graphics.
Make the Main Title with Large Bold Type Use Smaller Type for the Subtitle. Above Type is 110pt. This Type is 80pt. Make authors’ names smaller. This is.
Introduction to Transformations / Translations. By the end of this lesson, you will know… Transformations in general: A transformation is a change in.
CMSC5711 Image processing and computer vision
- Introduction - Graphics Pipeline
MPEG-4 Binary Information for Scenes (BIFS)
Rigid Motion in a Plane Geometry.
Warm up Reflect the figure ABCD across the line y=x. List the new coordinates of the points A’B’C’D’.
Modeling 101 For the moment assume that all geometry consists of points, lines and faces Line: A segment between two endpoints Face: A planar area bounded.
Introduction to VRML for generating 3-D display
CMSC5711 Revision 3 CMSC5711 revision 3 ver.x67.8c.
Three Dimensional Viewing
CMSC5711 Image processing and computer vision
Chapter 1: Image processing and computer vision Introduction
Computer Graphics Lecture 20
VRML Shapes.
7.1 Rigid Motion in a Plane Geometry Mr. Qayumi 2010.
Geometric and Intelligent Computing Laboratory
Image processing and computer vision
Congruence Transformations
Algebra 1 ~ Chapter 4.1 The Coordinate Plane.
Page 37 Unit 1, Lesson 5: Coordinate Moves
Presentation transcript:

Introduction to VRML for generating 3-D display Chapter 12 Generate 3D display using VRML KH Wong Chapter12 (v.4b): VRML generation from 3-D data

Chapter12 (v.4b): VRML generation from 3-D data What is VRML? Virtual Reality Modeling Language A demo A language for displaying a virtual reality 3D objects Text based, can be read by most web browser with downloadable add-in. Typical VRML Display viewers e.g. Cortona http://www.cortona3d.com/ Cosmos player http://cosmo-player.en.softonic.com/ Chapter12 (v.4b): VRML generation from 3-D data

Chapter12 (v.4b): VRML generation from 3-D data Basic concept You can only see 2D pictures on a common 2-D screen Based on the feature points, we divide the object into small triangles When the object rotates, we display the shape and texture mapped images of the 2D triangles on screen. The more triangles displayed, the more accurate the output is. VRML is a rich language, but we only show how to display 3-D results of our Structure From Motion SFM algorithms here. Chapter12 (v.4b): VRML generation from 3-D data

Example of a rotated triangle It seems it has been rotated in 3D but you are just seeing the original picture but textured mapped to another triangle Texture mapped Chapter12 (v.4b): VRML generation from 3-D data

Input and data set of a VRML file for an object 3-D Model points of the object One image of the object (called the texture) Based on the input data we need to generate the following data set for the VRML file (i) 3-D Data points (ii) 3-D Triangles If texture map is required (iii)2-D data points (iv) 2-D Triangles Chapter12 (v.4b): VRML generation from 3-D data

2 faces of a cube: 2faces.wrl. #VRML V2.0 utf8 (2faces.wrl) Group { children [ Shape { appearance Appearance { texture ImageTexture { url "baboon.jpg" } } geometry IndexedFaceSet { coord DEF COORD Coordinate { point [ 0 0 1, 1 0 1, 1 1 1, 0 1 1, 0 0 0, 1 0 0, 1 1 0, 0 1 0, ] } coordIndex [ 0 1 2 -1, 0 2 3 -1 3 2 6 -1, 3 6 7 -1, ] texCoord DEF TEXCOORD TextureCoordinate { point [ 0 0, 1 0, 1 0.5, 0 0.5, 0.5 0.5, #not used here 0.5 1,#not used here 1 1, 0 1, ]} texCoordIndex [ 0 1 2 -1, 0 2 3 -1 3 2 6 -1, 3 6 7 -1, ] }} ] } Texture image (III) 2D points (I) 3-D points, see next page (IV) 2-D triangles (II) 3-D Triangles indexes Chapter12 (v.4b): VRML generation from 3-D data

Chapter12 (v.4b): VRML generation from 3-D data We need to prepare 4 tables for the VRML (.wrl) file, plus one texture image. table 3-D points (format: x,y,z), e.g 0 0 1, #point index 0 1 0 1, #point index 1 3-triangles (format: point_index_A, point_index_B, Point_index_C,-1), e.g 0 1 2 -1, # point indexes 0, 1, 2 are vertices of the triangle 0 2 3 -1 # point indexes 0, 2, 3 are vertices of the triangle 2-D points (format: x,y) normalized image position , e.g 0.5 0.3, #point index 0 , each value is from 0 to 1) 0.2 1, #point index 1 2-D triangles (format: point_index A, point_index B, Point_index C,-1), e.g. 0 1 2 -1, #usally the same table (ii) 0 2 3 -1 one texture image (e.g. baboon.jpg here) table table table (1,1) (0,1) (0,0) (1,0) Chapter12 (v.4b): VRML generation from 3-D data

Chapter12 (v.4b): VRML generation from 3-D data 3-D model of a cube Show 2 faces :Front & Top ) Each face has 2 triangles The model of a Cube :X (x,y,z) with indexes(#) and vertices (Only front and top surfaces are displayed) (see next slide) 2-D points (just skip Z of the 3-D points) Normalized values of a picture) 0 0, #0 point 0 1 0, #1 point 1 1 0.5, #2 point 2 0 0.5, #3 point 3 0.5 0.5,#4 point 4 (not used) 0.5 1, #5 point 5 (not used) 1 1, #6 point 6 0 1, #7point 7 2-D Triangles As same 3-D triangles See (left side) # is for comment #7 (0 1 0) #6 (1 1 0) (table (i)) 3-D points 0 0 1, # point 0 1 0 1, # point 1 1 1 1, # point 2 0 1 1, # point 3 0 0 0, # point 4(Origin: not used) 1 0 0, # point 5 (Not used here) 1 1 0, # point 6 0 1 0, # point 7 (table (ii)) Triangles 0 1 2 -1, # triangle 1, using point 1 2 3 0 2 3 -1, # triangle 2, using point 0 2 3 3 2 6 -1, # triangle 3, using point 3 2 6 3 6 7 -1, # triangle 4, using point 3 6 7 #3 (0,1,1) #2 (1 1 1) #4(X=0, Y=0, Z=0) #5 (1 0 0) #0 (0 0 1) #1 (1 0 1) Chapter12 (v.4b): VRML generation from 3-D data

Chapter12 (v.4b): VRML generation from 3-D data A .jpg with normalized pixels values Pixel x,y coordinates range from 0 to 1 Texture map #6 (1, 1) #7 (0, 1) (table iii) 2-D points (just skip Z of the 3-D points) Normalized values of a picture) 0 0, #0 point 0 1 0, #1 point 1 1 0.5, #2 point 2 0 0.5, #3 point 3 0.5 0.5,#4 point 4 (not used) 0.5 1, #5 point 5 (not used) 1 1, #6 point 6 0 1, #7point 7 #2 (1, 0.5) #3 (0, 0.5) #0 (0, 0) #1 (1, 0) (table iv) 2-D points (just skip Z of the 3-D points) Normalized values of a picture) 0 0, #0 point 0 1 0, #1 point 1 1 0.5, #2 point 2 0 0.5, #3 point 3 0.5 0.5,#4 point 4 (not used) 0.5 1, #5 point 5 (not used) 1 1, #6 point 6 0 1, #7point 7 Chapter12 (v.4b): VRML generation from 3-D data

Chapter12 (v.4b): VRML generation from 3-D data The model of a Cube :X (x,y,z) with indexes# and vertices Exercise 1: (i) How many 2-D feature points are in Figure 1 below? (ii) If (0 1 3) is a triangle, create at least 3 different combinations of how to triangulate these 2-D feature points. #7(0,1,0) #6(1,1,0) #3(0,1,1) #2(1,1,1) Textured mapped 4 triangles c(rotated) Demo of 2faces.wrl #0(0,0,1) #1(1,0,1) Wireframes of 4-Triangles (rotated) 3-D points 0 0 1, #0 1 0 1, #1 1 1 1, #2 0 1 1, #3 0 0 0, #4 1 0 0, #5 1 1 0, #6 0 1 0, #7 Traingles 0 1 2 -1, 0 2 3 -1 3 2 6 -1, 3 6 7 -1, #7 #6 The 2 faces of a cube is rotated #2 #3 #0 #1 Demo http://www.youtube.com/watch?v=qieuLWDMVx0&feature=youtu.be Chapter12 (v.4b): VRML generation from 3-D data

Chapter12 (v.4b): VRML generation from 3-D data The model of a Cube :X (x,y,z) with indexes# and vertices Exercise 1: (i) How many 2-D feature points are in Figure 1 below? (ii) If (0 1 3) is a triangle, create at least 3 different combinations of how to triangulate these 2-D feature points. Answer:(i)8. (ii) (013)(123)(326)(367) or (013)(123)(267)(273) or (031)(163)(127)(267) etc.. #7(0,1,0) #6(1,1,0) #3(0,1,1) #2(1,1,1) Textured mapped 4 triangles c(rotated) Demo of 2faces.wrl #0(0,0,1) #1(1,0,1) Wireframes of 4-Triangles (rotated) 3-D points 0 0 1, #0 1 0 1, #1 1 1 1, #2 0 1 1, #3 0 0 0, #4 1 0 0, #5 1 1 0, #6 0 1 0, #7 Traingles 0 1 2 -1, 0 2 3 -1 3 2 6 -1, 3 6 7 -1, #7 #6 The 2 faces of a cube is rotated #2 #3 #0 #1 Demo http://www.youtube.com/watch?v=qieuLWDMVx0&feature=youtu.be Chapter12 (v.4b): VRML generation from 3-D data

Chapter12 (v.4b): VRML generation from 3-D data VRML for displaying results of SFM (structure from motion) How to find the 3-D model and 2-D feature points of the triangles Take a sequence of images of an object: (Imgt=1,Imgt=2,Imgt=3), From images, extract/track 2-D feature points (u,v)i=1,,N(Harris plus cross correlation, or KLT - or SIFT trackers) and use Imgt=1 as the texture map image From 2-D (u,v) t=1,..;i=1..N run SFM Factorization or Bundle adjustment, to obtain the 3-D object model (X)i=1..N So we have 3-D (X)i=1..N and 2-D (u,v) t=1,..;i=1..N points of the images. Run Delaunay triangulation to obtain the triangles Create the 4-tables for the VRML file, and use Img1 as the texture map. KLT -- http://en.wikipedia.org/wiki/Kanade%E2%80%93Lucas%E2%80%93Tomasi_feature_tracker SIFT -- http://en.wikipedia.org/wiki/Scale-invariant_feature_transform Delaunay triangulation --http://en.wikipedia.org/wiki/Delaunay_triangulation Chapter12 (v.4b): VRML generation from 3-D data

Graphical illustration: create a VRML file from SFM result Time (t)  t=1 t= 2 t=3 … (u,v)t=1; i=1 img1 (2) From all 2-D features (u,v)t=1,..; i=1,..,N, run SFM (structure from motion): Factorization, bundle adjustment, etc to object 3-D model points X (x,y,z)i=1,…N (1) From Img1 , obtain (u,v)t=1; i=1,..,N, which are used as the base to track all features in subsequence images using: KLT, SIFT etc. (3)Based on 2-D features (u,v)t=1; i=1,..,N, of img1 , run Delaunay to generate triangles (u,v)t=1; i=1,..,N, of Img1 (4) Create 4 tables for the VRML file, use Img1 as texture Chapter12 (v.4b): VRML generation from 3-D data

What is Delaunay triangulation? In mathematics and computational geometry, a Delaunay triangulation for a set P of points in a plane is a triangulation DT(P) such that no point in P is inside the circumcircle of any triangle in DT(P). Delaunay triangulations maximize the minimum angle of all the angles of the triangles in the triangulation; they tend to avoid skinny triangles. The triangulation is named after Boris Delaunay for his work on this topic from 1934.[1] From http://en.wikipedia.org/wiki/Delaunay_triangulation Correct triangulation by Delaunay Incorrect triangulation: The Delaunay algorithm will not generate such wrong result This triangulation has a cross, it is not allowed, so this triangulation failed Chapter12 (v.4b): VRML generation from 3-D data

Texture map of triangles The model of a Cube :X (x,y,z) with indexes# and vertices Texture map of triangles In a 3-D display by texture map, you are actually seeing the first image at different texture mapped forms. You can use the mouse in Cortona (VRML viewer) to control the viewing angle , the positions of the projected triangles are re-calculated and shown below. #7(0,1,0) #6(1,1,0) #3(0,1,1) #2(1,1,1) #0(0,0,1) #1(1,0,1) The first image (Img1.jpg) as the texture map image Each triangle (totally 4 here) is textured mapped to the new display window based on img1.jpg to create the 3-D viewing effect. You are always seeing the first image. #7 #6 The 2 faces of a cube is rotated Texture map #2 #3 Chapter12 (v.4b): VRML generation from 3-D data #0 #1

Chapter12 (v.4b): VRML generation from 3-D data Summary Studied a virtual reality display file format (the VRML format) Studied how to display 3-D information using a 2-D display device. Studied a triangulation method : Delaunay Studied the method of texture map Chapter12 (v.4b): VRML generation from 3-D data