Lecture Notes in Computer Science Commenced Publication in 1973 Founding and Former Series Editors: Gerhard Goos, Juris Hartmanis, and Jan van Leeuwen
Editorial Board David Hutchison Lancaster University, UK Takeo Kanade Carnegie Mellon University, Pittsburgh, PA, USA Josef Kittler University of Surrey, Guildford, UK Jon M. Kleinberg Cornell University, Ithaca, NY, USA Alfred Kobsa University of California, Irvine, CA, USA Friedemann Mattern ETH Zurich, Switzerland John C. Mitchell Stanford University, CA, USA Moni Naor Weizmann Institute of Science, Rehovot, Israel Oscar Nierstrasz University of Bern, Switzerland C. Pandu Rangan Indian Institute of Technology, Madras, India Bernhard Steffen University of Dortmund, Germany Madhu Sudan Massachusetts Institute of Technology, MA, USA Demetri Terzopoulos University of California, Los Angeles, CA, USA Doug Tygar University of California, Berkeley, CA, USA Gerhard Weikum Max-Planck Institute of Computer Science, Saarbruecken, Germany
5102
Marian Bubak Geert Dick van Albada Jack Dongarra Peter M.A. Sloot (Eds.)
Computational Science – ICCS 2008 8th International Conference Kraków, Poland, June 23-25, 2008 Proceedings, Part II
13
Volume Editors Marian Bubak AGH University of Science and Technology Institute of Computer Science and Academic Computer Center CYFRONET 30-950 Kraków, Poland E-mail:
[email protected] Geert Dick van Albada Peter M.A. Sloot University of Amsterdam Section Computational Science 1098 SJ Amsterdam, The Netherlands E-mail: {dick,sloot}@science.uva.nl Jack Dongarra University of Tennessee Computer Science Department Knoxville, TN 37996, USA E-mail:
[email protected]
Library of Congress Control Number: 2008928941 CR Subject Classification (1998): F, D, G, H, I, J, C.2-3 LNCS Sublibrary: SL 1 – Theoretical Computer Science and General Issues ISSN ISBN-10 ISBN-13
0302-9743 3-540-69386-6 Springer Berlin Heidelberg New York 978-3-540-69386-4 Springer Berlin Heidelberg New York
This work is subject to copyright. All rights are reserved, whether the whole or part of the material is concerned, specifically the rights of translation, reprinting, re-use of illustrations, recitation, broadcasting, reproduction on microfilms or in any other way, and storage in data banks. Duplication of this publication or parts thereof is permitted only under the provisions of the German Copyright Law of September 9, 1965, in its current version, and permission for use must always be obtained from Springer. Violations are liable to prosecution under the German Copyright Law. Springer is a part of Springer Science+Business Media springer.com © Springer-Verlag Berlin Heidelberg 2008 Printed in Germany Typesetting: Camera-ready by author, data conversion by Scientific Publishing Services, Chennai, India Printed on acid-free paper SPIN: 12322206 06/3180 543210
Advancing Science Through Computation
I knock at the stone’s front door. “It’s only me, let me come in. I’ve come out of pure curiosity. Only life can quench it. I mean to stroll through your palace, then go calling on a leaf, a drop of water. I don’t have much time. My mortality should touch you.” Wislawa Szymborska, Conversation with a Stone, in Nothing Twice, 1997 The International Conference on Computational Science (ICCS 2008) held in Krak´ ow, Poland, June 23–25, 2008, was the eighth in the series of highly successful conferences: ICCS 2007 in Beijing, China; ICCS 2006 in Reading, UK; ICCS 2005 in Atlanta; ICCS 2004 in Krakow, Poland; ICCS 2003 held simultaneously in Melbourne, Australia and St. Petersburg, Russia; ICCS 2002 in Amsterdam, The Netherlands; and ICCS 2001 in San Francisco, USA. The theme for ICCS 2008 was “Advancing Science Through Computation,” to mark several decades of progress in computational science theory and practice, leading to greatly improved applications in science. This conference was a unique event focusing on recent developments in novel methods and modeling of complex systems for diverse areas of science, scalable scientific algorithms, advanced software tools, computational grids, advanced numerical methods, and novel application areas where the above novel models, algorithms, and tools can be efficiently applied, such as physical systems, computational and systems biology, environment, finance, and others. ICCS 2008 was also meant as a forum for scientists working in mathematics and computer science as the basic computing disciplines and application areas, who are interested in advanced computational methods for physics, chemistry, life sciences, and engineering. The main objective of this conference was to discuss problems and solutions in all areas, to identify new issues, to shape future directions of research, and to help users apply various advanced computational techniques. During previous editions of ICCS, the goal was to build a computational science community; the main challenge in this edition was ensuring very high quality of scientific results presented at the meeting and published in the proceedings. Keynote lectures were delivered by: – Maria E. Orlowska: Intrinsic Limitations in Context Modeling – Jesus Villasante: EU Research in Software and Services: Activities and Priorities in FP7 – Stefan Bl¨ ugel: Computational Materials Science at the Cutting Edge
VI
Preface
– Martin Walker: New Paradigms for Computational Science – Yong Shi: Multiple Criteria Mathematical Programming and Data Mining – Hank Childs: Why Petascale Visualization and Analysis Will Change the Rules – Fabrizio Gagliardi: HPC Opportunities and Challenges in e-Science – Pawel Gepner: Intel’s Technology Vision and Products for HPC – Jarek Nieplocha: Integrated Data and Task Management for Scientific Applications – Neil F. Johnson: What Do Financial Markets, World of Warcraft, and the War in Iraq, all Have in Common? Computational Insights into Human Crowd Dynamics We would like to thank all keynote speakers for their interesting and inspiring talks and for submitting the abstracts and papers for these proceedings.
Fig. 1. Number of papers in the general track by topic
The main track of ICSS 2008 was divided into approximately 20 parallel sessions (see Fig. 1) addressing the following topics: 1. e-Science Applications and Systems 2. Scheduling and Load Balancing 3. Software Services and Tools
Preface
4. 5. 6. 7. 8. 9. 10.
VII
New Hardware and Its Applications Computer Networks Simulation of Complex Systems Image Processing and Visualization Optimization Techniques Numerical Linear Algebra Numerical Algorithms
# papers 25
23 19
20 17
14
15
14 10
10
8
10
10
10
8
7
9
8
5
Int Agents
Workflows
Environ
Soft. Eng
Develop
Bioinfo
Dyn. Data
Teaching
GeoComp
Networks
Finance
Chemistry
Multiphys
Graphics
0
Fig. 2. Number of papers in workshops
The conference included the following workshops (Fig. 2): 1. 2. 3. 4. 5. 6. 7. 8. 9. 10.
7th Workshop on Computer Graphics and Geometric Modeling 5th Workshop on Simulation of Multiphysics Multiscale Systems 3rd Workshop on Computational Chemistry and Its Applications Workshop on Computational Finance and Business Intelligence Workshop on Physical, Biological and Social Networks Workshop on GeoComputation 2nd Workshop on Teaching Computational Science Workshop on Dynamic Data-Driven Application Systems Workshop on Bioinformatics’ Challenges to Computer Science Workshop on Tools for Program Development and Analysis in Computational Science
VIII
11. 12. 13. 14.
Preface
Workshop Workshop Workshop Workshop
on on on on
Software Engineering for Large-Scale Computing Collaborative and Cooperative Environments Applications of Workflows in Computational Science Intelligent Agents and Evolvable Systems
# participants 100 77
30
27 19 15
12
11
10
8 6 5
5
4
5
2
2
AU
SG
MY
2
1
TW
IR
KR
IL
1
IN
1
BR
SZ
TR
SI
2
DZ
2
MU
2
1
SK
RS
RU
PL
RO
NL
NO
MK
IT
LT
GB
GR
ES
1
2
JP
2
CN
2
MX
2
1
FR
DK
CZ
1
DE
BE
BG
1
1
2
3
US
2
3
AR
2
3
CA
3
UA
3
AT
5
4
Fig. 3. Number of accepted papers by country
Selection of papers for the conference was possible thanks to the hard work of the Program Committee members and about 510 reviewers; each paper submitted to ICCS 2008 received at least 3 reviews. The distribution of papers accepted for the conference is presented in Fig. 3. ICCS 2008 participants represented all continents; their geographical distribution is presented in Fig. 4. The ICCS 2008 proceedings consist of three volumes; the first one, LNCS 5101, contains the contributions presented in the general track, while volumes 5102 and 5103 contain papers accepted for workshops. Volume LNCS 5102 is related to various computational research areas and contains papers from Workshops 1–7, while volume LNCS 5103, which contains papers from Workshops 8–14, is mostly related to computer science topics. We hope that the ICCS 2008 proceedings will serve as an important intellectual resource for computational and computer science researchers, pushing forward the boundaries of these two fields and enabling better collaboration and exchange of ideas. We would like to thank Springer for fruitful collaboration during the preparation of the proceedings. At the conference, the best papers from the general track and workshops were nominated and presented on the ICCS 2008 website; awards were funded by Elsevier and Springer. A number of papers will also be published as special issues of selected journals.
Preface
# participants 100
IX
94
34 28
21 17
16
14
10
9
8 5
5
5
3
3 2
1
1
5
2
2
1
3
3 2
2
3 2
1
1
3 2
2
1
1
AT BE CZ DE DK ES FR GB GR IT LT MK NL NO PL RO RS SI SK SZ TR CA US AR BR MX CN JP IL IN IR KR MY SG TW MU AU
1
5 4
4
Fig. 4. Number of participants by country
We owe thanks to all workshop organizers and members of the Program Committee for their diligent work, which ensured the very high quality of ICCS 2008. We would like to express our gratitude to the Kazimierz Wiatr, Director of ACC CYFRONET AGH, and to Krzysztof Zieli´ nski, Director of the Institute of Computer Science AGH, for their personal involvement. We are indebted to all the members of the Local Organizing Committee for their enthusiastic work towards the success of ICCS 2008, and to numerous colleagues from ACC CYFRONET AGH and the Institute of Computer Science for their help in editing the proceedings and organizing the event. We very much appreciate the help of the computer science students during the conference. We own thanks to the ICCS 2008 sponsors: Hewlett-Packard, Intel, Qumak-Secom, IBM, Microsoft, ATM, Elsevier (Journal Future Generation Computer Systems), Springer, ACC CYFRONET AGH, and the Institute of Computer Science AGH for their generous support. We wholeheartedly invite you to once again visit the ICCS 2008 website (http://www.iccs-meeting.org/iccs2008/), to recall the atmosphere of those June days in Krak´ ow.
June 2008
Marian Bubak G. Dick van Albada Peter M.A. Sloot Jack J. Dongarra
Organization
ICCS 2008 was organized by the Academic Computer Centre Cyfronet AGH in cooperation with the Institute of Computer Science AGH (Krak´ ow, Poland), the University of Amsterdam (Amsterdam,The Netherlands) and the University of Tennessee (Knoxville, USA). All the members of the Local Organizing Committee are staff members of ACC Cyfronet AGH and ICS AGH.
Conference Chairs Conference Chair Workshop Chair Overall Scientific Co-chair Overall Scientific Chair
Marian Bubak (AGH University of Science and Technology, Krak´ ow, Poland) Dick van Albada (University of Amsterdam, The Netherlands) Jack Dongarra (University of Tennessee, USA) Peter Sloot (University of Amsterdam, The Netherlands)
Local Organizing Committee Kazimierz Wiatr Marian Bubak Zofia Mosurska Maria Stawiarska Milena Zaj¸ac Mietek Pilipczuk Karol Fra´ nczak
Sponsoring Institutions Hewlett-Packard Company Intel Corporation Qumak-Sekom S.A. and IBM Microsoft Corporation ATM S.A. Elsevier Springer
Program Committee J.H. Abawajy (Deakin University, Australia) D. Abramson (Monash University, Australia)
XII
Organization
V. Alexandrov (University of Reading, UK) I. Altintas (San Diego Supercomputer Centre, UCSD, USA) M. Antolovich (Charles Sturt University, Australia) E. Araujo (Universidade Federal de Campina Grande, Brazil) M.A. Baker (University of Reading, UK) B. Bali´s (AGH University of Science and Technology, Krak´ ow, Poland) A. Benoit (LIP, ENS Lyon, France) I. Bethke (University of Amsterdam, The Netherlands) J. Bi (Tsinghua University, Beijing, China) J.A.R. Blais (University of Calgary, Canada) K. Boryczko (AGH University of Science and Technology, Krak´ ow, Poland) I. Brandic (Technical University of Vienna, Austria) M. Bubak (AGH University of Science and Technology, Krak´ ow, Poland) K. Bubendorfer (Victoria University of Wellington, New Zealand) B. Cantalupo (Elsag Datamat, Italy) L. Caroprese (University of Calabria, Italy) J. Chen (Swinburne University of Technology, Australia) O. Corcho (Universidad Politcnica de Madrid, Spain) J. Cui (University of Amsterdam, The Netherlands) J.C. Cunha (University Nova de Lisboa, Portugal) S. Date (Osaka University, Japan) S. Deb (National Institute of Science and Technology, Berhampur, India) Y.D. Demchenko (University of Amsterdam, The Netherlands) F. Desprez (INRIA, France) T. Dhaene (Ghent University, Belgium) I.T. Dimov (University of Reading, Bulgarian Academy of Sciences, Bulgaria) J. Dongarra (University of Tennessee, USA) F. Donno (CERN, Switzerland) C. Douglas (University of Kentucky, USA) G. Fox (Indiana University, USA) W. Funika (AGH University of Science and Technology, Krak´ ow, Poland) G. Geethakumari (University of Hyderabad, India) B. Glut (AGH University of Science and Technology, Krak´ ow, Poland) Y. Gorbachev (St.-Petersburg State Polytechnical University, Russia) A.M. Go´sci´ nski (Deakin University, Australia) M. Govindaraju (Binghamton University, USA) G.A. Gravvanis (Democritus University of Thrace, Greece) D.J. Groen (University of Amsterdam, The Netherlands) T. Gubala (Academic Computer Centre Cyfronet AGH, Krak´ow, Poland) M. Hardt (Forschungszentrum Karlsruhe, Germany) T. Heinis (ETH Zurich, Switzerland) L. Hluch´ y (Slovak Academy of Sciences, Slovakia) W. Hoffmann (University of Amsterdam, The Netherlands) A. Iglesias (University of Cantabria, Spain) C.R. Jesshope (University of Amsterdam, The Netherlands)
Organization
XIII
H. Jin (Huazhong University of Science and Technology, China) D. Johnson (University of Reading, UK) B.D. Kandhai (University of Amsterdam, The Netherlands) S. Kawata (Utsunomiya University, Japan) W.A. Kelly (Queensland University of Technology, Australia) J. Kitowski (AGH University of Science and Technology, Krak´ ow, Poland) M. Koda (University of Tsukuba, Japan) D. Kranzlm¨ uller (Johannes Kepler University Linz, Austria) J. Kroc (University of Amsterdam, The Netherlands) B. Kryza (Academic Computer Centre Cyfronet AGH, Krak´ ow, Poland) M. Kunze (Forschungszentrum Karlsruhe, Germany) D. Kurzyniec (Google, Krak´ ow, Poland) A. Lagana (University of Perugia, Italy) L. Lefevre (INRIA, France) A. Lewis (Griffith University, Australia) H.W. Lim (Royal Holloway, University of London, UK) E. Lorenz (University of Amsterdam, The Netherlands) P. Lu (University of Alberta, Canada) M. Malawski (AGH University of Science and Technology, Krak´ ow, Poland) A.S. McGough (London e-Science Centre, UK) P.E.C. Melis (University of Amsterdam, The Netherlands) E.D. Moreno (UEA-BENq, Manaus, Brazil) J.T. Mo´scicki (CERN, Switzerland) S. Naqvi (CETIC, Belgium) P.O.A. Navaux (Universidade Federal do Rio Grande do Sul, Brazil) Z. Nemeth (Hungarian Academy of Science, Hungary) J. Ni (University of Iowa, USA) G.E. Norman (Russian Academy of Sciences, Russia) ´ Nuall´ B.O. ain (University of Amsterdam, The Netherlands) S. Orlando (University of Venice, Italy) M. Paprzycki (Polish Academy of Sciences, Poland) M. Parashar (Rutgers University, USA) C.P. Pautasso (University of Lugano, Switzerland) M. Postma (University of Amsterdam, The Netherlands) V. Prasanna (University of Southern California, USA) T. Priol (IRISA, France) M.R. Radecki (AGH University of Science and Technology, Krak´ ow, Poland) M. Ram (C-DAC Bangalore Centre, India) A. Rendell (Australian National University, Australia) M. Riedel (Research Centre J¨ ulich, Germany) D. Rodr´ıguez Garca (University of Alcal, Spain) K. Rycerz (AGH University of Science and Technology, Krak´ ow, Poland) R. Santinelli (CERN, Switzerland) B. Schulze (LNCC, Brazil) J. Seo (University of Leeds, UK)
XIV
Organization
A.E. Solomonides (University of the West of England, Bristol, UK) V. Stankovski (University of Ljubljana, Slovenia) H. Stockinger (Swiss Institute of Bioinformatics, Switzerland) A. Streit (Forschungszentrum J¨ ulich, Germany) H. Sun (Beihang University, China) R. Tadeusiewicz (AGH University of Science and Technology, Krak´ow, Poland) M. Taufer (University of Delaware, USA) J.C. Tay (Nanyang Technological University, Singapore) C. Tedeschi (LIP-ENS Lyon, France) A. Tirado-Ramos (University of Amsterdam, The Netherlands) P. Tvrdik (Czech Technical University Prague, Czech Republic) G.D. van Albada (University of Amsterdam, The Netherlands) R. van den Boomgaard (University of Amsterdam, The Netherlands) A. Visser (University of Amsterdam, The Netherlands) D.W. Walker (Cardiff University, UK) C.L. Wang (University of Hong Kong, China) A.L. Wendelborn (University of Adelaide, Australia) Y. Xue (Chinese Academy of Sciences, China) F.-P. Yang (Chongqing University of Posts and Telecommunications, China) C.T. Yang (Tunghai University, Taichung, Taiwan) L.T. Yang (St. Francis Xavier University, Canada) J. Yu (Renewtek Pty Ltd, Australia) Y. Zheng (Zhejiang University, China) E.V. Zudilova-Seinstra (University of Amsterdam, The Netherlands)
Reviewers J.H. Abawajy H.H. Abd Allah D. Abramson R. Albert M. Aldinucci V. Alexandrov I. Altintas D. Angulo C. Anthes M. Antolovich E. Araujo E.F. Archibong L. Axner M.A. Baker B. Bali´s S. Battiato M. Baumgartner U. Behn
P. Bekaert A. Belloum A. Benoit G. Bereket J. Bernsdorf I. Bethke B. Bethwaite J.-L. Beuchat J. Bi J. Bin Shyan B.S. Bindhumadhava J.A.R. Blais P. Blowers B. Boghosian I. Borges A.I. Boronin K. Boryczko A. Borzi
A. Boutalib A. Brabazon J.M. Bradshaw I. Brandic V. Breton R. Brito W. Bronsvoort M. Bubak K. Bubendorfer J. Buisson J. Burnett A. Byrski M. Caeiro A. Caiazzo F.C.A. Campos M. Cannataro B. Cantalupo E. Caron
Organization
L. Caroprese U. Catalyurek S. Cerbat K. Cetnarowicz M. Chakravarty W. Chaovalitwongse J. Chen H. Chojnacki B. Chopard C. Choquet T. Cierzo T. Clark S. Collange P. Combes O. Corcho J.M. Cordeiro A.D. Corso L. Costa H. Cota de Freitas C. Cotta G. Cottone C.D. Craig C. Douglas A. Craik J. Cui J.C. Cunha R. Custodio S. Date A. Datta D. De Roure S. Deb V. Debelov E. Deelman Y.D. Demchenko B. Depardon F. Desprez R. Dew T. Dhaene G. Di Fatta A. Diaz-Guilera R. Dillon I.T. Dimov G. Dobrowolski T. Dokken J. Dolado
W. Dong J. Dongarra F. Donno C. Douglas M. Drew R. Drezewski A. Duarte V. Duarte W. Dubitzky P. Edmond A. El Rhalibi A.A. El-Azhary V. Ervin A. Erzan M. Esseffar L. Fabrice Y. Fan G. Farin Y. Fei V. Ferandez D. Fireman K. Fisher A. Folleco T. Ford G. Fox G. Frenking C. Froidevaux K. F¨ ulinger W. Funika H. Fuss A. Galvez R. Garcia S. Garic A. Garny F. Gava T. Gedeon G. Geethakumari A. Gerbessiotis F. Giacomini S. Gimelshein S. Girtelschmid C. Glasner T. Glatard B. Glut M. Goldman
XV
Y. Gorbachev A.M. Go´sci´ nski M. Govindaraju E. Grabska V. Grau G.A. Gravvanis C. Grelck D.J. Groen J.G. Grujic Y. Guang Xue T. Gubala C. Guerra V. Guevara X. Guo Y. Guo N.M. Gupte J.A. Gutierrez de Mesa P.H. Guzzi A. Haffegee S. Hannani U. Hansmann M. Hardt D. Har¸ez˙ lak M. Harman R. Harrison M. Hattori T. Heinis P. Heinzlreiter R. Henschel F. Hernandez V. Hern´andez P. Herrero V. Hilaire y L. Hluch´ A. Hoekstra W. Hoffmann M. Hofmann-Apitius J. Holyst J. Hrusak J. Hu X.R. Huang E. Hunt K. Ichikawa A. Iglesias M. Inda
XVI
Organization
D. Ireland H. Iwasaki B. Jakimovski R. Jamieson A. Jedlitschka C.R. Jesshope X. Ji C. Jim X H. Jin L. Jingling D. Johnson J.J. Johnstone J. Jurek J.A. Kaandorp B. Kahng Q. Kai R. Kakkar B.D. Kandhai S. Kawata P. Kelly W.A. Kelly J. Kennedy A. Kert´esz C. Kessler T.M. Khoshgoftaar C.H. Kim D.S. Kim H.S. Kim T.W. Kim M. Kisiel-Drohinicki J. Kitowski Ch.R. Kleijn H.M. Kl´ıe A. Kn¨ upfer R. Kobler T. K¨ ockerbauer M. Koda I. Kolingerova J.L. Koning V. Korkhov G. Kou A. Koukam J. Ko´zlak M. Krafczyk D. Kramer
D. Kranzlm¨ uller K. Kreiser J. Kroc B. Kryza V.V. Krzhizhanovskaya V. Kumar M. Kunze D. Kurzyniec M. Kuta A. Lagana K. Lai R. Lambiotte V. Latora J. Latt H.K. Lee L. Lefevre A. Lejay J. Leszczy´ nski A. Lewis Y. Li D. Liko H.W. Lim Z. Lin D.S. Liu J. Liu R. Liu M. Lobosco R. Loogen E. Lorenz F. Loulergue M. Low P. Lu F. Luengo Q. Luo W. Luo C. Lursinsap R.M. Lynden-Bell W.Y. Ma N. Maillard D.K. Maity M. Malawski N. Mangala S.S. Manna U. Maran R. Marcjan
F. Marco E. Matos K. Matsuzaki A.S. McGough B. McKay W. Meira Jr. P.E.C. Melis P. Merk M. Metzger Z. Michalewicz J. Michopoulos H. Mickler S. Midkiff L. Minglu M. Mirto M. Mitrovic H. Mix A. Mohammed E.D. Moreno J.T. Mo´scicki F. Mourrain J. Mrozek S. Naqvi S. Nascimento A. Nasri P.O.A. Navaux E. Nawarecki Z. Nemeth A. Neumann L. Neumann J. Ni G. Nikishkov G.E. Norman M. Nsangou J.T. Oden D. Olson M. O’Neill S. Orlando H. Orthmans ´ Nuall´ B.O. ain S. Pal Z. Pan M. Paprzycki M. Parashar A. Paszy´ nska
Organization
M. Paszy´ nski C.P. Pautasso B. Payne T. Peachey S. Pelagatti J. Peng Y. Peng F. Perales M. P´erez D. Pfahl G. Plank D. Plemenos A. Pluchino M. Polak S.F. Portegies Zwart M. Postma B.B. Prahalada V. Prasanna R. Preissl T. Priol T. Prokosch M. Py G. Qiu J. Quinqueton M.R. Radecki B. Raffin M. Ram P. Ramasami P. Ramsamy O.F. Rana M. Reformat A. Rendell M. Riedel J.L. Rivail G.J. Rodgers C. Rodr´ıguez-Leon B. Rodr´ıguez D. Rodr´ıguez D. Rodr´ıguez Garc´ıa F. Rogier G. Rojek H. Ronghuai H. Rosmanith J. Rough F.-X. Roux
X. R´ oz˙ a´ nska M. Ruiz R. Ruiz K. Rycerz K. Saetzler P. Saiz S. Sanchez S.K. Khattri R. Santinelli A. Santos M. Sarfraz M. Satpathy M. Sbert H.F. Schaefer R. Schaefer M. Schulz B. Schulze I. Scriven E. Segredo J. Seo A. Sfarti Y. Shi L. Shiyong Z. Shuai M.A. Sicilia L.P. Silva Barra F. Silvestri A. Simas H.M. Singer V. Sipkova P.M.A. Sloot R. Slota ´ zy´ B. Snie˙ nski A.E. Solomonides R. Soma A. Sourin R. Souto R. Spiteri V. Srovnal V. Stankovski E.B. Stephens M. Sterzel H. Stockinger D. Stokic A. Streit
XVII
B. Strug H. Sun Z. Sun F. Suter H. Suzuki D. Szczerba L. Szirmay-Kalos R. Tadeusiewicz B. Tadic R. Tagliaferri W.K. Tai S. Takeda E.J. Talbi J. Tan S. Tan T. Tang J. Tao M. Taufer J.C. Tay C. Tedeschi J.C. Teixeira D. Teller G. Terje Lines C. Te-Yi A.T. Thakkar D. Thalmann S. Thurner Z. Tianshu A. Tirado A. Tirado-Ramos P. Tjeerd R.F. Tong J. Top H. Torii V.D. Tran C. Troyer P. Trunfio W. Truszkowski W. Turek P. Tvrdik F. Urmetzer V. Uskov G.D. van Albada R. van den Boomgaard M. van der Hoef
XVIII
Organization
R. van der Sman B. van Eijk R. Vannier P. Veltri E.J. Vigmond J. Vill´ a i Freixa A. Visser D.W. Walker C.L. Wang F.L. Wang J. Wang J.Q. Wang J. Weidendorfer C. Weihrauch C. Weijun A. Weise A.L. Wendelborn
E. Westhof R. Wism¨ uller C. Wu C. Xenophontos Y. Xue N. Yan C.T. Yang F.-P. Yang L.T. Yang X. Yang J. Yu M. Yurkin J. Zara I. Zelinka S. Zeng C. Zhang D.L. Zhang
G. Zhang H. Zhang J.J. Zhang J.Z.H. Zhang L. Zhang J. Zhao Z. Zhao Y. Zheng X. Zhiwei A. Zhmakin N. Zhong M.H. Zhu T. Zhu O. Zimmermann J. Zivkovic A. Zomaya E.V. Zudilova-Seinstra
Workshops Organizers 7th Workshop on Computer Graphics and Geometric Modeling A. Iglesias (University of Cantabria, Spain) 5th Workshop on Simulation of Multiphysics Multiscale Systems V.V. Krzhizhanovskaya and A.G. Hoekstra (University of Amsterdam, The Netherlands) 3rd Workshop on Computational Chemistry and Its Applications P. Ramasami (University of Mauritius, Mauritius) Workshop on Computational Finance and Business Intelligence Y. Shi (Chinese Academy of Sciences, China) Workshop on Physical, Biological and Social Networks B. Tadic (Joˇzef Stefan Institute, Ljubljana, Slovenia) Workshop on GeoComputation Y. Xue (London Metropolitan University, UK) 2nd Workshop on Teaching Computational Science Q. Luo (Wuhan University of Science and Technology Zhongnan Branch, China), A. Tirado-Ramos (University of Amsterdam, The Netherlands), Y.-W. Wu
Organization
XIX
(Central China Normal University, China) and H.-W. Wang (Wuhan University of Science and Technology Zhongnan Branch, China) Workshop on Dynamic Data Driven Application Systems C.C. Douglas (University of Kentucky, USA) and F. Darema (National Science Foundation, USA) Bioinformatics’ Challenges to Computer Science M. Cannataro (University Magna Gracia of Catanzaro, Italy), M. Romberg (Research Centre J¨ ulich, Germany), J. Sundness (Simula Research Laboratory, Norway), R. Weber dos Santos (Federal University of Juiz de Fora, Brazil) Workshop on Tools for Program Development and Analysis in Computational Science A. Kn¨ upfer (University of Technology, Dresden, Germany), J. Tao (Forschungszentrum Karlsruhe, Germany), D. Kranzlm¨ uller (Johannes Kepler University Linz, Austria), A. Bode (University of Technology, M¨ unchen, Germany) and J. Volkert (Johannes Kepler University Linz, Austria) Workshop on Software Engineering for Large-Scale Computing D. Rodr´ıguez (University of Alcala, Spain) and R. Ruiz (Pablo de Olavide University, Spain) Workshop on Collaborative and Cooperative Environments C. Anthes (Johannes Kepler University Linz, Austria), V. Alexandrov (University of Reading, UK), D. Kranzlm¨ uller, G. Widmer and J. Volkert (Johannes Kepler University Linz, Austria) Workshop on Applications of Workflows in Computational Science Z. Zhao and A. Belloum (University of Amsterdam, The Netherlands) Workshop on Intelligent Agents and Evolvable Systems K. Cetnarowicz, R. Schaefer (AGH University of Science and Technology, Krak´ ow, Poland) and B. Zheng (South-Central University For Nationalities, Wuhan, China)
Table of Contents – Part II
7th International Workshop on Computer Graphics and Geometric Modeling VII International Workshop on Computer Graphics and Geometric Modeling – CGGM’2008 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Andr´es Iglesias
3
Sliding-Tris: A Sliding Window Level-of-Detail Scheme . . . . . . . . . . . . . . . Oscar Ripolles, Francisco Ramos, and Miguel Chover
5
Efficient Interference Calculation by Tight Bounding Volumes . . . . . . . . . Masatake Higashi, Yasuyuki Suzuki, Takeshi Nogawa, Yoichi Sano, and Masakazu Kobayashi
15
Modeling of 3D Scene Based on Series of Photographs Taken with Different Depth-of-Field . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Marcin Denkowski, Michal Chlebiej, and Pawel Mikolajczak A Simple Method of the TEX Surface Drawing Suitable for Teaching Materials with the Aid of CAS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Masataka Kaneko, Hajime Izumi, Kiyoshi Kitahara, Takayuki Abe, Kenji Fukazawa, Masayoshi Sekiguchi, Yuuki Tadokoro, Satoshi Yamashita, and Setsuo Takato
25
35
Family of Energy Conserving Glossy Reflection Models . . . . . . . . . . . . . . . Michal Radziszewski and Witold Alda
46
Harmonic Variation of Edge Size in Meshing CAD Geometries from IGES Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Maharavo Randrianarivony
56
Generating Sharp Features on Non-regular Triangular Meshes . . . . . . . . . Tetsuo Oya, Shinji Seo, and Masatake Higashi
66
A Novel Artificial Mosaic Generation Technique Driven by Local Gradient Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Sebastiano Battiato, Gianpiero Di Blasi, Giovanni Gallo, Giuseppe Claudio Guarnera, and Giovanni Puglisi Level-of-Detail Triangle Strips for Deforming Meshes . . . . . . . . . . . . . . . . . Francisco Ramos, Miguel Chover, Jindra Parus, and Ivana Kolingerova Triangular B´ezier Approximations to Constant Mean Curvature Surfaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A. Arnal, A. Lluch, and J. Monterde
76
86
96
XXII
Table of Contents – Part II
Procedural Graphics Model and Behavior Generation . . . . . . . . . . . . . . . . . J.L. Hidalgo, E. Camahort, F. Abad, and M.J. Vicent
106
Particle Swarm Optimization for B´ezier Surface Reconstruction . . . . . . . . Akemi G´ alvez, Angel Cobo, Jaime Puig-Pey, and Andr´es Iglesias
116
Geometrical Properties of Simulated Packings of Spherocylinders . . . . . . . Monika Bargiel
126
Real-Time Illumination of Foliage Using Depth Maps . . . . . . . . . . . . . . . . . Jesus Gumbau, Miguel Chover, Cristina Rebollo, and Inmaculada Remolar
136
On-Line 3D Geometric Model Reconstruction . . . . . . . . . . . . . . . . . . . . . . . . H. Zolfaghari and K. Khalili
146
Implementation of Filters for Image Pre-processing for Leaf Analyses in Plantations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Jacqueline Gomes Mertes, Norian Marranghello, and Aledir Silveira Pereira
153
5th Workshop on Simulation of Multiphysics Multiscale Systems Simulation of Multiphysics Multiscale Systems, 5th International Workshop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Valeria V. Krzhizhanovskaya and Alfons G. Hoekstra
165
A Hybrid Model of Sprouting Angiogenesis . . . . . . . . . . . . . . . . . . . . . . . . . . Florian Milde, Michael Bergdorf, and Petros Koumoutsakos
167
Particle Based Model of Tumor Progression Stimulated by the Process of Angiogenesis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Rafal Wcislo and Witold Dzwinel
177
A Multiphysics Model of Myoma Growth . . . . . . . . . . . . . . . . . . . . . . . . . . . Dominik Szczerba, Bryn A. Lloyd, Michael Bajka, and G´ abor Sz´ekely
187
Computational Implementation of a New Multiphysics Model for Field Emission from CNT Thin Films . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . N. Sinha, D. Roy Mahapatra, R.V.N. Melnik, and J.T.W. Yeow
197
A Multiphysics and Multiscale Software Environment for Modeling Astrophysical Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ´ Nuall´ Simon Portegies Zwart, Steve McMillan, Breannd´ an O ain, Douglas Heggie, James Lombardi, Piet Hut, Sambaran Banerjee, Houria Belkus, Tassos Fragos, John Fregeau, Michiko Fuji, Evghenii Gaburov, Evert Glebbeek, Derek Groen, Stefan Harfst, Rob Izzard, Mario Juri´c, Stephen Justham, Peter Teuben, Joris van Bever, Ofer Yaron, and Marcel Zemp
207
Table of Contents – Part II
Dynamic Interactions in HLA Component Model for Multiscale Simulations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Katarzyna Rycerz, Marian Bubak, and Peter M.A. Sloot
XXIII
217
An Agent-Based Coupling Platform for Complex Automata . . . . . . . . . . . Jan Hegewald, Manfred Krafczyk, Jonas T¨ olke, Alfons Hoekstra, and Bastien Chopard
227
A Control Algorithm for Multiscale Simulations of Liquid Water . . . . . . . Evangelos M. Kotsalis and Petros Koumoutsakos
234
Multiscale Models of Quantum Dot Based Nanomaterials and Nanodevices for Solar Cells . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Alexander I. Fedoseyev, Marek Turowski, Ashok Raman, Qinghui Shao, and Alexander A. Balandin
242
Multi-scale Modelling of the Two-Dimensional Flow Dynamics in a Stationary Supersonic Hot Gas Expansion . . . . . . . . . . . . . . . . . . . . . . . . . . . Giannandrea Abbate, Barend J. Thijsse, and Chris R. Kleijn
251
Multiscale Three-Phase Flow Simulation Dedicated to Model Based Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Dariusz Choi´ nski, Mieczyslaw Metzger, and Witold Noco´ n
261
Simulation of Sound Emitted from Collision of Droplet with Shallow Water by the Lattice Boltzmann Method . . . . . . . . . . . . . . . . . . . . . . . . . . . Shinsuke Tajiri, Michihisa Tsutahara, and Hisao Tanaka
271
Multiscale Numerical Models for Simulation of Radiation Events in Semiconductor Devices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Alexander I. Fedoseyev, Marek Turowski, Ashok Raman, Michael L. Alles, and Robert A. Weller Scale-Splitting Error in Complex Automata Models for Reaction-Diffusion Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Alfonso Caiazzo, Jean Luc Falcone, Bastien Chopard, and Alfons G. Hoekstra Wavelet Based Spatial Scaling of Coupled Reaction Diffusion Fields . . . . Sudib K. Mishra, Krishna Muralidharan, Pierre Deymier, George Frantziskonis, Srdjan Simunovic, and Sreekanth Pannala
281
291
301
Domain Decomposition Methodology with Robin Interface Matching Conditions for Solving Strongly Coupled Problems . . . . . . . . . . . . . . . . . . . Fran¸cois-Xavier Roux
311
Transient Boundary Element Method and Numerical Evaluation of Retarded Potentials . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Ernst P. Stephan, Matthias Maischak, and Elke Ostermann
321
XXIV
Table of Contents – Part II
A Multiscale Approach for Solving Maxwell’s Equations in Waveguides with Conical Inclusions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Franck Assous and Patrick Ciarlet Jr.
331
3rd Workshop on Computational Chemistry and Its Applications 3rd Workshop on Computational Chemistry and Its Applications (3rd CCA) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Ponnadurai Ramasami First Principle Gas Phase Study of the Trans and Gauche Rotamers of 1,2-Diisocyanoethane, 1,2-Diisocyanodisilane and Isocyano(isocyanomethyl)silane . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Ponnadurai Ramasami A Density Functional Theory Study of Oxygen Adsorption at Silver Surfaces: Implications for Nanotoxicity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Brahim Akdim, Saber Hussain, and Ruth Pachter Mechanism of Influenza A M2 Ion-Channel Inhibition: A Docking and QSAR Study . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Alexander V. Gaiday, Igor A. Levandovskiy, Kendall G. Byler, and Tatyana E. Shubina
343
344
353
360
A Java Tool for the Management of Chemical Databases and Similarity Analysis Based on Molecular Graphs Isomorphism . . . . . . . . . . . . . . . . . . . ´ Irene Luque Ruiz and Miguel Angel G´ omez-Nieto
369
Noncanonical Base Pairing in RNA: Topological and NBO Analysis of Hoogsteen Edge - Sugar Edge Interactions . . . . . . . . . . . . . . . . . . . . . . . . . . Purshotam Sharma, Harjinder Singh, and Abhijit Mitra
379
Design of Optimal Laser Fields to Control Vibrational Excitations in Carboxy-myoglobin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Harjinder Singh, Sitansh Sharma, Praveen Kumar, Jeremy N. Harvey, and Gabriel G. Balint-Kurti Computations of Ground State and Excitation Energies of Poly(3-methoxy-thiophene) and Poly(thienylene vinylene) from First Principles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A.V. Gavrilenko, S.M. Black, A.C. Sykes, C.E. Bonner, and V.I. Gavrilenko
387
396
Workshop on Computational Finance and Business Intelligence Workshop on Computational Finance and Business Intelligence . . . . . . . . Yong Shi, Shouyang Wang, and Xiaotie Deng
407
Table of Contents – Part II
XXV
Parallelization of Pricing Path-Dependent Financial Instruments on Bounded Trinomial Lattices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Hannes Schabauer, Ronald Hochreiter, and Georg Ch. Pflug
408
Heterogeneity and Endogenous Nonlinearity in an Artificial Stock Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Hongquan Li, Wei Shang, and Shouyang Wang
416
Bound for the L2 Norm of Random Matrix and Succinct Matrix Approximation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Rong Liu, Nian Yan, Yong Shi, and Zhengxin Chen
426
Select Representative Samples for Regularized Multiple-Criteria Linear Programming Classification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Peng Zhang, Yingjie Tian, Xingsen Li, Zhiwang Zhang, and Yong Shi
436
A Kernel-Based Technique for Direction-of-Change Financial Time Series Forecasting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Andrew Skabar
441
An Optimization-Based Classification Approach with the Non-additive Measure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Nian Yan, Zhengxin Chen, Rong Liu, and Yong Shi
450
A Selection Method of ETF’s Credit Risk Evaluation Indicators . . . . . . . Ying Zhang, Zongfang Zhou, and Yong Shi
459
Estimation of Market Share by Using Discretization Technology: An Application in China Mobile . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Xiaohang Zhang, Jun Wu, Xuecheng Yang, and Tingjie Lu
466
A Rough Set-Based Multiple Criteria Linear Programming Approach for Classification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Zhiwang Zhang, Yong Shi, Peng Zhang, and Guangxia Gao
476
Predictive Modeling of Large-Scale Sequential Curves Based on Clustering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Wen Long and Huiwen Wang
486
Estimating Real Estate Value-at-Risk Using Wavelet Denoising and Time Series Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Kaijian He, Chi Xie, and Kin Keung Lai
494
The Impact of Taxes on Intra-week Stock Return Seasonality . . . . . . . . . . Virgilijus Sakalauskas and Dalia Kriksciuniene
504
A Survey of Formal Verification for Business Process Modeling . . . . . . . . Shoichi Morimoto
514
XXVI
Table of Contents – Part II
Workshop on Physical, Biological and Social Networks Network Modeling of Complex Dynamic Systems . . . . . . . . . . . . . . . . . . . . Bosiljka Tadi´c
525
Clustering Organisms Using Metabolic Networks . . . . . . . . . . . . . . . . . . . . . Tomasz Arod´z
527
Influence of Network Structure on Market Share in Complex Market Structures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Makoto Uchida and Susumu Shirayama
535
When the Spatial Networks Split? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Joanna Natkaniec and Krzysztof Kulakowski
545
Search of Weighted Subgraphs on Complex Networks with Maximum Likelihood Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Marija Mitrovi´c and Bosiljka Tadi´c
551
Spectral Properties of Adjacency and Distance Matrices for Various Networks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Krzysztof Malarz
559
Simplicial Complexes of Networks and Their Statistical Properties . . . . . Slobodan Maleti´c, Milan Rajkovi´c, and Danijela Vasiljevi´c
568
Movies Recommendation Networks as Bipartite Graphs . . . . . . . . . . . . . . . Jelena Gruji´c
576
Dynamical Regularization in Scalefree-Trees of Coupled 2D Chaotic Maps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Zoran Levnaji´c
584
Physics Based Algorithms for Sparse Graph Visualization . . . . . . . . . . . . . ˇ Milovan Suvakov
593
Workshop on GeoComputation High Performance Geocomputation - Preface . . . . . . . . . . . . . . . . . . . . . . . . Yong Xue, Dingsheng Liu, Jianwen Ai, and Wei Wan
603
Study on Implementation of High-Performance GIServices in Spatial Information Grid . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Fang Huang, Dingsheng Liu, Guoqing Li, Yi Zeng, and Yunxuan Yan
605
Numerical Simulation of Threshold-Crossing Problem for Random Fields of Environmental Contamination . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Robert Jankowski
614
Table of Contents – Part II
A Context-Driven Approach to Route Planning . . . . . . . . . . . . . . . . . . . . . . Hissam Tawfik, Atulya Nagar, and Obinna Anya InterCondor: A Prototype High Throughput Computing Middleware for Geocomputation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Yong Xue, Yanguang Wang, Ying Luo, Jianping Guo, Jianqin Wang, Yincui Hu, and Chaolin Wu
XXVII
622
630
Discrete Spherical Harmonic Transforms: Numerical Preconditioning and Optimization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . J.A. Rod Blais
638
A Data Management Framework for Urgent Geoscience Workflows . . . . . Jason Cope and Henry M. Tufo
646
2nd Workshop on Teaching Computational Science Second Workshop on Teaching Computational Science – WTCS 2008 . . . A. Tirado-Ramos and Q. Luo
657
Using Metaheuristics in a Parallel Computing Course . . . . . . . . . . . . . . . . . ´ Angel-Luis Calvo, Ana Cort´es, Domingo Gim´enez, and Carmela Pozuelo
659
Improving the Introduction to a Collaborative Project-Based Course on Computer Network Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Felix Freitag, Leandro Navarro, and Joan Manuel Marqu`es
669
Supporting Materials for Active e-Learning in Computational Models . . . Mohamed Hamada
678
Improving Software Development Process Implemented in Team Project Course . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Iwona Dubielewicz and Bogumila Hnatkowska
687
An Undergraduate Computational Science Curriculum . . . . . . . . . . . . . . . . Angela B. Shiflet and George W. Shiflet
697
Cryptography Adapted to the New European Area of Higher Education . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A. Queiruga Dios, L. Hern´ andez Encinas, and D. Queiruga
706
An Introductory Computer Graphics Course in the Context of the European Space of Higher Education: A Curricular Approach . . . . . . . . . . Akemi G´ alvez, Andr´es Iglesias, and Pedro Corcuera
715
Collaborative Environments through Dialogues and PBL to Encourage the Self-directed Learning in Computational Sciences . . . . . . . . . . . . . . . . . Fernando Ramos-Quintana, Josefina S´ amano-Galindo, and V´ıctor H. Z´ arate-Silva
725
XXVIII
Table of Contents – Part II
The Simulation Course: An Innovative Way of Teaching Computational Science in Aeronautics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Ricard Gonz´ alez-Cinca, Eduard Santamaria, and J. Luis A. Yebra
735
Author Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
745
VII International Workshop on Computer Graphics and Geometric Modeling – CGGM’2008 Andr´es Iglesias Department of Applied Mathematics and Computational Sciences, University of Cantabria, Avda. de los Castros, s/n, E-39005, Santander, Spain
[email protected] http://personales.unican.es/iglesias/
Abstract. This short paper is intended to give our readers a brief insight about the Seventh International Workshop on Computer Graphics and Geometric Modeling-CGGM’2008, held in Krakow (Poland), June 23-25 2008 as a part of the ICCS’2008 general conference.
1 1.1
CGGM Workshops Aims and Scope
Computer Graphics (CG) and Geometric Modeling have become two of the most important and challenging areas of Computer Science. The CGGM workshops seek for high-quality papers describing original research results in those fields. Topics of the workshop include (but not limited to): geometric modeling, solid modeling, CAD/CAM, physically-based modeling, surface reconstruction, geometric processing and CAGD, volume visualization, virtual avatars, computer animation, CG in Art, Education, Engineering, Entertainment and Medicine, rendering techniques, multimedia, non photo-realistic rendering, virtual and augmented reality, virtual environments, illumination models, texture models, CG and Internet (VRML, Java, X3D, etc.), artificial intelligence for CG, CG software and hardware, CG applications, CG education and new directions in CG. 1.2
CGGM Workshops History
The history of the CGGM workshops dates back eight years ago, when some researchers decided to organize a series of international conferences on all aspects of computational science. The first edition of this annual conference was held in San Francisco in 2001 under the name of International Conference on Computational Science, ICCS. This year ICCS is held in Krakow (Poland). After ICCS’2001, I realized that no special event devoted to either computer graphics or geometric modeling had been organized at that conference. Aiming to fill this gap, I proposed a special session on these topics to ICCS’2002 organizers. Their enthusiastic reply encouraged me to organize the first edition of M. Bubak et al. (Eds.): ICCS 2008, Part II, LNCS 5102, pp. 3–4, 2008. c Springer-Verlag Berlin Heidelberg 2008
4
A. Iglesias
this workshop, CGGM’2002. A total of 81 papers from 21 countries were submitted to the workshop, with 35 high-quality papers finally accepted and published by Springer-Verlag, in its Lectures Notes in Computer Science series, vol. 2330. This great success and the positive feedback of authors and participants motivated that CGGM became an annual event on its own. Subsequent editions were held as follows (see [1] for details): CGGM’2003 in Montreal (Canada), CGGM’2004 in Krakow (Poland), CGGM’2005 in Atlanta (USA), CGGM’2006 in Reading (UK) and CGGM’2007 in Beijing (China). All of them were published by Springer-Verlag, in its Lecture Notes in Computer Science series, volumes 2668, 3039, 3515, 3992 and 4488 with a total of 52, 24, 22, 22 and 20 contributions, respectively. In addition, one Special issue has been published in 2004 in the Future Generation Computer Systems – FGCS journal [2]. Another special issue on CGGM’2007 is in the way to be published this year in the Advances in Computational Science and Technology-ACST journal [3].
2
CGGM’2008
This year CGGM has received a total of 39 papers of which 17 have been accepted as full papers and 1 as short paper. The reader is referred to [4] for more information about the workshop. The workshop chair would like to thank the authors, including those whose papers were not accepted, for their contributions. I also thank the referees (see the CGGM’2008 International Program Committee and CGGM’2008 International Reviewer Board in [4]) for their hard work in reviewing the papers and making constructive comments and suggestions, which have substantially contributed to improving the workshop. It is expected that some workshop papers will be selected for publication in extended and updated form in a Special Issue on CGGM’2008. Details will appear in [4] at due time. Acknowledgements. This workshop has been supported by the Spanish Ministry of Education and Science, National Program of Computer Science, Project Ref. TIN2006-13615. The CGGM’2008 chair also thanks Dick van Albada, workshops chair of general conference ICCS’2008 for his all-time availability and diligent work during all stages of the workshop organization. It is a pleasure to work with you, Dick!
References 1. Previous CGGMs, http://personales.unican.es/iglesias/CGGM2008/Previous.htm 2. Iglesias, A. (ed.): Special issue on Computer Graphics and Geometric Modeling. Future Generation Computer Systems 20(8), 1235–1387 (2004) 3. Iglesias, A. (ed.): Special issue on Computer Graphics and Geometric Modeling. Advances in Computational Science and Technology (in press) 4. CGGM, web page (2008), http://personales.unican.es/iglesias/CGGM2008/
Sliding-Tris: A Sliding Window Level-of-Detail Scheme Oscar Ripolles, Francisco Ramos, and Miguel Chover Universitat Jaume I, Castellon, Spain {oripolle,jromero,chover}@uji.es
Abstract. Virtual environments for interactive applications demand highly realistic scenarios, which tend to be large and densely populated with very detailed meshes. Despite the outstanding evolution of graphics hardware, current GPUs are still not capable of managing these vast amounts of geometry. A solution to overcome this problem is the use of level-of-detail techniques, which recently have been oriented towards the exploitation of GPUs. Nevertheless, although some solutions present very good results, they are usually based on complex data structures and algorithms. We thus propose a new multiresolution model based on triangles which is simple and efficient. The main idea is to modify the list of vertices when changing to a new level of detail, in contrast to previous models which modify the index list, which simplifies the extraction process. This feature also provides a perfect framework for adapting the algorithm to work completely on the GPU. Keywords: Multiresolution, Level of Detail, GPU, Sliding-Window.
1
Introduction
Nowadays, applications such as computer games, virtual reality or scientific simulations are increasing the detail of their environments with the aim of offering more realism. This objective usually involves dealing with larger environments containing lots of objects which amount to a large quantity of triangles. However, despite the constant improvements in performance and capabilities of GPUs, it is still difficult to render such complex scenes as vertex throughput and memory bandwidth become considerable bottlenecks when dealing with them. As a result, these environments cannot be interactively rendered by brute force methods. Among the solutions to overcome this limitation, one of the most widely used is multiresolution modeling. A level-of-detail or multiresolution model is a compact description of multiple representations of a single object [1] that must be capable of extracting the appropriate representation in different contexts. In recent years, many solutions based on level-of-detail techniques have been presented. Nevertheless, only a few exploit, in one way or another, some of the current GPU functionalities. However, although they provide interactive rates, they require complex data structures and algorithms to manage them. In this paper we describe a multiresolution model for real-time rendering of arbitrary M. Bubak et al. (Eds.): ICCS 2008, Part II, LNCS 5102, pp. 5–14, 2008. c Springer-Verlag Berlin Heidelberg 2008
6
O. Ripolles, F. Ramos, and M. Chover
meshes which contributes to diminish the existing distance between a multiresolution GPU-based solution and its implementation in any 3D application. Our approach includes the following contributions: – A simple data structure based on vertex hierarchies adapted to the GPU architecture. The vertex hierarchy is given through the edge contraction operations of the simplification process [2]. – Storage cost with low memory requirements. – Representations are stored and processed entirely in the GPU avoiding the typical bottleneck between the CPU and the GPU and thus obtaining a great performance by exploiting the implicit parallelism existing in current GPUs. This paper presents the following structure. Section 2 contains a study of the work previously carried out on GPU-friendly multiresolution modeling. Section 3 presents the basic framework of Sliding-Tris. Section 4 provides thorough details of the implementations of the algorithms in both the CPU and the GPU. Section 5 includes a comparative study of spatial cost and rendering time. Lastly, Section 6 comments on the results obtained in our tests.
2
Related Work
Evolution of graphics hardware has given rise to new techniques that allow us to accelerate multiresolution models. This research field has been exploited for many years, and it is possible to find a wealth of papers which present very different solutions. Nevertheless, the authors have lately re-oriented their efforts towards the development of new models which consider the possibilities offered by new graphics hardware. Recent GPUs include vertex and fragment processors, which have evolved from being configurable to being programmable, allowing us to execute shader programs in parallel. In general, multiresolution models can be classified into two large groups [3]: discrete models, which contain various representations of the same object, and continuous models, which represent a vast range of approximations. With respect to discrete models, they offer a very efficient solution but they usually present visual artifacts when switching between pre-calculated levels of detail. A possible solution to avoid these popping artifacts is the use of geomorphing [4] or blending [5] in the GPU. A more thorough method is that presented in [6], which consists in sending to the GPU a mesh at minimum level of detail and applying later a refining pattern in the GPU to every face of the model. The problem, according to the authors, is that it suffers again the popping effects. Another aspect is the load suffered by the GPU when a model keeps the level of detail, as a pass must be made for each face that the coarser model has. It is possible to find in the literature continuous algorithms aimed at rendering common meshes by exploiting GPUs. The LodStrips model was reconsidered in [7] to offer a GPU-oriented solution, by creating efficient data structures that can be integrated into the GPU. Ji et al. [8] suggest a method to select and visualize several levels of detail by using the GPU. In particular, they encode
Sliding-Tris: A Sliding Window Level-of-Detail Scheme
7
the geometry in a quadtree based on a LOD atlas texture. The main problem of this method is the costly process that the CPU must execute in every change of level of detail. Moreover, if the mesh is too complex, the representation with quadtrees can be very inefficient and even the size of the video memory can be an important restriction. Finally, the work presented by Turchyn [9] is based on Progressive Meshes. It builds a complex hierarchical data structure that derives in great memory requirements. Moreover, it changes the mesh connectivity trying to reduce memory costs. Many of the GPU-based continuous models are aimed at view-dependent rendering of massive models. Works like [10],[11],[12] have adapted their data structures so that CPU/GPU communication can be optimized to fully exploit the complex memory hierarchy of modern graphics platforms. With a similar objective but with a further GPU exploitation, the GoLD method [13] introduces a hierarchy of geometric patches for very detailed meshes with high-resolution textures. The maintenance of boundaries is assured by means of geomorphing performed in the GPU. Finally, the work presented in [14] introduces a multigrained hierarchical solution which avoids the appearance of cracks in the borders of nodes at different LODs by applying a border-stitching approach directly in the GPU. In general, discrete models are easier to be implemented in GPUs but they do not avoid the popping artifacts. By contrast, continuous models offer a better granularity and avoid that problem, although their memory requirements are high and some of them even need several rendering passes for one LOD change.
3
Our Approach
The solution we are presenting offers an easy and fast level-of-detail update which, contrary to previous multiresolution models, modifies the list of vertices instead of the indices. The basic idea is to order indices and vertices so that we can apply a sliding-window approach to the level-of-detail extraction process. Before explaining in detail the basis of our proposed solution, it is important to comment on the simplification algorithm that we will use for obtaining the sequence of approximations of the original model. This sequence will be used to obtain a progressive coarsening (and refinement) of the original model. 3.1
Mesh Simplification
It is possible to find plenty of research on appearance-preserving simplifications methods. The most important contributions have been made in the areas of geometric-based algorithms[15],[16] and viewpoint-based approaches[17],[18],[19]. Among these works, we will use an edge-collapse based method which preserves texture appearance [19]. It is important to comment that in these collapse operations we will not modify vertices coordinates, as we assumed that the vertex that disappears will collapse to an existing one. The selection of this type of edgecollapse simplifies the data structures of our model and still offers very accurate
8
O. Ripolles, F. Ramos, and M. Chover
Fig. 1. Simplification of a section of a polygonal model
simplifications. An example of this simplification process can be observed in Fig. 1, where a section of a polygonal mesh is simplified with two edge-collapse operations. 3.2
Sliding-Tris Framework
This multiresolution model represents a mesh with three different sets. Let M be the original polygonal surface and V and T its sets of vertices and triangles. We will also define the set E, which refers to the evolution of each vertex and will be explained later. Considering that n is the number of vertices and m is the number of triangles, M = {V, T, E} can be defined as: V = {v0 , v1 , ..., vn }, T = {t0 , t1 , ..., tm }, E = {e0 , e1 , ..., en }
(1)
As we have previously commented, the main idea of Sliding-Tris is to update the contents of the vertices list instead of the indices one. As an example, collapsing vertex i to vertex j would mean that the coordinates values of vertex i will be replaced with the values of vertex j. The multiresolution model we are presenting is also based on the adequate ordering of vertices and triangles: – Vertices: they are ordered following the collapse order, so that vertex i will collapse when changing from lod i − 1 to lod i. – Triangles: they are ordered according to their elimination order, so that the last triangle will be the first one to disappear. Following with the simplification example offered in the previous section, the correct ordering of the initial mesh should be the one presented in Fig. 2. On top we present the original contents of the triangles and vertices lists. In the bottom, we offer the ordered lists obtained following our requirements. Thus, we can see how vertex 4 is now vertex 0 and vertex 0 is now vertex 1, following the order of vertex collapses. In a similar way, triangles 6 and 2 are now the last ones, as they will be the first ones to disappear. As we already commented, we will need to store the evolution of each vertex. The evolution reflects the different vertices an original one collapses to throughout
Sliding-Tris: A Sliding Window Level-of-Detail Scheme
9
Fig. 2. Initial ordering (top) and re-order of triangles and vertices (bottom)
// LOD Extraction algorithm. for (vert=0 to demandedLOD ) { i = 0; while (Evolution[vert][i] < demandedLOD) i++; CopyVertex(CurrentVertices[vert],OriginalVertices[i]); } // Visualization algorithm. numTriangles -= 2*(demandedLOD-currentLOD); //If increasing detail add. glDrawElements (Triangles,0,numTriangles,...); Fig. 3. Pseudocode of a simple CPU implementation of the LOD algorithms
the levels of detail. Thus, each ei element will be composed of a list of references to the vertices that vertex i collapses to. As the vertices have been ordered following the collapse order, we will be able to know in which LOD a particular vertex must change. More precisely, we can assure that the evolution of vertex i satisfies that we must use the contents of its j-th element while ei,j ≤ demandedLOD < ei,j+1 . Finally, we will also have to store a copy of the original vertices, which will be used for updating the value of each vertex when traversing the different LODs. Once we have fulfilled all these requirements, we are ready to start with the algorithm that will enable us to obtain all the levels of detail (Fig. 3). Each time we change to a different LOD we must check every vertex to see if it is necessary to update it. Nevertheless, due to the order we have chosen for the vertices, it will only be necessary to check vertices from 0 to demandedLOD − 1. Once we have updated the necessary vertices, the sliding-window approach is applied to render the suitable number of indices.
10
O. Ripolles, F. Ramos, and M. Chover
Fig. 4. Example of the extraction process of three levels-of-detail
Fig. 4 presents the evolution of the example mesh during three edge collapses. This figure includes, for each level of detail, the array of triangles and vertices and, for each vertex, its evolution. The array of triangles is shaded following the sliding-window approach. With respect to the evolution, the shaded cell reflects the current contents of the vertex. Following the algorithm introduced in Fig. 3, let’s suppose we change from LOD 0 to LOD 1. We would decrease the triangle count bt two and, in this case, we would only modify vertex 0 so that its coordinates are updated with the contents of vertex 1. For the second LOD change, vertices 0 and 1 must be updated, and according to the contents of their evolution, they must change their values for vertex 5.
4
Sliding-Tris Implementation
In this section we will introduce different possible implementations of the original algorithm which will allow us to exploit the graphics hardware. The first version will store the mesh information in the GPU, updating it in the most appropriate way. Nevertheless, this solution still involves data traffic through the BUS. As a consequence, we will also present the GPU implementations of the algorithm in both the vertex shader and the pixel shader, which reduce the traffic to just uploading the value of the new demandedLOD.
Sliding-Tris: A Sliding Window Level-of-Detail Scheme
11
CPU Version. Storing the information in buffers in the GPU offers a faster rendering. Thus, this version uploads indices and vertices to the GPU. It is important to comment that we must keep a copy of the current vertices and also the original ones in the CPU, as well as the evolution of the vertices. The extraction process is similar to that presented in Fig. 3, but once we have updated the array of vertices in the CPU, we will upload it to GPU. More precisely, we will carefully delimit the vertices to transfer to minimize traffic. We can then render the mesh by indicating how many triangles must be considered. Exploiting the Possibilities of the Vertex Shader. For adapting the algorithm to shaders in the GPU, the first problem we must address is how to store the necessary information (the evolution and the original vertices) in the GPU. On the one hand, we create a floating point texture to store the original values of the vertices. On the other, the evolution of each vertex will be stored in different sets of its attributes, mainly in unused MultiTexCoords. These vertex attributes can store 4 components, which in our case represent 4 elements of the evolution. We will use as many attributes as necessary. For efficiency, we store all the vertex attributes in a single interleaved array. Once the data is stored, the only information that the CPU must send to the GPU is the new LOD value. The original extraction process has been carefully adapted to work on a vertex shader, consulting the attributes to analyze the evolution and accessing the texture once the correct value of the evolution is obtained. Thus, each vertex uses this shader to correctly update its coordinates. An important issue with this version is that we oblige the vertex shader to update the coordinates even when the LOD is maintained, as we are not storing the resulting vertex buffer. This is an important disadvantage, but we must consider than in interactive applications the user keeps moving all the time, and under these conditions the detail must be updated very often. Exploiting the Possibilities of the Pixel Shader. To overcome the limitation of the vertex shader implementation, we adapted the Sliding-Tris algorithm to a pixel shader. In this case, we will use a render-to-vertex approach to store the newly calculated vertices. With respect to storing the necessary data, we will still use a texture to store the initial values of the vertices, but we will create a new one to store the evolution of the vertices. The main algorithm must consider the render-to-vertex operation[20]. This way, before rendering the model we will define a viewport and render a quad that fills it, covering as many pixels as vertices we must update. Thus, each pixel will use the shader to compute the value of a different vertex. This pixel shader will use a routine similar to the vertex shader but, in this case, consulting the evolution of a vertex implies accessing a texture instead of the attributes. Once all pixels have been evaluated, the CPU must perform an extra operation which involves reading the output buffer into a VertexBufferObject via ReadPixels. Then, we can disable this pixel shader and render the mesh normally using this buffer object as a new source of vertex data.
12
O. Ripolles, F. Ramos, and M. Chover Table 1. Models used in the experiments, with their storing cost (in MB.)
Model Vertices Faces Original (triangles) Progressive Meshes LodStrips Sliding-Tris
5
Cow 2904 5804 0.10 0.27 0.17 0.12
Bunny 35947 69451 1.21 3.28 2.21 1.45
Dragon 54296 108588 1.86 5.09 3.32 2.23
Phone 83044 165963 2.84 7.86 5.08 3.45
Isis 187644 375283 6.44 17.23 11.69 7.72
Buddha 543644 1085634 18.65 51.28 35.51 22.56
Results
In this section we will present some tests that cover the storing cost and the rendering performance of the presented versions of Sliding-Tris. The experiments were carried out using Windows XP on a PC with a processor at 2.8 Ghz, 2 GB RAM and an nVidia GeForce 7800 graphics card with 256MB RAM. The different implementations have been done in C++, OpenGL and HLSL. 5.1
Storing Cost
Table 1 shows a comparison of spatial costs among previous continuous uniform resolution models: PM [21], a triangle-based approach, and LodStrips [7], which is based on triangle strips. As it can be observed, the model presented offers the best spatial cost. On average, it fits in 1.2 times the original mesh in triangles, in contrast to PM and LodStrips which fit in 2.7 and 1.9 times respectively. This is due to the fact that the only extra information that we store is the evolution of the vertices. Furthermore, it is important to note that the size of each evolution (en ) element is usually small. Our experiments have shown that the evolution of the vertices of most models have a maximum number of 12 elements and an average of 2, despite being meshes composed of thousands of vertices. 5.2
Rendering Time
We analyzed the frame rate obtained throughout the different levels-of-detail when rendering a bunny model without textures nor illumination. We have also included the results of a version without extraction cost, in order to show which frame-rate could be obtained at most. The results are presented in Fig. 5, where it can be observed that the frame rate of the pixel shader version is always the lowest, as this version obliges the pipeline to stop until the render-to-vertex has been completely performed, thus limiting the performance of both the CPU and the GPU. The best results are offered by the vertex shader implementation. It is important to note that in this test we extracted a new LOD for each frame. Thus, the CPU version and the pixel shader one would be able to achieve the performance of the original model when the LOD remains stable. As commented before, interactive applications tend to change scene conditions permanently, and under these circumstances the vertex shader offers the best performance.
Sliding-Tris: A Sliding Window Level-of-Detail Scheme
13
Fig. 5. Frame rate obtained when rendering the bunny model with the different implementations. The original values refer to the visualization cost only.
6
Conclusions
In this paper we have presented a new multiresolution model which has been completely adapted to the GPU. Sliding-Tris offers a low storing cost, easy implementation and a fast extraction process which make it suitable for any rendering engine. A further advantage is that the extraction process is always similar in cost. The shaders must consider the extraction process for each vertex, and, as a consequence, these algorithms would obtain similar results when the difference between the demanded and the current LOD is big or small, in contrast to hierarchical models. For the CPU model, an important limitation is the data traffic involved in extracting the approximations. Updating vertices instead of indices involves working with three floats per vertex instead of one integer per index. This limitation can be worse if the meshes work with normals, textures, etc. Nevertheless, our experiments have shown that the total number of update operations is similar, and the final rendering speed is not affected by this increase in the quantity of data interchanged. The use of shaders to perform the LOD changes avoids the traffic problem, even though the render-to-vertex approach is still slow and demands CPU intervention. As a consequence, even when the three approaches are quite similar in rendering time, the vertex shader offers a wiser solution as it can be running while the CPU and GPU are performing a different operation. Acknowledgments. This work has been supported by grant P1 1B2007-56 (Bancaixa), the Spanish Ministry of Science and Technology (Contiene Project: TIN2007-68066-C04-02) and FEDER funds.
14
O. Ripolles, F. Ramos, and M. Chover
References 1. Clark, J.: Hierarchical geometric models for visible surface algorithms. CACM 10(19), 547–554 (1976) 2. Garland, M., Heckbert, P.: Simplification using quadric error metrics. Computer and Graphics 31, 209–216 (1997) 3. Ribelles, J., Chover, M., Lopez, A., Huerta, J.: A first step to evaluate and compare multiresolution models. In: EUROGRAPHICS, pp. 230–232 (1999) 4. Sander, P.V., Mitchell, J.L.: Progressive buffers: View-dependent geometry and texture for lod rendering. In: Symp. on Geom. Process, pp. 129–138 (2005) 5. Southern, R., Gain, J.: Creation and control of real-time continuous level of detail on programmable graphics hardware. Comp. Graph. For. 22(1), 35–48 (2003) 6. Boubekeur, T., Schlick, C.: Generic mesh refinement on gpu. In: Graphics Hardware, pp. 99–104 (2005) 7. Ramos, F., Chover, M., Ripolles, O., Granell, C.: Continuous level of detail on graphics hardware. In: Kuba, A., Ny´ ul, L.G., Pal´ agyi, K. (eds.) DGCI 2006. LNCS, vol. 4245, pp. 460–469. Springer, Heidelberg (2006) 8. Ji, J., Wu, E., Li, S., Liu, X.: Dynamic lod on gpu. In: CGI (2005) 9. Turchyn, P.: Memory efficient sliding window progressive meshes. In: WSCG (2007) 10. Cignoni, P., Ganovelli, F., Gobbetti, E., Marton, F., Ponchio, F., Scopigno, R.: Adaptive tetrapuzzles: efficient out-of-core construction and visualization of gigantic multiresolution polygonal models. In: SIGGRAPH, pp. 796–803 (2004) 11. Cignoni, P., Ganovelli, F., Gobbetti, E., Marton, F., Ponchio, F., Scopigno, R.: Batched multi triangulation. In: IEEE Visualization, pp. 207–214 (2005) 12. Yoon, S., Salomon, B., Gayle, R.: Quick-vdr: Interactive view-dependent rendering of massive models. IEEE Transactions on Visualization and Computer Graphics 11(4), 369–382 (2005) 13. Borgeat, L., Godin, G., Blais, F., Massicotte, P., Lahanier, C.: Gold: interactive display of huge colored and textured models. Trans. Graph. 24(3), 869–877 (2005) 14. Niski, K., Purnomo, B., Cohen, J.: Multi-grained level of detail using a hierarchical seamless texture atlas. In: Proceedings of I3D 2007, pp. 153–160 (2007) 15. Cohen, J., Olano, M., Manocha, D.: Appearance-preserving simplification. In: SIGGRAPH 1998, pp. 115–122. ACM Press, New York (1998) 16. Gonzalez, C., Gumbau, J., Chover, M., Castello, P.: Mesh simplification for interactive applications. In: WSCG (2008) 17. Lindstrom, P., Turk, G.: Image-driven simplification. ACM Trans. Graph. 19(3), 204–241 (2000) 18. Luebke, D., Hallen, B.: Perceptually-driven simplification for interactive rendering. In: 12th Eurographics Workshop on Rendering, pp. 223–234 (2001) 19. Castello, P., Chover, M., Sbert, M., Feixas, M.: Applications of information theory to computer graphics (part 7). In: Eurographics Tutorial Notes, Eurographics, vol. 2, pp. 891–902 (2007) 20. Biermann, R., Cornish, D., Craighead, M., Licea-Kane, B., Paul, B.: pixel buffer objects (2004), http://www.nvidia.com/dev content/nvopenglspecs/GL EXT pixel buffer object.txt 21. Hoppe, H.: Progressive meshes. In: SIGGRAPH, pp. 99–108 (1996)
Efficient Interference Calculation by Tight Bounding Volumes Masatake Higashi, Yasuyuki Suzuki, Takeshi Nogawa, Yoichi Sano, and Masakazu Kobayashi Mechanical Systems Engineering Division, Toyota Technological Institute, 2-12-1, Hisakata, Tempaku-ku, Nagoya, 468-8511 Japan
[email protected]
Abstract. We propose a method for efficient calculation of proximity queries for a moving object. The proposed method performs continuous collision detection between two given configurations according to the exact collision checking (ECC) approach which performs distance calculation between two objects. This method obtains efficient results as it employs the concept of clearance bounds and performs approximate distance calculations with a tight fit of bounding volumes. The high efficiency of the method, when applied to robot path planning, is demonstrated through some experiments.
1
Introduction
Interference calculation or collision detection [1] is one of the key technologies employed in computational geometry and related areas such as robotics, computer graphics, virtual environments, and computer-aided design. In geometric calculations, a collision or proximity query reports information about the relative configuration or placement of two objects, and it checks whether two objects overlap in space, or whether their boundaries intersect; furthermore, it computes the minimum Euclidean separation distance between the boundaries of the objects. These queries are necessary in different applications, including robot motion planning, dynamic simulation, haptic rendering, virtual prototyping, interactive walkthroughs, and molecular modeling. Some of the most common algorithms employed for collision detection and separation distance computation use spatial partitioning or bounding volume hierarchies (BVHs). Spatial subdivision is the recursive partitioning of the embedding space, whereas BVHs are based on the recursive partitioning of the primitives of an object. The cost of performing a proximity query, including collision detection and/or distance computation, is often greater than 90% of the planning time involved in robot motion planning [2]. Due to performance related issues, most of the existing planners use discrete proximity query algorithms and perform queries in several fixed sampled configurations in a given interval. This does not assure that they do not miss any thin objects between sampled configurations. Therefore, a method [3] that employs exact collision checking (ECC) and assures no collision has M. Bubak et al. (Eds.): ICCS 2008, Part II, LNCS 5102, pp. 15–24, 2008. c Springer-Verlag Berlin Heidelberg 2008
16
M. Higashi et al.
been proposed recently. Redon et al. [4], [5] have proposed a different approach; this method checks the collisions between the swept volume of a robot and its obstacles, and achieves a runtime performance roughly comparable to that of the ECC method. In this paper, we propose a method that employs the concept of ECC but still obtains efficient results, by adopting the following principles. 1. We do not calculate the exact minimum distance between an object and its obstacles. However, we obtain the approximate minimum distance between an object and its obstacles by using BVHs. 2. We avoid calculations if the distance between BVHs is larger than a clearance bound that assures no collision by the object movement. 3. We calculate BVHs of obstacles by dividing the bounding volumes according to approximate convex decomposition (ACD) algorithm to enhance the tightness of fit and perform the collision tests with a less number of BVHs. The rest of the paper is organized as follows. Section 2 introduces the clearance bound calculation after the explaining for the ECC. Section 3 proposes a method for obtaining tighter fit of BVHs. Section 4 describes the results of the experiments along with the discussion. Section 5 summarizes the research.
2 2.1
Exact Collision Checking and Clearance Bound Calculation Exact Collision Checking
Schwarzer et al. [3] introduced an algorithm that executes ECC by using the distances between an object and its obstacles. The object does not collide with obstacles if (1) holds for two configurations q and q . ρ · d(q, q ) < η(q) + η(q ) .
(1)
Here, d(q, q ) denotes a path length in the configuration space C. ρ is a space conversion factor for conversion from the configuration space to the work space; it is calculated by using the present configuration. Hence, ρ · d(q, q ) denotes the maximum trajectory length of the object in the work space, for the movement from q to q in the configuration space. η(q) denotes the Euclidean distance between the object and its obstacles in configuration q, as shown in Fig. 1. Equation (1) indicates that an object can move freely if the sum of distances from the object to the obstacles is larger than its moving distance. When (1) is not satisfied, we insert a mid point qmid and calculate the distances recursively for qmid ∈ Cfree ; we return ‘collision’ for qmid ∈ Cobstacle . 2.2
Distance Calculation by a Clearance Bound
The cost of performing the proximity query is given in [6]: T = Nbv × Cbv + Np × Cp ,
(2)
Efficient Interference Calculation by Tight Bounding Volumes
qmid ρd(q,q') q η(q)
q' η(q') Obstacle
Fig. 1. Exact collision check using distances
r=σ
r = σ/2 r = σ/4
17
q'
qmid ρ d(q,q') q Obstacle
Fig. 2. Collision check by clearance bound
where T denotes the total cost function for proximity queries; Nbv , the number of bounding volume pair operations; and Cbv , the total cost of a BV pair operation, including the cost of transforming each BV for use in a given configuration of the models and other per BV-operation overhead. Np denotes the number of primitive pairs tested for proximity, and Cp denotes the cost of testing a pair of primitives for proximity (e.g., overlaps or distance computation). The computation cost increases significantly if the objects consist of so many points (triangles). In particular, for the distance calculation, the latter part, Np × Cp , is relatively large, and we must calculate the distance between all the objects searching for pairs of vertices, edges, or planes on them. We do not require a precise distance value, but we must determine whether the object can move from the start configuration to the goal one without colliding with objects. Therefore, Schwarzer et al. introduced greedy distance calculation to compute lower distance bounds in [3]. In addition, we introduce a clearance bound. A clearance bound is a distance which is sufficient for an object to clear obstacles. We verify whether the distance between the object and its obstacles is greater than the clearance bound, instead of obtaining the minimum distance. The calculation is executed by using bounding volumes of the objects. If the distance is larger than the clearance bound in the calculations involved in the trees of the bounding volumes, we can stop the calculation at a higher level of the tree. We need not trace the tree to leaves, but we can discontinue the calculation at the corresponding level. We apply the clearance bound to calculations in ECC. By setting the clearance bound to half the distance in the two configurations: σ = 1/2 · ρ · d(q, q ), we verify whether η(q) > σ at both the ends of the interval and cull the distance calculations for cases in which the object sufficiently clears the obstacles. When the object is near an obstacle, the above condition is not satisfied; hence, mid points are inserted until the distance decreases below a given resolution or the robot is in Cobstacle . In Fig. 2, a clearance bound is applied. When η(q ) < σ at q , a mid point is inserted and η(q ) > σ/2 and η(qmid ) > σ/2 are verified. In this example, the check is completed at the second level of dividing the interval. We can also apply the clearance bounds to distance calculations for determining an adaptive step size of the grid-based approach such as BLS [7]. When a global planner wants to select a step size according to the space in a configuration, it
18
M. Higashi et al.
sets the given step size as a clearance bound. The robot is collision free if it advances within the clearance bound. Thus, both the step-size determination and ECC calculation are executed simultaneously. We employ a collision checker called proximity query package (PQP) [8], which pre-computes a bounding hierarchical representation of each object by using two types of bounding volumes: oriented-bounding boxes (OBBs) [9] and rectangle swept spheres (RSSs). OBBs are efficient for detecting collisions of objects, and RSSs are effective for the distance calculations. We execute clearance bound calculation by using the approximate separation-distance-computation, which is provided by the PQP as a function.
3 3.1
Tighter Fit of Bounding Volume Hierarchies Approximate Convex Decomposition of OBBs
To create a BVH for OBBs or RSSs in PQP, an intermediate OBB is divided into two parts according to the principal directions of covariance matrix (PDC) of the distribution of the input data. However, for obtaining a tighter fit of OBBs, we should divide an intermediate OBB according to the position where it changes direction sharply or at the deepest point of a concavity. Hence, we utilize the approximate convex decomposition (ACD) algorithm [10] for generating an OBB hierarchy. First, we generate a convex hull for the input point data; then, we search the notch point which is not located on the hull and is furthest away from the hull. Finally, we divide the volume into two boxes by the plane passing through the point. The direction of the plane is determined, for example, to equally divide the included angle at the notch vertex. This is repeated until the distance from the point to the hull is below the specified tolerance. We provide an example of collision checking for two types of solids: C-type and S-type. Figure 3 shows the manner in which each type of solid is divided into an OBB hierarchy. The lefthand-side and righthand-side images show the decompositions by PDC and ACD, respectively. The tightness of fitting to OBBs is measured by the volumes of bounding boxes at each level (see Table 1). A lower hierarchy level indicates a larger volume difference. At the second level, decomposition by ACD is tighter by 13% as compared to that by PDC. For comparing the computation time required for the two types of decomposed BVHs, collision check is executed for the movement of the left (green) object, as shown in Fig. 4. The result is shown in Table 2, which also includes the number of collision calculations. The computation time is reduced by approximately 40% because a tighter fit separates objects earlier (at a higher level). 3.2
Decomposition for Open Shells
Obstacles are not necessarily composed of complete solids that have no boundaries, but they are sometimes represented by open shells. For example, a car body consists of sheet metal parts; hence it might be composed of open shells.
Efficient Interference Calculation by Tight Bounding Volumes
19
Table 1. Comparison of volume of BVHs at each hierarchy : PDC : ACD
Object Hierarchy level 0 C-type 1 2 0 S-type 1 2
Volume PDC ACD 35.9 35.9 47.5 47.0 37.8 32.7 40.0 40.0 35.2 35.0 32.2 28.3
Table 2. Comparison of computation time for different BVHs
Fig. 3. OBBs by PDC and ACD
Object S-type number time (ms) C-type number time (ms)
PDC 30 0.58 52 1.24
ACD 28 0.37 46 0.74
Fig. 4. Movement of objects for collision check
For an open shell, we require a different algorithm of decomposition as compared to that required for a solid object. Since an open shell has boundaries, a point on the boundary might be the most concave part, although it is located on the convex hull. Hence, in addition to the convex hull calculation, we must verify the distance between the concave vertex on the boundary and the convex boundary. We create a data structure of a shell model from the input data, which include point data with indices and coordinate values and face data with a sequence of vertices expressed by point indices such as mesh data [11]. The input data are stored in two tables, as shown in Fig. 5, in the form of a data structure. From these tables, we form a table of vertex-cycle, which is a sequence of counterclockwise faces around a centered vertex. The list can be generated according to the following procedure. Algorithm 1: Generation of point-based data structure (Vertex cycle) For each vertex (vi ), 1) Collect faces from Faces Table, which include vi . Select one face, for example fp , and its edge (vj , vi ).
20
M. Higashi et al.
f9
f1
f8
f2
f7 f3
INPUT [Faces Table] [Vertices Table] Number of faces Number of pts 1: (1, 7, 8) 1: x1, y1, z1 2: (8, 7, 6) 2: x2, y2, z2 3: (9, 6, 5) 3: x3, y3, z3 : : Generated Data Structure [Vertex cycle] [Boundary / Branch edge] 1: (f1, f9,-) (1,7,6,5,4,3,2,1) 2: (f9, f8,-) :
8: (f1, f2, f3, f7, f8, f9)
Fig. 5. Point-base data structure
11
12
f9 f1
f11
bridge qn
f8f10
f2 f3
f7
(3, 8) is a branch edge.
Fig. 6. Shell model with branch boundary
pm : concave vertex
Fig. 7. Convex boundary and bridges
2) Search face fq , which has edge (vi , vj ), and store fq in the vertex-cycle list. If there is no face that includes (vi , vj ), insert “-”; this means no face and implies that it is a boundary. Then, search the vertex cycle in reverse. 3) Get edge (vk , vi ) in fq and set it as the next edge for step 2); repeat steps 2) and 3) until the selected face returns to the first face or the boundary again. In step 2, if the number of edges is greater than one, it is a branch edge, where more than two faces meet. We consider a branch edge as a semi-boundary that separates a shell as a boundary edge. We insert “#” and search faces in the reverse direction, similarly to the boundary edge. As a result, we can obtain multiple vertex cycles. From the table of vertex cycles, we deduce the boundaries and branch boundaries of a shell model, according to the following steps. Algorithm 2: Extraction of boundaries 1) Collect vertices from the vertex-cycle table, which include a boundary edge, for example, (fi , fj ,-). Set vertex vi in the boundary list and set fi which is next to the boundary, that is “-”, as a boundary face. 2) Search vertex vj , which has a sequence of (fi ,-) in the vertex cycle, and add it to extend the boundary list.
Efficient Interference Calculation by Tight Bounding Volumes
21
3) Select face fk next to “-” in the vertex cycle of vj . Replace fi with fk and repeat step 2) until we reach the first vertex. 4) Repeat this until there remain no vertices in Step 1. If there are holes, we have multiple boundaries. We can obtain the branch boundaries by using the same algorithm provided above except for the following conditions: in a vertex cycle, there are multiple pairs of same edges and there may exist pairs of a branch edge and boundary edge. Figure 6 shows an example of a boundary edge. Here, an open shell is added to the shape in Fig. 5. Edge (3, 8) is a branch edge. The vertex cycles for vertex 8 are (f 1, f 2, f 3, f 7, #, f 8, f 9) and (#, f 10, f 11, -). Thus we simply express a non-manifold surface model instead of exact representation [12]. Now, we describe a method to divide an OBB to generate a tight fit of BV hierarchy. First, we divide an object into independent shells according to the obtained boundaries and compose a binary tree for the open shells according to the positions of the shell boundaries. Then, we divide each OBB as a shell, as follows. Here, we define a concave vertex locally for every three points along a three dimensional boundary and compose a concave part of pairs of a bridge and concave vertices. A bridge [10] is an edge inserted to connect a concave part and generate a convex boundary. Figure 7 shows an example of a convex boundary and bridges for an open shell. The small circles show concave vertices. The concave vertex that is furthest from the corresponding bridge is the point for division of the shell if the distance is larger than a given tolerance. The shell is divided along the edges that connect the division point and the nearest vertex on the opposite boundary or the inner boundaries of holes. This division is repeated until there are no concave vertices whose distances to the bridge are greater than the tolerance. In Fig. 7, pm is a division point and (pm , qn ) is a dividing edge. When there are no concave parts and there exists a hole, we divide its boundary at the extremum vertices along the principal direction of the hole boundary.
4
Experiments
We implemented our local planner for application to rapidly-exploring random trees (RRT) [13] and bi-directional local search (BLS) [7] algorithms. We used the Motion Strategy Library (MSL) [14] to implement and modify RRT as well as GUI for BLS. We show the effectiveness of our planner, applied to RRT and BLS, by conducting some experiments for an object movement in a 2D maze and 3D environments along with an articulated robot in 3D environments. The planner was implemented in C++ and the experiments were executed on a Windows PC (2.4 GHz Pentium 4 processor with 1.0 GB memory). First, we report the analysis of the effectiveness of our algorithms. Figure 8 shows the start and goal configurations (small red circles) for a moving object in a 2D maze, and Fig. 9 shows those for a 3D cage. We ran RRT 10 times for the 2D maze and 3D cage. Each case involves three types of calculation methods – without ECC, with ECC, and with ECC along with clearance bounds (CB)
22
M. Higashi et al.
(a) Start and goal configurations
(b) Obtained tree and path
Fig. 8. Start and goal configurations for 2D maze
(a) Start configura- (b) Goal configuration tion Fig. 9. Start and goal configurations for cage data
Table 3. Experiment results for Table 4. Experiment result for articulated robot moving object Case A Case B Maze Cage CPU Without ECC 28.94 3.71 ECC 35.90 22.05 Time ECC with CB 27.32 11.85 No. Collision check 7023 26383 of Nodes of tree 2022 470 Nodes in path 247 30
RRT
BLS
RRT BLS
CPU Without ECC 369.74 42.34 55.87 9.66 ECC 523.59 145.32 238.25 21.44 Time ECC with CB 422.60 115.22 69.84 2.87 No. Collision check 16878 90817 of Nodes of tree 5869 4546 Nodes in path 478 2345
7548 1750 2267 467 110 366
– in the distance calculations. Table 3 shows the results of the calculation. The averages of running CPU time are shown for these methods. The number of points for collision check in the configuration space, number of nodes in the tree, and number of nodes used for the path are shown for ECC with CB. The running time for ECC with CB as compared to that for ECC without CB is reduced by 25%, from 35.9 to 27.3, for the 2D maze. For the cage, the running time is significantly reduced, from 22.1 to 11.9 (approximately half). The difference between the running time in the two cases is due to the following reasons. First, the number of generated nodes in the maze is considerably larger than that in the cage; hence, a large amount of time is required for the tree generation, which is shown in Fig. 8 (b). Second, the time required for 2D distance calculation in ECC is considerably smaller than that required for 3D distance calculation. Next, we executed experiments on articulated robots that have many degrees of freedom and require a large number of interference calculations. Figure 10 shows the start and goal configurations of the robot along with the given obstacles. The robot is a 6-axes articulated robot and has a fixed base. The surfaces of the robot are represented by 989 triangles and those of a car are represented by 2,069 triangles. In Case A: figures (a) and (b), the robot goes into a car from the outside. However, the robot turns between two cars in Case B: figures (c) and (d). We ran RRT and BLS 20 times for Case B and 5 times for Case A.
Efficient Interference Calculation by Tight Bounding Volumes
(a) Start-A
(b) Goal-A
(c) Start-B
(d) Goal-B
(a) Output boundaries
(c) Door panel
Fig. 10. Start and goal configurations for articulated robot
23
(b) Extracted shells
(d) Shell decomposition
Fig. 11. Boundaries and extracted shells
Each case involves three types of calculation methods, similar to the previous experiments. Table 4 shows the results of the calculations. The running time of ECC with CB compared to ECC without CB is reduced by 20% for Case A; however, for Case B, the running time is reduced drastically from 238.25 to 69.84 (1/3) for RRT and from 21.44 to 2.87 (1/7) for BLS. This is because the robot cannot be separated easily from the BVH due to its position inside the car. In Case B, the time required for ECC with CB is nearly the same as that required “without ECC” for RRT. Hence, the introduction of CB is proven to be effective. For BLS, the time required by the method without ECC is larger than that required for ECC with CB. This is because in the calculation without ECC, we require distance calculations for determining a step size adaptively; however, in the calculation by ECC with CB, we apply the clearance bound to the adaptive step size along with the calculations for ECC. RRT requires a larger time as compared to BLS, because it generates a tree uniformly for free configurations and requires time to search the nearest node to add it to the tree. On the other hand, BLS attacks a target more directly with less nodes and uses discrete adaptive step sizes. Furthermore, BLS applies a lazy evaluation of ECC. Next, we conducted the decomposition of OBBs by ACD and path calculation for Case A. The reduction of execution time was only 10%, because the object consists of open shells. Hence, we generated a data structure of a shell model and obtained boundaries and shells, as shown in Fig. 11. An example of open-shell decomposition is also shown for a door panel. By using extracted shells, the CPU time decreased to less than one third of the initial value.
5
Summary
We have introduced a method for efficient calculation of proximity queries for a moving object. Our method can be employed for continuous collision detection
24
M. Higashi et al.
between two given configurations according to the ECC approach. It obtains results efficiently by using the concept of a clearance bound and approximate distance calculation with close bounding volumes. To obtain close BVHs, we employed algorithms for the decomposition of OBBs. For a solid object, we decomposed OBBs by using ACD; we generated a data structure for a shell object and detected a dividing point furthest from a bridge in the convex boundary. The high efficiency of the method, when applied to RRT and BLS, is demonstrated by experiments for moving objects and practical articulated robots. Acknowledgments. This study was partly supported by the High-Tech Research Center for Space Robotics from the Ministry of Education, Sports, Culture, Science and Technology, Japan. The implementation of the prototype system was performed in cooperation with IVIS Inc.
References 1. Hadap, S., Eberle, D.: Collision Detection and Proximity Queries. In: SIGGRAPH 2004 Course Notes (2004) 2. Latombe, J.C.: Robot Motion Planning. Kluwer, Boston (1991) 3. Schwarzer, F., Saha, M., Latombe, J.-C.: Exact collision checking of robot paths. In: Boissonnat, J.D., et al. (eds.) Algorithmic Found. Robot V., pp. 25–42 (2004) 4. Redon, S., Kim, Y.J., Lin, M.C., Manocha, D.: Fast Continuous Collision Detection for Articulated Robot. In: Proc. ACM Symp. Solid Modeling and Application, pp. 1316–1321 (2004) 5. Redon, S., Lin, C.: Practical Local Planning in the Contact Space. In: Proc. IEEE Int. Conf. Robot. Autom., pp. 4200–4205 (2005) 6. Lin, M.C., Manocha, D.: Collision and Proximity Queries. In: Handbook of Discrete and Computational Geometry, 2nd edn., ch. 35, pp. 787–807. Chapman & Hall/CRC (2004) 7. Umetani, S., Kurakake, T., Suzuki, Y., Higashi, M.: A Bi-directional Local Search for Robot Motion Planning Problem with Many Degrees of Freedom. In: The 6th Metaheuristics International Conference MIC 2005, pp. 878–883 (2005) 8. Larsen, E., Gottschalk, S., Lin, M., Manocha, D.: Fast Proximity Queries with Swept Sphere Volumes. Technical report TR99-018. Department of Computer Science, University of N. Carolina, Chapel Hill (1999) 9. Gottschalk, S., Lin, M., Monacha, D.: OBB-Tree: A Hierarchical Structure for Rapid Interference Detection. In: Proceedings of ACM SIGGRAPH 1996, pp. 171– 180 (1996) 10. Lien, J.-M.C., Amato, M., Approximate, N.: convex decomposition of polygons. In: Proc. 20th Annual ACM Symp. Comutat. Geom (SoCG), pp. 17–26 (2004) 11. Botsch, M., Pauly, M.: Geometric Modeling Based on Polygonal Meshes. In: SIGGRAPH 2007 Course Notes (2007) 12. Higashi, M., Yatomi, H., Mizutani, Y., Murabata, S.: Unified Geometric Modeling by Non-Manifold Shell Operation. In: Proc. Second Symposium on Solid Modeling and Applications, pp. 75–84. ACM Press, New York (1993) 13. Kuffner, J.J., LaValle, S.M.: RRT-connect: An efficient approach to single-query path planning. In: Proc. IEEE Int. Conf. Robot. Autom., pp. 995–1001 (2000) 14. LaValle, S.M.: Motion Strategy Library, http://msl.cs.uiuc.edu/msl/
Modeling of 3D Scene Based on Series of Photographs Taken with Different Depth-of-Field Marcin Denkowski1 , Michal Chlebiej2 , and Pawel Mikolajczak1 1
2
Faculty of Computer Science, Maria Curie-Sklodowska University, pl. Marii Curie-Sklodowskiej 5, 20-031 Lublin, Poland
[email protected] Faculty of Mathematics and Computer Science, N. Copernicus University, Chopina 12/18, 87-100 Toru´ n, Poland
Abstract. This paper presents a method for fusing multifocus images into enhanced depth-of-field composite image and creating a 3D model of a photographed scene. A set of images of the same scene is taken from a typical digital camera with macro lenses with different depth-of-field. The method employs convolution and morphological filters to designate sharp regions in this set of images and combine them together into an image where all regions are properly focused. The presented method consists of several phases including: image registration, height map creation, image reconstruction and final 3D scene reconstruction. In result a 3D model of the photographed object is created.
1
Introduction
Macro photography is a type of close-up photography with magnification ratios from about 1:1 to about 10:1. The most crucial parameter of macro photography is the depth of field (DOF) [1]. Because it is very difficult to obtain high values of DOF for extreme close-ups it is essential to focus on the most important part of the subject. Any other elements that are even a millimeter farther or closer may appear blurred in the acquired photo. The depth of field can be defined as the distance in front of and behind the subject appearing in focus. Only a very short range of the photographed subject will appear in exact focus. The most important factor that determine whether the subject appears in focus is how a single point is mapped onto the sensor area. If a given point is exactly at the focus distance it will be imaged as one point on the sensor, in the other case it will produce a disk whose border is known as a “circle of confusion”. These circles can be used to define the measure of focus and blurriness as they increase in diameter the further away they are from the focus point. For a specific film format, the depth of field is described as a function parametrized by: the focal length of the lens, the diameter of the lens opening (the aperture), and the distance between the subject and the camera. Let D be the distance at which the camera is focused, F the focal length (in millimeters) calculated for M. Bubak et al. (Eds.): ICCS 2008, Part II, LNCS 5102, pp. 25–34, 2008. c Springer-Verlag Berlin Heidelberg 2008
26
M. Denkowski, M. Chlebiej, and P. Mikolajczak
an aperture number f and k - the “circle of confusion” for a given film format (in millimeters), then depth of field (DOF) [1] can be defined as: DOF1,2 =
D 1±
1000×D×k×f F2
(1)
where DOF1 is distance from the camera to the far depth of field limit, and DOF2 is the distance from the camera to the near depth of field limit. The aperture controls the effective diameter of the lens opening. Reduction of the aperture size increases the depth of field, however, it also reduces the amount of light transmitted. Lenses with a short focal length have a greater depth-offield than long lenses. Greater camera-to-subject distance results in a greater depth-of-field. We used this optical phenomenon to achieve two aims. The first one was to obtain the deepest possible depth-of-field using standard digital camera images and image processing algorithms. And the second goal was to create threedimensional model of photographed scene. As an input we have created a series of macro photograph images of the same subject with different focus lengths. In the first step of our method we have to register them together to create a properly aligned stack of images. The next step is to fuse them into a one composit image. For that purpose we propose enhanced multiscale convolution and morphology method, which we have introduced in [2]. Methods for image fusion using multiscale morphology have been broadly discussed in [3,4,5]. As an effect of fusing algorithm we obtain a height map and the reconstructed focused image with a very deep depth-offield. The height map is a label map which determines the height of each part of the scene. From this map, we can construct a 3D model of the scene. In this work we limit our method to macro photography only and we assume that images were taken perpendicularly or almost perpendicularly to the scene. However, to clearly present advantages and problems of our method, we also show some cases with sets of images acquired in different way.
2
Registration
In the first step a set of photographs of the desire object is acquired. Unfortunately, during extreme close-up sessions small movements of the camera are possible even when using tripods for stabilization. To make the reconstruction method more robust we can make use of an image registration procedure. The main idea behind image registration is to find perfect geometric alignment between a set of overlapping images. The quality of match measure represents the matching function parametrized by the geometric transformation. In our method we use the rigid (translations and rotation) or the affine transformation model (rigid + scaling and shears). In most cases it is sufficient to use the simplified rigid transformation (translations only). But when images are acquired without stabilization devices the use of complete affine transformation is a necessity. In
Modeling of 3D Scene Based on Series of Photographs
27
our approach we use the normalized mutual information [7] as the matching function: h(F I) + h(RI) N M I(F I, RI) = (2) h(F I, RI) where RI represents the reference image and F I represents the floating image. h(F I) = − h(RI) = − h(F I, RI) = −
pF I (x)log(pF I (x))
(3)
pRI (x)log(pRI (x))
(4)
pF I,RI (x, y)log(pF I,RI (x, y))
(5)
where h(F I), h(RI) and h(F I, RI) are the single and joint entropies [2], pF I and pRI are the probabilities of each intensity in the intersection volume of both data sets and pF I,RI is a probability distribution of a joint histogram. For the minimization of the selected similarity measure we use Powell’s algorithm [8]. As a result of the registration procedures we obtain a set of geometrically matched images that can be used in the next stages of our wide depth of field reconstruction algorithm.
3 3.1
Image Fusion Overview
Image fusion is a process of combining a set of images of the same scene into one composite image. The main objective of this technique is to obtain an image that is more suitable for visual perception. This composite image has reduced uncertainty and minimal redundancy while the essential information is maximized. In other words, image fusion integrates redundant and complementary information from multiple images into a composite image but also decreases dimensionality. There are many methods discovered and discussed in literature that focus on image fusion. They vary with the aim of application used, but they can be mainly categorized due to algorithms used into pyramid techniques [10,11], morphological methods [3,4,5], discrete wavelet transform [12,13,14] and neural network fusion [15]. The different classification of image fusion involves pixel, feature and symbolic levels [16]. Pixel-level algorithms are low level methods and work either in the spatial or in transform domain. This kind of algorithms work as a local operation despite of transform used and can generate undesirable artifacts. These methods can be enhanced by using multiresolution analysis [10] or by complex wavelet transform [14]. Feature-based methods use segmentation algorithms to divide images into relevant patterns and then combine them to create output image by using various properties [17]. High-level methods combine image descriptions, typically, in the form of relational graphs [18].
28
3.2
M. Denkowski, M. Chlebiej, and P. Mikolajczak
Methodology
In our work we use multiscale convolution and morphology methods combined with pyramid segmentation algorithm to distinguish homogeneous regions. Our fusion method is also capable to work with color images. Color image fusion has been discussed in [19]. At this stage we assume that images on the image stack are aligned to each other. At this point the main objective is to create focused image and the height map. The whole algorithm, shown in Fig. 1, can be divided into 5 stages: 1. Creation of n-level multiresolution pyramid for every input image. In this case we use median filter to downscale images. 2. Segmentation of every image on the stack by using pyramid segmentation. For this process we convert images into HSL color model [9] to separate luminance (contrast) information contained in luminance channel from color description in hue and saturation channels. Example results of the segmentation process are shown in Fig. 2 as segmentation maps. 3. Calculation of local standard deviation SD at local region R for every pixel f (x, y) at each pyramid level L for every image on the stack (z): 1 (L) (f (x, y) − fR )2 (6) SDR (x, y, z) = NR (x,y)∈R,z
Color RGB components are coverted to its graylevel intensity according to Gf = 0.299R + 0.587G + 0.114B. 4. Reconstruction rules. (0) Step-1. For the lowest level of pyramid, pixels with maximum SDmax (x, y, z) are marked as focus and labeled in the height map HM (x, y) with z value. If (0) (0) abs(SDmax (x, y) − SDmin (x, y)) < Ts , where Ts is a threshold value, pixel is marked as unresolved because it usually belongs to smooth region. These pixels are taken care of at subsequent steps. Step-2. Every pixel is checked with the segmentation map. If it isn’t nearby any edge and its SDR (x, y, z) value drastically differ from SDR (x, y, z) average pixel value for its region R it is marked with SDR (x, y, z) value of the median pixel. It prevents from marking false or noise pixels. (i) Step-3. For every i-th pyramid level, starting from i=1, if SDR (x, y, z) of (i−1) actual pixel is not equal to SDR (x, y, z) from previous pyramid level, then: (a) if the pixel is nearby some edge marked on the segmentation map, pixel (i) (i−1) with max(SDR (x, y, z), SDR (x, y, z)) value is taken and labeled in the height map HM (x, y) with (i) or (i − 1) value, (b) else, the height map HM (x, y) is labeled as: HM (x, y) = HM (i−1) (x, y) +
HM (i) (x, y) − HM (i−1) (x, y) 2
(7)
Modeling of 3D Scene Based on Series of Photographs
29
Fig. 1. Image Fusion scheme using pyramid decomposition and HSL Segmentation
Step-4. Labeling remaining pixels. If unresolved pixel belongs to region with many other unresolved pixels it is marked as a background, else the median value from region is taken. 5. Creation of fusing image. The value of fused image pixel f (x, y) is equal to the pixel f (z) (x, y) from z − th input image on the stack, where z is a value taken from created height map HM (x, y). The main difficulty is to obtain the height map without spikes or noise, generally smooth but with sharp edges. It is not essential from the point of view of the image fusion, but it may be crucial in three-dimensional reconstruction of the scene. Most of such peaks are generated in smooth regions, where noise in defocused region on one image from the stack often gives greater values of SD than in the corresponding region on sharp image. This leads to undesired deformations of reconstructed spatial surface. For that reason, it is necessary to determine a background plane. For now, we assumed that the background plane overlaps with the last image on the stack, but the plane equation may be also given by hand. Fusion process often creates halo effects near the edges of objects. This phenomenon can be observed in Fig. 3. To resolve this problem we use segmentation maps to determine edges. After that we are able to mark pixels near edges properly as shown in Step-2 and Step-3 of Reconstruction rules.
4
3D Scene Creation
Spatial scene is generated on the basis of information contained in the height map, where each pixel value represents z coordinate of appropriate mesh vertex. In 3D reconstruction process we have considered two methods e.i. marching cubes algorithm (MS) [20,21] and simply by changing z coordinate in a 3D regular mesh. Both methods have advantages as well as disadvantages. Marching-cube gives more control over reconstruction process but is also more complicated and sometimes produces too sharp blocky edges, while second method is very simple and fast but always produces regular mesh. Generated mesh is decimated and smoothed. Created surface is textured with a plane mapping by the fused image.
30
M. Denkowski, M. Chlebiej, and P. Mikolajczak
Fig. 2. Segmentation maps created by using pyramid segmentation (right column) for multifocus images (left column)
Fig. 3. Example of halo effect. Part of the original image (a), the segmentation map (b), the height map created without using the segmentation map - visible halo effect (c) and edges in the height map with help of the segmentation map (d).
5
Experimental Results
The proposed method has been implemented on Linux platform in C++ language using SemiVis framework [22] and Kitware VTK library for visualisation purposes. For testing procedure we have prepared eight image stacks from macrophotography. Each stack contains six to twelve images taken with different depth-of-field, and one control image taken with the largest possible depth-of-field that we were able to receive from our testing digital camera with macro lens. In all cases the procedure is performed in the following order. At first, the registration process aligns multifocus images to each other to minimize misregistration. Then all images are segmented and the pyramid is created up to three levels. Finally, the reconstruction process combine image stack into height map and fused image. Reconstruction time strongly depends on the size of the images used in the fusion and the number of images on the stack. The most computationally expensive is the registration procedure, which consumes above fifty percent of the overal reconstruction time. The fusion process takes about 35%, and generation of three dimensional mesh takes remaining 15%. For a typical set of images, containing ten images with resolution 512x512 the whole procedure lasts about 60 seconds.
Modeling of 3D Scene Based on Series of Photographs
31
Fig. 4. Sets of multifocus images (1,2,3abc), reconstructed focus image (1,2,3e), created height map (1,2,3f), control image taken with the largest possible depth-of-field (1,2,3g)
Examples of multifocus images with height map and reconstructed fused images are shown in Fig. 4. Each fused image is compared to its control image. Mutual Information (MI) and Mean Square Difference (MSD) are useful tools in such comparison. Table 1 contains calculated similarity values for every fused image and corresponding reference image. Table 1 also contains widely used metric QAB/F that measures quality of image fusion. This measure was proposed by Xydeas and Petrovi´c in [23]. In this case, a per-pixel measure of information preservation is obtained between each input and the fused image which is aggregated into a single score QAB/F using a simple local importance assignment. This metric is based on the assumption that fusion algorithm that transfers input gradient information into result image more accuretely performs better. QAB/F is in range [0, 1] where 0 means complete loss of information and 1 means perfect fusion. From the height map and fused image we can generate 3D model of the scene. Additionally, the height map is filtered with strong median and gaussian filter
32
M. Denkowski, M. Chlebiej, and P. Mikolajczak
Table 1. Similarity measures between reconstructed image and reference image with large depth-of-field - MI and MSD and the quality measure QAB/F Stack
Similarity measures MI MSD
S-1 S-2 S-3 S-4 S-5 S-6 S-7 S-8
0.82 0.67 0.72 0.88 0.82 0.64 0.69 0.71
28.48 32.11 38.43 26.03 27.74 35.81 34.30 41.65
QAB/F 0.84 0.73 0.79 0.85 0.80 0.72 0.72 0.69
Fig. 5. Result fused images and 3D models
Modeling of 3D Scene Based on Series of Photographs
33
Fig. 6. Typical image that creates failed 3D model. This photograph presents a common child’s spinning top. Reconstruction algorithms failed because of many smooth and uniform regions and a lack of background plane.
to smooth regions and after that the mesh is created. Fig. 5 shows qualitative results of our method for eight tested image sets. The biggest problem in this 3d reconstruction is to obtain a surface which is smooth enough in uniform regions and simultaneously has sharp edges on the objects boundaries. The best results are received when the photographs are taken perpendicularly to the background, objects are within the scene, and they are rough without smooth regions. Fig. 6 shows an example of a typical failure. Our method often fails when there are large smooth regions which don’t belong to the background plane. The main difficulty in such cases is to distinguish between background and an object without any external spatial knowledge of the scene.
6
Conclusions
This paper presented an attempt to the problem of generating of 3d model from a set of multifocus images. We proposed the whole pipeline from raw photographs to the final spatial model. Input multifocus images were registered together and next, using typical image filters and gradient methods the height map was created by detecting focused regions in each of them. Based on the height map the image with a greater depth-of-field was composed. Finally, further algorithms reconstructed the 3d model of the photographed scene. The presented results of generation of 3D models are very promising, but as for now, there are still many problems that need to be solved. Future work could include improvements in segmentation and edge detection to help in automatic detection of the background plane. Second, there should be more complex methods used to identify smooth regions of objects. We think that in both cases pattern recognition algorithms should improve effectiveness of our method. Also Feature-based fusion methods such as [17] could generate more accurate height maps.
References 1. Constant, A.: Close-up Photography. Butterworth-Heinemann (2000) 2. Denkowski, M., Chlebiej, M., Mikolajczak, P.: Depth of field reconstruction method using partially focused image sets. Polish Journal of Environmental Studies 16(4A), 62–65 (2007)
34
M. Denkowski, M. Chlebiej, and P. Mikolajczak
3. Ishita, D., Bhabatosh, C., Buddhajyoti, C.: Enhancing effective depth-of-field by image fusion using mathematical morphology. Image and Vision Computing 24, 1278–1287 (2006) 4. Mukopadhyay, S., Chanda, B.: Fusion of 2d gray scale images using multiscale morphology. Pattern Recognition 34, 1939–1949 (2001) 5. Matsopoulos, G.K., Marshall, S., Brunt, J.N.M.: Multiresolution morphological fusion of mr and ct images of the human brain. IEEE Proceedings Vision, Image and Signal Processing 141(3), 137–142 (1994) 6. Eltoukhy, H., Kavusi, S.: A computationally efficient algorithm for multi-focus image reconstruction. In: Proceedings of SPIE Electronic Imaging (June 2003) 7. Studholme, C., et al.: An overlap invariant entropy measure of 3D medical image alignment. Pattern Recognition 32(1), 71–86 (1999) 8. Press, W.H., Flannery, B.P., Teukolsky, S.A., Vetterling, W.T.: Numerical Recipes in C, 2nd edn. Cambridge University Press, Cambridge (1992) 9. Gonzalez, R.C., Woods, R.E.: Digital image processing. Addison-Wesley Publishing Company, Inc, Reading (1992) 10. Burt, P.J.: The pyramid as a structure for efficient computation. In: Multiresolution Image Processing and Analysis, pp. 6–35. Springer, Berlin (1984) 11. Toet, A.: Image fusion by rati of low-pass pyramid. Pattern Recognition Letters 9(4), 245–253 (1989) 12. Li, H., Manjunath, H., Mitra, S.: Multisensor image fusion using the wavelet transform. Graphical Models and Image Processing 57(3), 235–245 (1995) 13. Chibani, Y., Houacine, A.: Redundant versus orthogonal wavelet decomposition for multisensor image fusion. Pattern Recognition 36, 879–887 (2003) 14. Lewis, L.J., O’Callaghan, R., Nikolov, S.G., Bull, D.R., Canagarajah, N.: Pixeland region-based image fusion with complex wavelets. Information Fusion 8, 119– 130 (2007) 15. Ajjimarangsee, P., Huntsberger, T.L.: Neural network model for fusion of visible and infrared sensor outputs, Sensor Fusion, Spatial Reasoning and Scene Interpretation. In: The International Society for Optical Engineering, SPIE, Bellingham, USA, vol. 1003, pp. 152–160 (1988) 16. Goshtasby, A.A.: Guest editorial: Image fusion: Advances in the state of the art. Information Fusion 8, 114–118 (2007) 17. Piella, G.: A general framework for multiresolution image fusion: from pixels to regions. Information Fusion 4, 259–280 (2003) 18. Wiliams, M.L., Wilson, R.C., Hancock, E.R.: Deterministic search for relational graph matching. Pattern Recognition 32, 1255–1516 (1999) 19. Bogoni, L., Hansen, M.: Pattern-selective color image fusion. Pattern Recognition 34, 1515–1526 (2001) 20. Lorensen, W.E., Cline, H.E.: Marching cubes: A high resolution 3D surface construction algorithm. Computer Graphics 21(4), 163–169 (1987) 21. Durst, M.J.: Additional reference to Marching Cubes. Computer Graphics 22(2), 72–73 (1988) 22. Denkowski, M., Chlebiej, M., Mikolajczak, P.: Development of the cross-platform framework for the medical image processing. Annales UMCS, Sectio AI Informatica III, 159–167 (2005) 23. Xydeas, C., Petrovi´c, V.: Objective image fusion performance measure. Electronics Letters 36(4), 308–309 (2000)
A Simple Method of the TEX Surface Drawing Suitable for Teaching Materials with the Aid of CAS Masataka Kaneko, Hajime Izumi, Kiyoshi Kitahara1, Takayuki Abe, Kenji Fukazawa2 , Masayoshi Sekiguchi, Yuuki Tadokoro, Satoshi Yamashita, and Setsuo Takato3 1
Kisarazu National College of Technology, Japan Kogakuin University, Japan 2 Kure National College of Technology, Japan 3 Toho University, Japan
[email protected]
Abstract. The authors have been developing KETpic as a bundle of macro packages for Computer Algebra Systems (CASs) to draw fine TEX-pictures. Recently we have developed a new method of the surface drawing using KETpic. The equation of envelopes is used to draw ridgelines of surfaces. Also the technique of hidden line elimination is used. By these methods, we can draw 3D-graphics which are so simple that the global (i.e. sketchy) shapes of them are easily understood.
1
Introduction
We have been developing KETpic as a bundle of macro packages for CASs. It has been developed for inserting fine (accurate and expressive) figures into LATEX documents. We can readily produce a graphic output within such CASs and export the resulting figures to LATEX documents as source code rather than a graphical file itself. It is downloadable for free from [5]. Since KETpic has been equipped with various commands or accessories, its 2D-graphics have been actually used in our mathematics classroom. We can also draw space curves easily with KETpic. The 3D-graphics of KETpic are monochrome and are composed of lines. 5 0 5 1.0 0.5 0.0 0.5 1.0 5 0 5
Fig. 1. The graphic of CAS
Fig. 2. The graphic of KETpic
M. Bubak et al. (Eds.): ICCS 2008, Part II, LNCS 5102, pp. 35–45, 2008. c Springer-Verlag Berlin Heidelberg 2008
36
M. Kaneko et al
It takes little cost for us to make copies of the figures drawn with KETpic. Moreover, the quality of the figures is maintained when they are copied. Using these printed materials repeatedly, students can establish the mathematical concepts. Thus, they are suitable for teaching materials in the form of mass printed matter. On the other hand, the 3D-graphics of CASs are colourful and illuminated, so they are suitable for demonstration on displays. However, it takes much cost to maintain the quality of the graphic images of them when they are copied. Therefore, it is difficult for students to use them repeatedly. Currently KETpic is equipped with the ability to eliminate the part of curves hidden by the other ones [1]. We call such a technique “skeleton method”. By using only one command “skeletondata” of KETpic, we can easily give clear perspective to 3D-graphics as shown in Fig. 3. These figures were actually used to explain the definition of double integral and the concept of repeated integral in our mathematics classroom. z
z
y
y
x
x
Fig. 3. Figures drawn with skeleton method
Though the ability of KETpic for drawing space curves is exploited as above, there were some deficits for surface drawing. In this paper, the authors introduce a new capability of KETpic for surface drawing. It meets the potential demands of the mathematics teachers who usually use CAS and TEX , and who 1. want to show students the figures of surfaces with the accurate ridgelines just as we see them. 2. want to draw such figures using the minimal number of lines so as to make them easy to see. In fact, a method to draw accurate ridgelines has been known. In that method, a point on the ridgelines is characterized by the following condition: The normal vector of the surface at that point is orthogonal to the line connecting that point with the view point. Since the equation describing this condition is simple, we can solve it by hand. However, this method is ad hoc in a sense, and it would be complicated in case of
A Simple Method of the TEX Surface Drawing
37
the surface given by parameters other than x, y. The method introduced in this paper is applicable to such general cases. Though the equation of our method is a little complicated and can not be solved by hand, it can be solved within almost the same time as in the above method by using CAS. The authors also introduce the method to eliminate the parts of ridgelines hidden by the parts of the surface on this side of the viewer. In the next Section 2, we introduce mathematical background of our method. In Section 3, we explain the procedure to draw surfaces using our method with an example.
2 2.1
Mathematical Background Setting of the Problem
Suppose z = f (x, y) is a smooth function with two variables defined on a domain D in R2 . When we draw a graph of f on a plane, we actually draw its image under the projection p onto the plane (the field of our view). The projection depends on the viewpoint and the focus point, and generally has a form of nonlinear transformation. The 3D-graphics of CAS are drawn also by using the automatic calculation of this projection p. Therefore, it should be impossible for us to draw a precise figure of the graph of f without using CAS or other graphic softs. In the above setting, the composition p◦f : R2 −→ R2 becomes a smooth map. For exactness, we give coordinate (x, y) to the former R2 (containing domain D) and coordinate (X, Y ) to the latter R2 (containing image (p ◦ f )(D)). For example, we consider the graph of the function: z = 2 − x2 − y 2
(−1 ≤ x ≤ 1, −1 ≤ y ≤ 1) .
It is drawn with CAS, and is inserted into LATEX document by using KETpic. Remark that Fig. 4 is drawn on the XY -plane. z ridgeline
y edge line
x
Fig. 4. Edge lines and ridgelines
38
M. Kaneko et al
As shown in Fig. 4, the boundary of (p ◦ f )(D) in the XY -plane is composed of two kinds of parts. One part is the set of “edge lines”, the part of (p ◦ f )(∂D). The other part is the set of “ridgelines”. Though this surface is obtained by the rotation of a parabola, the ridgeline is not a parabola. As is easily seen, it is nothing but the envelope of the image of some family of curves on the surface. We can draw edge lines easily by using CAS. On the other hand, it is not so easy to draw ridgelines. 2.2
Main Result
In this subsection, we show a method to draw ridgelines by using CAS.
Y p X f
y
x Fig. 5. Setting of the main result
We represent p ◦ f by components as follows: (p ◦ f )(x, y) = (F1 (x, y), F2 (x, y)) . Then our main result is the next Proposition If the point (F1 (x, y), F2 (x, y)) is located on the ridgelines of the graph of f , then the following equality holds at (x, y): ∂F1 ∂F2 ∂F1 ∂F2 − =0. ∂x ∂y ∂y ∂x
A Simple Method of the TEX Surface Drawing
39
Proof Firstly, remark that, to deduce the equation of the envelope, it is sufficient to consider any family of curves on the image of p ◦ f the union of which covers the image of p ◦ f . So that, we can deduce the equation by using both of the following families of curves on the image: X = F1 (α, y) X = F1 (x, β) Y = F2 (x, β) Y = F2 (α, y) Here α and β indicate the parameters of the families.
Fig. 6. Idea of proof
In Fig. 6 the dotted line is a member of α-family, and the dash line is a member of β-family. Remark that these two lines are tangent to each other at one point of the envelope. By the formula for the differentials of the functions with parametric representations, the slopes of the tangent lines to each of the above two families are equal to ∂F2 ∂F1 ∂F2 ∂F1 , ∂x ∂x ∂y ∂y respectively. Clearly, at each point of the envelope, a curve belonging to α-family is tangent to a curve belonging to β-family. Hence, at that point, the equality ∂F2 ∂F1 ∂F2 ∂F1 = ∂x ∂x ∂y ∂y holds. This implies the claim of our proposition. 2.3
(Q.E.D.)
The Meaning of the Main Result
As is easily seen, the quantity ∂F1 ∂F2 ∂F1 ∂F2 − ∂x ∂y ∂y ∂x is nothing but the Jacobian of the map p ◦ f : R2 −→ R2 . Therefore, our proposition means that the envelope is given as the singular value set of the map p ◦ f . In singular point theory, it is well known that the singular point set is given as the set of points where the Jacobian of the map vanishes. In our situation,
40
M. Kaneko et al
the envelope corresponds to the singular value set of p (defined on the image of f ). Since f is a diffeomorphism onto its image, the critical value set of p ◦ f is the same as that of p (by the chain rule of Jacobian). From the viewpoint of singular point theory, it seems to be meaningless to consider p ◦ f instead of p. Actually there is almost no opportunity of using p ◦ f because it is very difficult to give the explicit representation of it by hand. However, p ◦ f becomes very important when we draw figures by using CAS. This is because CAS can calculate p ◦ f and its differential. Furthermore, CAS can automatically solve the equation in the proposition. Based on our main result, we can draw simple figures of surfaces with the minimal number of lines. The simpleness of the figures has not only aesthetic value but also mathematical meaning. In fact, it is an important idea of Morse theory [2] that the topological information of a manifold is contained in the structure of some critical submanifolds for a Morse function defined on the manifold.
3
The Procedure to Draw Surfaces by Using KETpic
In this section, we explain how to draw surfaces by using the method given in the previous section. Here we draw the graph of the following function as an example: 2 2 f (x, y) = 3 1 − (2x2 + y 2 )e−(x +y ) . 3.1
Calculate the Critical Point Set
Firstly, we calculate the critical point set of p◦f which is a set of connected curves in the xy-plane. By fixing the focus point and the view point, the command such as “implicitplot” of CAS enables us to find the points which satisfy the equation in the previous section. Connecting the neighbouring points by segments, we can obtain the picture like Fig. 7. Remark that the number of connected components depends on the choice of the focus point and the view point. y
O
Fig. 7. Critical point set
x
A Simple Method of the TEX Surface Drawing
3.2
41
Calculate the Critical Value Set
Secondly, we draw the graph of f restricted to the above critical point set. It is drawn in the XY -plane as in Fig. 8. The ridgelines which we want to draw are composed of some parts of this critical value set.
Y
O
X
Fig. 8. Critical value set
There are some cusps in the critical value set. In Fig. 9, these points are specified clearly by using bold points. Topologically, the graph of f is composed of three disks centered at extremal points of f . The cusps correspond to the points where the line segments bounding three disks are attached together. We judge, by rather unrefined method, whether a point in the critical value set is a cusp or not. The judgement is accomplished by calculating the angle between the two vectors from that point to the neighbouring points.
Fig. 9. Cusps
Though there are some parts in the critical value set which are invisible from the view point as shown in Fig. 11, they become visible when other parts on this side are eliminated.
42
3.3
M. Kaneko et al
Add Edges of the Graph and Eliminate Hidden Parts
Thirdly, we add the edge lines of the graph to the critical value set. Then we obtain Fig. 10.
Fig. 10. Add edge lines
In these curves, there are some parts which are drawn in this picture but actually can not be seen from the viewpoint. So we must eliminate such hidden parts to draw the picture we want (as in Fig. 11). As seen in Fig. 10, ridgelines and edge lines are separated to some parts by their own intersections or cusps. Remark that whether a point in these curves is visible or not is determined by the separated part to which the point belongs. We judge whether a part is visible or not by following the next procedure: 1. Pick up an arbitrary point (x0 , y0 , f (x0 , y0 )) from that part. 2. Take some points on the line connecting (x0 , y0 , f (x0 , y0 )) with the view point by the method of bisection, and find the signature of {z − f (x, y)} for each of these points. 3. If the signatures in the second step are constant, then the part containing (x0 , y0 , f (x0 , y0 )) is visible. Otherwise, the part is invisible. Thus, through this process of “hidden line elimination”, we obtain the next Fig. 11 which we aimed at.
Fig. 11. Eliminate hidden lines
Even though this figure is precise with the aid of CAS, there remains only minimal information about the shape of the graph of f . This is because the
A Simple Method of the TEX Surface Drawing
43
minimal number of lines are used. Therefore, this figure enables us to grasp the global shape easily. 3.4
Draw Wire Frames
When we attach importance to the preciseness of the figure, we can also use wire frames widely used in 3D-graphics of CAS. Our graphics are more beautiful than those of CAS because the number of wires is small and because wires are smooth curves. In the next Fig. 12, five wires are drawn in both x and y directions. Remark that the technique of hidden line elimination can be also applied to wires.
Fig. 12. Add wire frames
Compared with Fig. 11, Fig. 12 contains additional information about the local shape of the graph. In fact, the shape of the wire frames indicates the slope and curvature of the graph. In case of 3D-graphics of CAS, colours and half tone shadings indicate the local shape. Since it takes much cost for us to use colours and half tone shadings in teaching materials in the form of mass printings, the surface drawing of KETpic is more suitable for such practical use.
Fig. 13. Finished figure
44
M. Kaneko et al
Oppositely, the existence of the wire frames makes it a little harder for us to grasp the global shape. This is because we must pick up the curves which are also contained in Fig. 11 from those in Fig. 12 to grasp the sketchy shape. To make up this deficit, in Fig. 13, we draw clear distinction between the curves contained in Fig. 11 and wire frames by utilizing the ability of KETpic to draw thick and thin lines. This distinction makes this figure more easy to be understood. Thus, KETpic can offer 3D-graphics which are not only accurate (i.e. differential geometric) but also easy to understand (i.e. topological).
4
Conclusion and Future Works
The ability of surface drawing with minimal number of essential curves has great meaning. This is because we can easily understand the topological structure. As illustrated in the figures of this paper, we can draw accurate and simple 3Dgraphics in TEX documents with KETpic. Moreover, KETpic enables us to hand the printed materials with those figures to students.
Fig. 14. The case of polar coordinate
The method which we have introduced in this paper can be applied to the case where the surface is given by parameters other than x, y as follows: x = x(u, v),
y = y(u, v),
z = z(u, v) .
Here we assume that the differential of the map (u, v) → (x, y, z) is injective. The authors think that our method will be applicable also to the case of several surfaces. In the near future, we should develop a new KETpic functionality as above.
References 1. Kaneko, M., Abe, T., Sekiguchi, M., Tadokoro, Y., Fukazawa, K., Yamashita, S., Takato, S.: CAS-aided Visualization in LATEX documents for Mathematical Education. Teaching Mathematics and Computer Science (to appear) 2. Milnor, J.: Morse theory. Princeton Univ. Press, New Jersey (1963)
A Simple Method of the TEX Surface Drawing
45
3. Sekiguchi, M., Yamashita, S., Takato, S.: Development of a Maple Macro Package Suitable for Drawing Fine TEX-Pictures. In: Iglesias, A., Takayama, N. (eds.) ICMS 2006. LNCS, vol. 4151, pp. 24–34. Springer, Heidelberg (2006) 4. Sekiguchi, M., Kaneko, M., Tadokoro, Y., Yamashita, S., Takato, S.: A New Application of CAS to LATEX-Plottings. In: Shi, Y., van Albada, G.D., Dongarra, J., Sloot, P.M.A. (eds.) ICCS 2007. LNCS, vol. 4488, pp. 178–185. Springer, Heidelberg (2007) 5. Sekiguchi, M., http://www.kisarazu.ac.jp/∼ masa/math/
Family of Energy Conserving Glossy Reflection Models Michal Radziszewski and Witold Alda AGH University of Science and Technology, al. Mickiewicza 30, 30-059 Krakow, Poland
[email protected],
[email protected]
Abstract. We present an improved reflection model optimized for global illumination. The model produces visually plausible images, is symmetric and has improved energy preserving capabilities compared to previous approaches which satisfies these requirements. Having an efficient sampling routine, the model is ready to use in Monte Carlo rendering. Presented model is phenomenological, i.e. it has intuitive glossiness parameter that affects its appearance. Moreover it can be used as a set of basis functions designed to fit material reflection to measured data. Keywords: Reflection Functions, BRDF, Global Illumination, Ray Tracing.
1
Introduction
Modeling reflection properties of surfaces is very important for rendering. Traditionally, in global illumination fraction of light which is reflected from a surface is described by a BRDF (Bidirectional Reflection Distribution Function) abstraction. This function is defined over all scene surface points, as well as two light directions – incident and outgoing. As the name suggests, to conform the laws of physics, all BRDFs must be symmetric, i.e. swapping incident and outgoing directions must not change BRDF value. Moreover, the function must be energy preserving – it cannot reflect more light than it receives. To achieve best results of rendering with global illumination, energy preservation of BRDF should satisfy more strict requirements. It is desirable that basic BRDF model reflects exactly all the light that arrives on a surface. The actual value of reflection is then modeled by a texture. If BRDF is unable to reflect all incident light, even white texture appears to absorb some part of it. In local illumination algorithms this can be corrected a bit by making reflection value more than unit, but in global illumination such trick can have fatal consequences due to multiple light scattering. Our model is strictly energy preserving, while it still maintains other desirable properties. This paper concentrates on phenomenological glossy BRDFs only. It does not account for wave model of light scattering, neither it touches the concept of BSSRDF. The latter is defined on two directions and two surface points instead of one, which is used to simulate subsurface scattering, during which light is reflected from surface at a point slightly different than is illuminated. M. Bubak et al. (Eds.): ICCS 2008, Part II, LNCS 5102, pp. 46–55, 2008. c Springer-Verlag Berlin Heidelberg 2008
Family of Energy Conserving Glossy Reflection Models
47
Paper organization. In the subsequent section there is a brief description of former research related to the BRDF concept. Next, requirements, which should be satisfied by a plausible reflection model are presented. Then there is explained the derivation of our reflection function, followed by comparison of our results with previous ones. Finally, we present a summary, which describes what was achieved during our research and what is left for future development.
2
Related Work
The first well known attempt to create glossy reflection is Phong model [1]. This model is, however, neither symmetric nor energy conserving. An improved version of it was created by Neumann et al. [2,3]. Lafortune et al. [4] used combination of generalized Phong reflection functions to adjust scattering model to measured data. There are popular reflection models based on microfacets. Blinn [5] and Cook et al. [6] assumed that scattering from each individual microfacet is specular, while Oren and Nayar [7] used diffuse reflection instead. A lot of work was dedicated to anisotropic scattering models. The first well known approach is Kajiya’s one [8], which uses physical model of surface reflection. Ward [9] presented a new technique of modeling anisotropic reflection, together with method to measure real-world material reflectances. The Walter’s technical report [10] describes how to efficiently implement Ward’s model in Monte Carlo renderer. Ashikhmin and Shirley [11] showed how to modify Phong reflection model to support anisotropy. Some approaches are based on physical laws. He et al. [12] developed a model that supports well many different types of surface reflections. Stam [13] used wave optics to accurately model diffraction of light. Westin et al. [14] used a different approach to obtain this goal. They employed Monte Carlo simulation of scattering of light from surface microgeometry to obtain coefficients to be fitted into their BRDF representation. On the other hand, Schlick’s model [15], is purely phenomenological. It accounts for diffuse and glossy reflection, in isotropic and anisotropic versions through a small set of intuitive parameters. Pellacini et al. [16] used a physically based model of reflection and modified its parameters in a way which makes them perceptually meaningful. A novel approach of Edwards et al. [17] is designed to preserve all energy while scattering, however at the cost of non-symmetric scattering function. Different approach was taken by Neumann et al. [18]. They modified Phong model to increase its reflectivity at grazing angles as much as possible while still satisfying energy conservation and symmetry as well. Some general knowledge on light reflection models can be found in Lawrence’s thesis [19]. More information on this topic is in Siggraph Course [20] and in Westin’s et al. technical report [21]. Westin et al. [22] also provided a detailed comparison of differen BRDF models. Stark et al. [23] shown that many BRDFs can be expressed in more convenient, less than 4D space (two directional vectors).
48
M. Radziszewski and W. Alda
Shirley et al. [24] described some general issues which are encountered when reflection models are created.
3
Properties of Reflection Functions
In order to create visually plausible images, all reflection functions should satisfy some well defined basic requirements. Energy conservation. In global illumination it is not enough to ensure that no surface scatters more light that it receives. It is desirable to have a function which scatters exactly all light. We are aware of only Edwards’s et al. work [17], which satisfies this requirement, but at the high price of lack of symmetry. Neumann et al. [18] improved reflectivity of Phong model, but the energy preservation still is not ideal. Symmetry. The symmetry of BRDF is very important when bidirectional methods (which trace rays from viewer and from light as well) are used. When a BRDF is not symmetrical, apropriate corrections similar to described in [25] must be made, in order to get proper rendering results. Everywhere positive. If a reflection function happens to be equal to zero on part of its domain, the respective surface may potentially render to black, no matter how strong the illumination is. Having a ’blackbody’ on the scene is a severe artifact, which is typically mitigated by a complex BRDF with an additional additive diffuse component. However, this option produces dull matte color and is not visually plausible. Everywhere smooth. Human eye happens to be particularly sensitive on detecting discontinuities of first derivative of illumination, especially on smooth, curved surfaces. This artifact occurs in any BRDF which uses functions such as min or max. Particularly, many microfacet based models use so-called geometric attenuation factor with min function, and look unpleasant at low glossiness values. Limit #1 – diffuse. It is very helpful in modeling if glossy BRDF can be made ’just a bit’ more glossy than a matte surface. That is, good quality reflection model should be arbitrarily close to matte reflection when glossines is near to zero. Surprisingly, few of BRDF models satisfy this useful and easy to achieve property. Limit #2 – specular. Similarly, it is convenient if glossy BRDF becomes near to ideal specular reflection when glossines approaches infinity. Unfortunately, this property is partially much more difficult to achieve than Limit #1. First, all glossy BRDFs are able to scatter light in near ideal reflection direction, which is correct. Second, energy preservation typically is not satisfied. Ease of sampling. Having a probability distribution proportional (or almost proportional) to BRDF value, which can be integrated and then inverted analytically, allows efficient BRDF sampling in Monte Carlo rendering. This feature is roughly satisfied in majority of popular BRDF models. Our work is an attempt to create a BRDF which satisfies all these conditions together.
Family of Energy Conserving Glossy Reflection Models
4
49
Derivation of Reflection Function
In this section a detailed derivation of the new reflection model is presented. Since this model is purely phenomenological, all mathematical functions chosen to use in it are selected just because of desirable properites they have. This particular choice has no physical basis, and of course, is not unique. Through the rest of this section the notation presented in Table 1 is used. By convention,
Table 1. Notation used in BRDF derivation Symbol fr R ωi ωo ωr N u, v θi θr φi φr Ω
Meaning Reflection function (BRDF) Reflectivity of BRDF Direction of incident light Direction of outgoing light Ideal reflection direction of outgoing light Surface normal Arbitrary orthogonal tangent directions Angle between ωi and N Angle between ωr and N Angle between ωi and u Angle between ωr and u Hemisphere above surface, BRDF domain
all direction vectors are in Ω, i.e. cosine of angle between any of them and N is non-negative. Moreover, these vectors are of unit length. 4.1
Symmetry and Energy Conservation
Symmetry requires that incident and outgoing direction can be swapped without modification of BRDF value: ∀ωi , ωo ∈ Ω
fr (ωi , ωo ) = fr (ωo , ωi ).
(1)
Energy conservation requires that reflectivity of the BRDF must not be greater than one, and is desirable to be equal to one: fr (ωi , ωo ) cos(θi )dωi ≤ 1. (2) R(ωo ) = Ω
The reflectivity can be expressed in a different domain. The following expression is used through the rest of this section: π
2π2 R(θo , φo ) =
fr (θi , φi , θo , φo ) cos(θi ) sin(θi )dθi dφi . 0 0
(3)
50
M. Radziszewski and W. Alda
It is very useful if reflection function fr can be separated into a product: fr (θi , φi , θo , φo ) = fθ (θi , θo )fφ (θi , φi , θo , φo ),
(4)
where fθ is latitudal reflection and fφ is longitudal reflection. If fφ integrates to unit regardless of θi and θo this separation significantly simplifies reflectivity evaluation, which now can be re-expressed as: ⎞ π ⎛ 2 2π R(θo , φo ) = ⎝ fφ (θi , φi , θo , φo )dφi ⎠ fθ (θi , θo ) cos(θi ) sin(θi )dθi , (5) 0
0
and energy conservation as: π
2π
2 fφ (θi , φi , θo , φo )dφi ≤ 1
fθ (θi , θo ) cos(θi ) sin(θi )dθi ≤ 1. (6)
and
0
0
Due to this feature, latitudal and longitudal reflection functions can be treated separately. 4.2
Latitudal Reflection Function
The domain of latitudal function is very inconvenient due to the sine and cosine factors in the integrand: π
2 Rθ (θo ) =
fθ (θi , θo ) cos(θi ) sin(θi )dθi .
(7)
0
However, substituting x = cos2 (θi ), y = cos2 (θo ) and dx = −2 sin(θi ) cos(θi )dθi leads to much simpler expression for reflectivity: 1 Ry (y) = 0.5
fθ (x, y)dx.
(8)
0
Despite being much simpler, this space is still not well suited for developing reflection function, mainly because of necessity of symbolic integration. Using the final transformation it may be obtained: yx Fθ (x, y) =
fθ (s, t)dsdt
and
fθ (x, y) =
∂ 2 Fθ (x, y) . ∂x∂y
(9)
0 0
Designing a function Fθ is much easier than fθ . The requirements that Fθ must satisfy are the following: ∀x,y ∀x ∀x1 ≤x2
Fθ (x, y) = Fθ (y, x)
(10)
Fθ (x, 1) = x
(11)
Fθ (x1 , y) ≤ Fθ (x2 , y)
(12)
Family of Energy Conserving Glossy Reflection Models
51
The requirement (11) can be released a bit. If it is not satisfied, it is enough if Fθ (1, 1) = 1 and Fθ (0, 1) = 0 are satisfied instead. In the latter case, applying: x = F −1 (x, 1)
and y = F −1 (1, y)
(13)
guarantees that Fθ (x , y ) satisfies original requirements (10-12). A matte BRDF in this space is expressed as Fθ = xy. We have found that the following (unnormalized) function is a plausible initial choice for latitudal glossy reflection: (14) fθ (x, y) = sech2 n(x − y) . Transforming this equation into Fθ space leads to: ln cosh(nx) + ln cosh(ny) − ln cosh n(x − y) . Fθ (x, y) = 2 ln cosh n
(15)
This function satisfies only the released requirements, so it is necessary to substitute:
1 − e−2 ln(cosh n)x 1 x = artanh (16) n tanh n for x, and analogical expression for y. After substitution and transformation to the fθ space it may be obtained: m tanh2 n · e−m(x+y) fθ (x, y) = 2 , tanh2 n − (1 − e−mx ) (1 − e−my )
(17)
where m = 2 ln cosh n. Finally, it should be substituted x = cos2 (θi ) and y = cos2 (θr ). Considering how complex the final expression is, it is clear why it is difficult to guess the form of plausible reflection function, and how useful these auxiliary spaces are. 4.3
Longitudal Reflection Function
The longitudal reflection function should be a function of cos(φi − φr ). It has to integrate to unit over [−π, π], so it is reasonable to choose a function that can be integrated analytically: fφ (φi , φr ) = Cn
1
6,
[n(1 − cos(φi − φr )) + 1]
and Cn =
(2n + 1)5.5 , 2πP5 (n)
(18)
where P5 (n) = 7.875n5 + 21.875n4 + 25n3 + 15n2 + 5n + 1. When n = 0, the function becomes constant. When n increases, the function is largest when φi = φr . In the limit, when n approaches infinity, the function converges to δ(φi − φr ). There is still one issue – whenever either ωi or ωr is almost parallel to N , φi or φr is poorly defined. In fact, in these cases, the function should progressively become constant. The simple substitution n = n sin θi sin θr works fine.
52
4.4
M. Radziszewski and W. Alda
Reflection Model
Combining latitudal and longitudal scattering functions leads to the final BRDF: fr (θi , φi , θo , φo ) =
(2nφ sin θi sin θr + 1)5.5 6
2πP5 (nφ ) (nφ sin θi sin θr (1 − cos(φi − φr )) + 1)
·
mθ tanh2 nθ · e−mθ (cos θi +cos θr ) · 2 . (19) tanh2 nθ − 1 − e−mθ cos2 θi 1 − e−mθ cos2 θr 2
2
The parameters nθ and nφ do not have to satisfy nθ = nφ = n. Using various functions of the form nθ = f1 (n) and nφ = f2 (n) leads to a variety of different glossy scattering models. The reflection angles (θr and φr ) may be computed from outgoing angles θo and φo in a few ways, e.g. with ideal reflection, ideal refraction or backward scattering, leading to variety of useful BRDFs. The reflection model is strictly energy preserving, so cosine weighted BRDF forms probability density functions (pdf ) to sample θi and φi from. Obviously, both pdf s are integrable analytically, which is very helpful.
5
Results
The following results are generated using a white sphere and a complex dragon model illuminated by a point light source.√ The proportions of latitudal and longitudal gloss are nθ = n and nφ = 0.75n n sin θi sin θr . Fig. 1 examines how selected scattering models cope with little glossiness. Phong-based models expose
Fig. 1. Comparison of different glossy BRDFs with gloss ’just a bit’ more than matte. From left: diffuse reference, reciprocal Phong, max-Phong, microfacet.
Fig. 2. Latitudal scattering only. From left: glossiness ’just a bit’ more than matte, medium glossiness, large glossines, similarity between θi and θr .
Family of Energy Conserving Glossy Reflection Models
53
Fig. 3. Longitudal scattering only with varying glossiness
Fig. 4. Product of latitudal and longitudal scattering with increasing glossiness
Fig. 5. Scattering with perpendicular (left) and grazing (right) illumination
Fig. 6. Complex dragon model rendered with glossiness n = 2 (left) and n = 4 (right)
54
M. Radziszewski and W. Alda
a zero reflectivity in certain directions, while max-Phong and microfacet models have shading discontinuities. Neither of these models is fully energy conserving. Fig. 2 shows latitudal component of our reflection model. The scattering is increased at grazing angles to achieve energy conservation. Similarly, Fig. 3 presents longitudal scattering only. In Figs. 4, 5 and 6 our BRDF model, defined as a product of latitudal and longitudal scattering is presented. The Fig. 4 shows how the BRDF behaves when glossiness is increased, while the Fig. 5 changes illumination angle using the same glossines. The BRDF exhibits some anisotropy at nonperpendicular illumination, not significant in complex models (Fig. 6).
6
Conclusions
We have presented a novel approach to create BRDFs, for which we have designed an energy preserving and symmetrical reflection function. Energy conservation allows improved rendering results. For example, when a model rendered with our function is placed into an environment with uniform illumination, it vanishes. On the other hand, majority of other models lose some energy, especially at grazing angles. For example, Phong reflection tend to absorb much light, producing dark borders around objects, impossible to control. Microfacet model, which conserves energy far better than Phong model, still is not perfect. In general, properties of our reflection model are different from typically used Phong or microfacet models. It conserves energy and for low glossiness values our model produces neither visual defects like illumination discontinuities, caused by microfacet model, nor black patches, caused by Phong model. Moreover, it smoothly becomes matte, when glossiness approaches zero. On the other hand, our model produces anisotropy when grazing illumination is encountered, i.e. when viewer direction is rotated around ideal reflection direction, reflection value changes in a way difficult to predict. Phong model does not produce such anisotropy at all, and in microfacet model it is less distracting. Nevertheless, when geometry of illuminated figure is complex, the anisotropy is no more visible, and at grazing angles microfacet model loses numerical stability, especially when ωi ≈ −ωr . Moreover, simple implementation of latitudal reflection formula causes numerical instabilities when high glossiness is used, i.e. when n 25. Currently, our reflection model is best suited for complex geometrical shapes and not extremely high glossiness. In these conditions it produces better results than simple formulae of Phong or microfacet models. Minimizing the impact of anisotropy and numerical instability at high glossiness requires further research in this area. AGH Grant no. 11.11.120.777 is acknowledged.
References 1. Phong, B.T.: Illumination for computer generated pictures. Communications of the ACM 18(6), 311–317 (1975) 2. Neumann, L., Neumann, A., Szirmay-Kalos, L.: Compact metallic reflectance models. Computer Graphics Forum 18(3), 161–172 (1999)
Family of Energy Conserving Glossy Reflection Models
55
3. Neumann, L., Neumann, A., Szirmay-Kalos, L.: Reflectance models with fast importance sampling. Computer Graphics Forum 18(4), 249–265 (1999) 4. Lafortune, E.P., Foo, S.C., Torrance, K.E., Greenberg, D.P.: Non-linear approximation of reflectance functions. In: SIGGRAPH 1997 Proceedings, pp. 117–126 (1997) 5. Blinn, J.F.: Models of light reflection for computer synthesized pictures. In: SIGGRAPH 1977 Proceedings, pp. 192–198. ACM, New York (1977) 6. Cook, R.L., Torrance, K.E.: A reflectance model for computer graphics. ACM Transactions on Graphics 1(1), 7–24 (1982) 7. Oren, M., Nayar, S.K.: Generalization of lambert’s reflectance model. In: SIGGRAPH 1994 Proceedings, pp. 239–246. ACM, New York (1994) 8. Kajiya, J.T.: Anisotropic reflection models. In: SIGGRAPH 1985 Proceedings, pp. 15–21. ACM, New York (1985) 9. Ward, G.J.: Measuring and modeling anisotropic reflection. In: SIGGRAPH 1992 Proceedings, pp. 265–272. ACM, New York (1992) 10. Walter, B.: Notes on the ward brdf. Technical Report PCG-05-06, Cornell University (April 2005) 11. Ashikhmin, M., Shirley, P.: An anisotropic phong brdf model. Journal of Graphics Tools 5(2), 25–32 (2000) 12. He, X.D., Torrance, K.E., Sillion, F.X., Greenberg, D.P.: A comprehensive physical model for light reflection. In: SIGGRAPH 1991 Proceedings, pp. 175–186 (1991) 13. Stam, J.: Diffraction shaders. In: SIGGRAPH 1999 Proceedings, pp. 101–110. ACM Press/Addison-Wesley Publishing Co, New York (1999) 14. Westin, S.H., Arvo, J.R., Torrance, K.E.: Predicting reflectance functions from complex surfaces. In: SIGGRAPH 1992 Proceedings, pp. 255–264 (1992) 15. Schlick, C.: A customizable reflectance model for everyday rendering. In: Fourth Eurographics Workshop on Rendering. Number Series EG 93 RW, pp. 73–84 (1993) 16. Pellacini, F., Ferwerda, J.A., Greenberg, D.P.: Toward a psychophysically-based light reflection model for image synthesis. In: SIGGRAPH 2000 Proceedings, pp. 55–64. ACM Press/Addison-Wesley Publishing Co, New York (2000) 17. Edwards, D., Boulos, S., Johnson, J., Shirley, P., Ashikhmin, M., Stark, M., Wyman, C.: The halfway vector disk for brdf modeling. ACM Transactions on Graphics 25(1), 1–18 (2006) 18. Neumann, L., Neumann, A., Szirmay-Kalos, L.: Reflectance models by pumping up the albedo function. Machine Graphics and Vision (1999) 19. Lawrence, J.: Acquisition and Representation of Material Appearance for Editing and Rendering. PhD thesis, Princeton University, Princeton, NJ, USA (2006) 20. Ashikhmin, M., Shirley, P., Marschner, S., Stam, J.: State of the art in modeling and measuring of surface reflection. In: SIGGRAPH 2001 Course #10 (2001) 21. Westin, S.H., Li, H., Torrance, K.E.: A field guide to brdf models. Technical Report PCG-04-01, Cornell University (January 2004) 22. Westin, S.H., Li, H., Torrance, K.E.: A comparison of four brdf models. Technical Report PCG-04-02, Cornell University (April 2004) 23. Stark, M.M., Arvo, J., Smits, B.: Barycentric parameterizations for isotropic brdfs. IEEE Transactions on Visualization and Computer Graphics 11(2), 126–138 (2005) 24. Shirley, P., Smits, B., Hu, H., Lafortune, E.: A practitioners’ assessment of light reflection models. In: Pacific Graphics 1997 Proceedings, pp. 40–50 (1997) 25. Veach, E.: Non-symmetric scattering in light transport algorithms. In: Proceedings of the Eurographics Workshop on Rendering Techniques 1996, pp. 81–90 (1996)
Harmonic Variation of Edge Size in Meshing CAD Geometries from IGES Format Maharavo Randrianarivony Institute of Computer Science Christian-Albrecht University of Kiel, 24098 Kiel, Germany
[email protected]
Abstract. We shall describe a mesh generation technique on a closed CAD surface composed of a few parametric surfaces. The edge size function is a fundamental entity in order to be able to apply the process of generalized Delaunay triangulation with respect to the first fundamental form. Unfortunately, the edge size function is not known a-priori in general. We describe an approach which invokes the Laplace-Beltrami operator to determine it. We will discuss theoretically the functionality of our methods. Our approach is illustrated by numerical results from the harmonicity of triangulations of some CAD objects. The IGES format is used in order to acquire the initial geometries. Keywords: Geometric modeling, IGES, mesh generation, CAD models, edge size, Delaunay.
1
Introduction
The importance of meshes in computer graphics and geometric modeling has become evident in the past decades [1],[6],[8]. In this paper, we address the problem of creating a mesh [7] on a surface Γ of a CAD model. We report on the results of our intensive implementation using IGES (Initial Graphics Exchange Specification) format as CAD exchange. Our main goal focus on the fact that we want the variation of lengths of the neighboring edges to be smooth. That will result in meshes composed of nicely shaped triangles. The generation of a surface mesh by means of the generalized Delaunay technique [4],[6] with respect to the first fundamental form [2] requires the knowledge of the edge size function which is unfortunately unknown a-priori [10]. In [1], the authors triangulate planar domains using the Delaunay technique. A method for evaluating the quality of a mesh is given in [6]. Some upper bound of the Delaunay triangulation has been investigated in [4]. In this document, our main contribution is the determination of the edge size function for the Delaunay triangulation with respect to the first fundamental form. Additionally, we examine theoretically the functionality of our method. Furthermore, our description is supported by numerical results produced from real IGES data where we investigate mesh harmonicity. In the next section, we will state our problem more specifically and we will introduce various important definitions. After quickly giving a motivation for M. Bubak et al. (Eds.): ICCS 2008, Part II, LNCS 5102, pp. 56–65, 2008. c Springer-Verlag Berlin Heidelberg 2008
Harmonic Variation of Edge Size in Meshing CAD Geometries
57
planar problems in section 3, we will detail the meshing of a single parametric surface by using generalization of Delaunay triangulation in section 4. Since the edge size function is known on the boundary, the treatment of the LaplaceBeltrami problem becomes a boundary value problem which we propose to solve numerically in section 5 which contains also the theoretical background of the mesh generation approach. In section 6, we focus on practical aspect and intuitive description for practitioners. Toward the end of the paper, we report on some benchmarks of CAD objects from IGES files and we compare our method with other approaches.
2
Definitions and Problem Setting
In our approach, the input is a CAD object which is bounded by a closed surface Γ that is composed of n parametric surfaces {Sk }nk=1 . Each Sk is given as the image of a multiply connected domain Dk ⊂ R2 by the following function xk : (u1 , u2 ) ∈ R2 −→ (xk,1 (u1 , u2 ), xk,2 (u1 , u2 ), xk,3 (u1 , u2 )) ∈ R3
(1)
which is supposed to be bijective and sufficiently smooth [5]. The surfaces Sk will be referred to as the patches of the whole surface Γ . Every patch of the surface Γ is bounded by a list of curves Ci . The CAD models come from IGES format where the most important nontrivial entities are enlisted in Table 1. Table 1. Most important IGES entities IGES Entities ID numbers IGES-codes Line 110 LINE Circular arc 100 ARC Polynomial/rational B-spline curve 126 B SPLINE Composite curve 102 CCURVE Surface of revolution 120 SREV Tabulated cylinder 122 TCYL Polynomial/rational B-spline surface 128 SPLSURF Trimmed parametric surface 144 TRM SRF Transformation matrix 124 XFORM
A mesh Mh is a set of triangles Tk ⊂ Rd (d = 2, 3) such that the intersection of two nondisjoint different triangles is either a single node or a complete edge. If d is 2 (resp. 3), then we will call Mh a 2D (resp. 3D) mesh. For a node A in a mesh Mh , its valence η(A) is the number of edges which are incident upon A. The set of nodes which are the endpoints of edges incident upon A, and which are different from A, will be denoted by ν(A). Our objective is to generate a 3D mesh Mh such that all nodes of Mh are located on the surface Γ . Additionally, we want that the edge lengths vary slowly implying that the lengths of the three edges in any triangle T ∈ Mh are proportional.
58
M. Randrianarivony
We will need the matrix I(xk ) := [gij (xk )] which represents the first fundamental form where ∂xk,p ∂xk,p ∂xk ∂xk , >= ∂ui ∂uj ∂ui ∂uj p=1 3
gij (xk ) :=<
3
i, j ∈ {1, 2}.
(2)
Motivation for the Planar Case
In this section, we want to treat briefly the mesh generation problem in the planar case (see Fig. 1) that should provide both motivation and intuitive ideas which facilitate the description of the general case of parametric surfaces. For that matter, we want to triangulate a planar multiply connected domain Ωh ⊂ R2 with polygonal boundaries Ph . Note that the boundary edge sizes are generally nonuniform (see Fig. 1). That is usually caused by adaptive discretization of some original curved boundaries P according to some error criteria. In order to
(a)
(b)
(c)
(d)
Fig. 1. Selected steps in mesh recursive refinement
obtain a few of triangles while keeping their good quality shape (Fig. 1(d)), the variation of sizes of neighboring edges should be small. Let us introduce the edge size function (3) ρ : Ωh −→ R+ . If this function is explicitly known, then a way to obtain the mesh is to start from a very coarse mesh (Fig. 1(a)) and to apply node insertion [2] in the middle of every edge [a, b] whose length exceeds the value of ρ at the midnode of [a, b]. Delaunay edge flipping is simultaneously applied to achieve better angle conditions. Unfortunately, the value of ρ is not known in practice. Since the edge
Harmonic Variation of Edge Size in Meshing CAD Geometries
59
size function ρ is known at the boundaries ∂Ωh = Ph , we consider the following boundary value problem: Δρ :=
∂2ρ ∂2ρ + =0 2 ∂u1 ∂u22
in Ωh ,
(4)
with the nonhomogeneous Dirichlet boundary condition given by the edge sizes at the boundary. That means the edge size function is required to be harmonic. A harmonic function satisfies in general the mean value property: 2π 1 ρ(a1 , a2 ) = ρ(a1 + r cos θ, a2 + r sin θ)dθ. (5) 2π 0 That is, ρ(a) is ideally the same as the average of the values of ρ in a circle centered at a = (a1 , a2 ). In that way, the edge size function ρ has practically small variation. Meshes with small edge size variation have advantages [10] in graphics and numerics. First, they use few triangles while not loosing shape quality. Second, they prevent numerical instabilities which are not desired in simulations.
4
Meshing Using the First Fundamental Form
In this section, we summarize the meshing of a single patch Sk specified by the smooth parametric function xk given in (1). To simplify the notation, we will drop the index k in the sequel. The approach in triangulating S is processed in two steps. First, a 2D mesh on the parameter domain D is generated according to the first fundamental form. Afterwards, the resulting 2D mesh is lifted to the parametric surface S by computing its image by x. We will call an edge of a mesh in the parameter domain a 2D edge and an edge in the lifted mesh a 3D edge. For that purpose, one starts from a coarse 2D mesh of D and a generalized two dimensional Delaunay refinement is used as summarized below. Similarly to the planar case, we introduce an edge size function ρ which is defined now on the parametric surface ρ : S −→ R+ . By composing ρ with the parameterization x of S, we have another function ρ˜ := ρ ◦ x which we will call henceforth ”parameter edge size function” because it is defined for all u = (u, v) in the parameter domain. Let us consider a 2D edge [a, b] ⊂ D and let us denote the first fundamental forms at a and b by Ia and Ib respectively. Further, we introduce the following average distance between a and b − →T − → T := 0.5(Ia + Ib ). (6) dRiem (a, b) := ab T ab The 2D edge [a, b] is split if this average distance exceeds the value of the parameter edge size function ρ˜ at the midnode of [a, b]. Note that no new boundary nodes are introduced during that refinement because only internal edges are allowed to be split. Consider now a 2D edge [a, c] shared by two triangles which form a convex quadrilateral [a, b, c, d]. Denote by T the average values of the
60
M. Randrianarivony
first fundamental forms Ia , Ib , Ic and Id at those nodes. The edge [a, c] is flipped into [b, d] if the next generalized Delaunay angle criterion is met − → − → − →T − → − → − → − →T − → bc × ba(da T dc) < da × dc(cb T ba).
(7)
We would like now to describe the procedure of obtaining the initial coarse triangulation. Suppose that we have a 2D domain P which may contain some holes and which has polygonal boundaries. We may think of P as a polygonal discretization of the parameter domain N D. First, the polygon P is split into a few simply connected polygons P = i=1 P(i) . Afterwards, we do the following for every simply connected polygon P(i) . One initializes its set of triangles as (i) empty set Th = ∅. Then, one finds a triangle T which can be chopped off from (i) (i) P(i) . We apply some updating P(i) := P(i) \ T and Th := Th ∪ T . We repeat the same chopping until Pi has no vertices left. Finally, the triangulation of P (i) is the union of all triangulations: Th := ∪N i=1 Th .
5
Edge Size and Theoretical Discussion
Let us consider a parametric surface S and a differentiable function F : S −→ R. The Laplace-Beltrami operator is defined by √ ∂F 1 ∂ ggij ΔS F = − √ (8) g ∂uj ∂ui in which we use Einstein notation in indexing and g is the determinant of I which we introduced in (2). The function F is said to be harmonic if ΔS F = 0. Since the edge size function ρ should be harmonic, we have the following problem −ΔS ρ = 0 in S (9) ρ = ρbound on ∂S . The values of ρ at the boundary which are denoted by ρbound are known because they are described by the boundary discretization. We will sketch in this section how to numerically solve the boundary value problem (9) by means of the finite element method. For that end, we take a temporary mesh Mh on S and we denote its boundary by ∂Mh . For a smooth function φ which takes value zero at the boundary we have < ∇S ρ, ∇S φ >=: a(ρ, φ) . (10) − ΔS ρφ = S
S
Let us define the following set of approximating linear space Vh := {f ∈ C0 (Mh ) : f|T ∈ P1 ∀ T ∈ Mh }, where C0 (Mh ) denotes the space of functions which are globally continuous on Mh and P1 the space of linear polynomials. For a function g we define the set Vhg := {f ∈ Vh : f = g on ∂Mh } which is not in general a linear space. The approximated solution ρh will reside in the set Vhρbound . In order
Harmonic Variation of Edge Size in Meshing CAD Geometries
61
to find ρh , we pick an element ρ˜ of Vhρbound and define μh by setting ρh = ρ˜ + μh . The function ρh is therefore completely determined if we know the new unknown function μh which resides interestingly in Vh0 . Observe that Vh0 is a linear space in which we choose a basis {φi } i∈I . As a consequence, the function μh is a linear combination of {φi }i∈I : μh = i∈I μi φi . By introducing the following bilinear form ah (·, ·) ah (ψ, φ) := aT (ψ, φ) with aT (ψ, φ) :=< ∇T ψ, ∇T φ >, (11) T ∈Mh
we have ah (ρh , φ) = 0 ∀φ ∈ Vh0 or equivalently ah (μh , φ) = −ah (˜ ρ, φ) 0 ∀φ ∈ Vh . Since φi builds a basis for Vh0 , this leads to a linear equation ah (φi , φj )μi = −ah (˜ ρ, φj ) ∀j ∈ I . (12) i∈I
One can assemble the stiffness matrix Mij := ah (φi , φj ) and solve (12) for μi which yields the value of μh . For every triangle T in Mh with internal angles α1 , α2 and α3 , its contribution to the stiffness matrix M is ⎡ ⎤ cot α2 + cot α3 − cot α3 − cot α2 MT = 0.5 ⎣ − cot α3 cot α1 + cot α3 − cot α1 ⎦ . (13) − cot α2 − cot α1 cot α1 + cot α2 We want now to theoretically discuss the applicability of the former triangulation to a given CAD model. We will only emphasize on the main points but the complete detail can be seen in [10]. The main critical aspects which we want to clarify are twofold. First, it has been shown that from every simply connected [9] polygon P, one may remove two triangles T1 and T2 (called ears) by introducing internal cuts. Thus, if we suppose that the polygon has n vertices, we need to chop off triangles (n − 2) times in order to obtain the initial coarse mesh. As a consequence, a simply connected polygon can be triangulated by using only boundary nodes. For triangulation of multiply connected polygons, we need to split them first into several simply connected polygons [9],[10]. Now, we will show that the linear system from (12) is uniquely solvable. Consider a triangle T = [A, B, C] of the mesh Mh . Let N 3 be the unit normal vector of T . Generate two unit vectors N 1 and N 2 perpendicular to N 3 such that (N 1 , N 2 , N 3 ) is an orthonormal system which can be centered at A. Since the triangle T is located in the plane spanned by (N 1 , N 2 ), every point x ∈ T −→ can be identified by (v1 , v2 ) ∈ R2 such that Ax = v1 N 1 + v2 N 2 . Consider the triangle t := [(0, 0), (1, 0), (0, 1)] and let ϕ be the parameterization which transforms t into T : V1 W1 u1 ϕ1 (u1 , u2 ) := , (14) ϕ2 (u1 , u2 ) V2 W2 u2 −− → −→ where (V1 , V2 ) and (W1 , W2 ) are the components of W := AB and V := AC in (N 1 , N 2 ). Denote by M the above matrix and let θ be the inverse of ϕ: 1 θ1 (v1 , v2 ) v1 W2 −W1 = . (15) −V V v θ2 (v1 , v2 ) det M 2 1 2
62
M. Randrianarivony
Let ψ be the linear polynomial which transforms ψ(0, 0) = μ(A), ψ(1, 0) = μ(B), ψ(0, 1) = μ(C). Its exact expression is ψ(u1 , u2 ) = [μ(B) − μ(A)]u1 + [μ(C) − μ(A)]u2 + μ(A). We want to compute aT (·, ·) in terms of (u1 , u2 ). By introducing aij := ∂vj θi , the integrand for aT (·, ·) involves I(u1 , u2 ) := (a11 ∂u1 ψ + a21 ∂u2 ψ)2 + (a12 ∂u1 ψ + a22 ∂u2 ψ)2 . Because of (15), we have a11 = W2 /D, a12 = −W1 /D, a21 = −V2 /D and a22 = V1 /D where D = det M . By using the fact that cos α =< V, W > /(V · W ) and sin α = det M/(V · W ), we obtain 1 {[μ(B)−μ(C)]2 cot α+[μ(C)−μ(A)]2 cot β +[μ(B)−μ(A)]2 cot γ}. I(u1 , u2 ) = D We have therefore (16) aT (μ, μ) = I(u1 , u2 )(det M )du1 du2 t
= 0.5{[μ(B) − μ(C)]2 cot α + [μ(C) − μ(A)]2 cot β + [μ(B) − μ(A)] cot γ}. 2
(17) (18)
By introducing Ψ (μ) := aT (μ, μ), the system in (13) can be obtained by aT (μ, ν) = ˜ := 1 (∂u1 ψ)W and V˜ := 1 (∂u2 ψ)V , 0.5[Ψ (μ + ν) − Ψ (μ) − Ψ (ν)]. Denote by W D D ˜ 2 − 2 < W ˜ , V˜ > +V˜ 2 . Thus, I(u1 , u2 ) = 0 iff W ˜ = λV˜ we have I(u1 , u2 ) = W 0 for some λ ∈ R. Since μ ∈ Vh is globally continuous and it takes zero values at the boundary, we have μ = 0. The form ah (·, ·) is thus symmetric positive definite. Hence, the linear system from (12) is solvable and the edge size function can be deduced.
6
Practical Aspect and Intuitive Description
In this section, we describe a realistic approach which is interesting for practitioners. Intuitively, our meshing approach is similar to the standard 2D Delaunay but we replace the usual Euclidian distance by the one given in (6). That means, the 2D parameter mesh which might be very anisotropic corresponds to a surface mesh that is very well shaped. In the previous discussions, the triangulation of a single trimmed surface [3] was provided. In practice, an IGES file contains several trimmed surfaces. Therefore, we will describe briefly how to triangulate the whole surface Γ composed of the patches S1 , · · · , Sn . First, we discretize (Fig. ˜ i in which we aim at 2) the curved boundaries Ci by piecewise linear curves C both accuracy and smoothness: curves which are almost straight need few vertices while those having sharp curvatures need many vertices [10]. Afterwards, ˜ i back to the we map the 3D nodes of the relevant piecewise linear curves C 2 parameter domain Dk ⊂ R for each patch Sk . Thus, we may apply the former approach to the polygons formed by the 2D preimages of the 3D nodes. In other words, a mesh Mk is created by using the technique in section 4 for each surface patch Sk . Finally, one merges the meshes M1 ,· · ·, Mn in order to obtain the final mesh of Γ . Since we use no boundary nodes other than those corresponding to the preimages, no new nodes are inserted during the refinements. As a consequence, nodes at the interface of two adjacent patches align.
Harmonic Variation of Edge Size in Meshing CAD Geometries
(a)
63
(b) Fig. 2. (a)Boundary nodes (b)Surface mesh
7
Numerical Results and Comparison
In this section, we illustrate our former approach numerically. Additionally, we compare our results with other meshing approaches. The CAD objects whose surfaces have to be triangulated are given as input in IGES files. We consider four CAD objects which have respectively 30, 25, 24 and 26 patches. We used the former method to generate meshes on their surfaces. The resulting meshes, having respectively 11834, 7944, 7672 and 8932 elements, as portrayed in Fig. 3. We would like to investigate the harmonicity of the meshes which we want to define now. For any considered node A ∈ R3 of a mesh Mh , we define ρ(A) :=
− 1 − → AB η(A)
(19)
B∈ν(A)
to be the average edge length. Now we define r(A) to be the length of the shortest edge incident to a node A and we let si (A) be the intersection of the i-th edge [A, Bi ] incident upon A and the sphere centered at A with radius r(A). We define the discrete mean value ρmean (A) to be ρmean (A) :=
η(A) 1 ρ(si (A)) η(A) i=1
in which ρ(si (A)) is the following convex combination of ρ(A) and ρ(Bi ) − → − → Asi Asi ρ(si (A)) := −−→ ρ(Bi ) + 1 + −−→ ρ(A). ABi ABi
(20)
64
M. Randrianarivony
(a)
(b)
(c)
(d)
Fig. 3. Four meshes generated from CAD objects Table 2. Harmonicity of the four meshes
mesh1 mesh2 mesh3 mesh4
Average harmonicity Smallest harmonicity Largest harmonicity 0.997292 0.738332 1.263884 0.997050 0.724865 1.231922 0.997709 0.755730 1.239204 0.997353 0.745304 1.270894
We have a discrete mean value property if ρ(A) = ρmean (A). We define the harmonicity of a node A to be the ratio ξ(A) := ρ(A)/ρmean (A). If the value of the harmonicity approaches the unity, the discrete mean value property is valid. We have computed the average harmonicity of the four meshes and the results can be found in the next table. As one can note in Table 2, the mesh sizes in our tests practically satisfy good harmonicity. That can equally be observed in Fig. 3.
Harmonic Variation of Edge Size in Meshing CAD Geometries
65
Most mesh generation approaches do not take harmonicity into consideration. For the sake of comparison, we have generated four meshes for the same CAD data but with another meshing technique where the harmonicity is neglected. The resulting average harmonicities are respectively 1.603, 1.909, 1.512 and 1.802. That means that neighboring edges are not guaranteed to have proportional edge size.
8
Conclusion and Future Work
We have described a method for generating a triangular surface mesh on a CAD model which is given by an IGES format. Neighboring edges have proportional lengths. That was achieved by imposing that the edge size function is conform with the Laplace-Beltrami operator. In the future, we will improve the implementation by including more IGES entities. Since many people move now from the graphic standard IGES to STEP, we intend also to accept STEP files. Additionally, we will develop quadrilateral meshes since they are appropriate for some graphical or numerical tasks.
References 1. Borouchaki, H., George, P.: Aspects of 2-D Delaunay Mesh Generation. Int. J. Numer. Methods Eng. 40(11), 1957–1975 (1997) 2. Bossen, F., Heckbert, P.: A Pliant Method for Anisotropic Mesh Generation. In: 5th International Meshing Roundtable Sandia National Laboratories, pp. 63–76 (1996) 3. Brunnett, G.: Geometric Design with Trimmed Surfaces. Computing Supplementum 10, 101–115 (1995) 4. Edelsbrunner, H., Tan, T.: An Upper Bound for Conforming Delaunay Triangulations. Discrete Comput. Geom. 10, 197–213 (1993) 5. Farin, G.: Curves and Surfaces for Computer Aided Geometric Design: A Practical Guide. Academic Press, Boston (1997) 6. Frey, P., Borouchaki, H.: Surface Mesh Quality Evaluation. Int. J. Numer. Methods Eng. 45(1), 101–118 (1999) 7. Graham, I., Hackbusch, W., Sauter, S.: Discrete Boundary Element Methods on General Meshes in 3D. Numer. Math. 86(1), 103–137 (2000) 8. Kolingerova, I.: Genetic Approach to Triangulations. In: 4th International Conference on Computer Graphics and Artificial Intelligence, France, pp. 11–23 (2000) 9. O’Rourke, J.: Computational Geometry in C. Cambridge Univ. Press, Cambridge (1998) 10. Randrianarivony, M.: Geometric Processing of CAD Data and Meshes as Input of Integral Equation Solvers. PhD thesis, Technische Universit¨ at Chemnitz (2006)
Generating Sharp Features on Non-regular Triangular Meshes Tetsuo Oya1,2 , Shinji Seo1 , and Masatake Higashi1 1
2
Toyota Technological Institute, Nagoya, Japan The University of Tokyo, Institute of Industrial Science, Tokyo, Japan {oya, sd04045, higashi}@toyota-ti.ac.jp
Abstract. This paper presents a method to create sharp features such as creases or corners on non-regular triangular meshes. To represent sharp features on a triangular spline surface we have studied a method that enables designers to control the sharpness of the feature parametrically. Extended meshes are placed to make parallelograms, and then we have an extended vertex which is used to compute control points for a triangular B´ezier patch. This extended vertex expressed with a parameter enables designers to change the shape of the sharp features. The former method we presented deals with regular meshes, however, it can be a strong restriction against the actual variety of meshes. Therefore, we developed a method to express sharp features around an extraordinary vertex. In this paper, we present algorithms to express creases and corners for a triangular mesh including extraordinary vertices.
1
Introduction
Computer-aided design tools have supported the designer’s work to create aesthetic and complex shapes. However, to represent a pleasing and high quality surface is still a difficult task. The reason of this difficulty is that both high continuity of the surface and the ability to handle 2-manifold surfaces with arbitrary topology are required especially in the industrial design field. In addition, sharp features such as creases and corners which play a significant role to express product’s shape should be treated as they want. However, expressing sharp features at an arbitrary place is not easy. Therefore, a method to represent sharp features and to control their shapes would be a great help to designers. There are two major ways to represent surfaces in computer graphics. In CAD/CAM software, tensor product surfaces such as B´ezier, B-spline and NURBS are usually used to represent free-form surfaces. These are expressed in parametric form and generally have high differentiability enough to represent class-A surfaces. However, connecting multi patches with high continuity is rather difficult. Also, techniques like trim or blend are usually utilized to represent the required complexity, and it would be an exhausting job. Furthermore, it is difficult to generate sharp features on arbitrary edges. The other important method, namely, subdivision surfaces have become a popular method recent years especially in the entertainment industry. Inputting M. Bubak et al. (Eds.): ICCS 2008, Part II, LNCS 5102, pp. 66–75, 2008. c Springer-Verlag Berlin Heidelberg 2008
Generating Sharp Features on Non-regular Triangular Meshes
67
an original mesh, some subdivision scheme is repeatedly performed on the vertices and the faces of the mesh, then a refined resultant is obtained. Although its limit surface is theoretically continuous everywhere, the obtained surface is a piecewise smooth surface. Thus it is not applicable to the surfaces used in industrial design where high quality surfaces are always required. Moreover, the parametric form of the surface is not available. As for sharp features on a subdivision surface, there are many studies dealing with creases and corners. Nasri [1] presented subdivision methods to represent boundary curves, to interpolate data points, and to obtain intersection curves of subdivision surfaces. Hoppe et al. [2] proposed a method to reconstruct piecewise smooth surfaces from scattered points. They introduced a representation technique of sharp features based on the Loop’s subdivision scheme [3]. To model features like creases, corners and darts, several new masks were defined on regular and non-regular meshes. DeRose et al. [4] described several effective subdivision techniques to be used in the character animation. They introduced a method to generate semi-sharp creases whose sharpness can be controlled by a parameter. Biermann et al. [5] improved subdivision rules so as to solve the problems of extraordinary boundary vertices and concave corners. Based on this method, then Ying and Zorin [6] presented a nonmanifold subdivision scheme to represent a surface where different patches interpolates a common edge along with the same tangent plane. Sederberg et al. [7] presented a new spline scheme, called T-NURCCs, by generalizing B-spline surfaces and Catmull-Clark surfaces. In this method, features are created by inserting local knots. To create and change features, direct manipulation of knots and control points is required. These methods have succeeded to represent sharp features, however, the subdivision surface technique is not a principal method in an industrial design field where high quality smooth surfaces are demanded. An alternative method to create surfaces is generating a spline surface composed of B´ezier patches. Triangular B´ezier patching can be used to represent complex models because each patches are easily computed from the original mesh. The advantage of this method is that it is rather easier to keep continuity across the patches than conventional tensor product patches. Hahmann [8] [9] has shown the effectiveness of spline surface technique. Yvart and Hahmann [10] proposed a hierarchical spline method to represent smooth models on arbitrary topology meshes. With their method, designers are able to create complex models preserving tangent plane continuity when refining a local patch to add details. However, they have not mentioned how to represent sharp features. Thus, to be a more practical method, representing sharp features on a triangular spline surface should be studied. Loop [11] represented a sharp edge as a boundary curve by connecting two patches, however, its shape is not controllable because it is depend on each patches’ boundary curves. Higashi [12] presented a method to express sharp features by using the concept of extended mesh. With that method, the shape of the edge can be changed parametrically. In spite of its high potential, the triangular spline technique is not frequently used like other methods. One of the reasons is its difficulty of handling non-regular meshes. Here, a non-regular mesh means a mesh containing an extraordinary
68
T. Oya, S. Seo, and M. Higashi
vertex whose valence is not six. In this paper, we developed a method to represent controllable sharp features on a non-regular triangular mesh. This paper is organized as follows. Sec. 2 presents basics on B´ezier representation used in this paper. Sec. 3 describes the method of mesh extension to express sharp features. In Sec. 4, we present main contributions of this paper, that is, schemes to handle non-regular meshes. Then several examples are shown in Sec. 5, and Sec. 6 concludes this paper.
2
Triangular B´ ezier Patch
To construct a triangular spline surface, we utilize a triangular B´ezier patch. In this section, we briefly describe important backgrounds about B´ezier forms [13]. A B´ezier surface of degree m by n is defined as a tensor product surface bm,n (u, v) =
m n
bi,j Bim (u)Bjn (v)
(1)
i=0 j=0
where bi,j is the control net of a B´ezier surface, and Bim (u) is the Bernstein polynomials of degree m. A triangular B´ezier patch is defined in the barycentric coordinates that is denoted u := (u, v, w) with u + v + w = 1. The expression is |i| = i + j + k (2) bi Bin (u), b(u) = |i|=n where bi is a triangular array of the control net and n! n n n i j k Bi (u) = = u v w ; |i| = n, i i i!j!k!
(3)
are the bivariate Bernstein polynomials. In this paper we use quartic B´ezier patches thus degree n is set to 4. The triangular spline surface used in this paper is represented by B´ezier patches. Computing the necessary control points bi from the original mesh, we can obtain the corresponding B´ezier patches. Composing all of them, the resulting surfaces is a C 2 surface if the original mesh is regular. We utilize Sabin’s rules [14] [15] to compute B´ezier points. Let P0 be the ordinary vertex and P1 (i); i = 1, · · · , 6 be the six neighboring vertices of P0 . In the case of quartic triangular B´ezier patch there are fifteen control points, however, just four distinct rules exist due to symmetry. The following is the rules to compute B´ezier control points Qijk as illustrated in Fig. 1 : 24Q400 = 12P0 + 2
6
P1 (i),
(4)
i=1
24Q310 = 12P0 + 3P1 (1) + 4P1 (2) + 3P1 (3) + P1 (4) + P1 (6),
(5)
24Q211 = 10P0 + 6P1 (1) + 6P1 (2) + P1 (6) + P1 (3),
(6)
24Q220 = 8P0 + 8P1 (2) + 4P1 (1) + 4P3 (3).
(7)
Generating Sharp Features on Non-regular Triangular Meshes B
P1 (1)
Q004
P1 (6)
E
Q103 Q013 Q112
Q202 P1 (5)
69
P0
Q400
Q310
Q022
Q121
Q301 Q211 Q220
G Q031
Q130
P1 (2)
C A
H 1-s
s
F
Q040
D P1 (4)
P1 (3) Vertices of the original meshes Ordinary vertex 1-ring vertices of the ordinary vertex Control points computed by using and Other control points
Midpoints Interpolated point on the line EF Extended vertex
Fig. 1. Control points for triangular B´ezier patch
Fig. 2. Mesh extension and definition of parameter s
The remaining control points are obtained by applying the same rules to the neighboring vertices of P1 (1) and P1 (2).
3
Mesh Extension
In this section we briefly describe the method of mesh extension [12] to represent sharp features on a regular mesh. First, a designer specifies an edge to be a crease, then the meshes sharing the specified edge are separated. Next, we make extended vertices at the opposite side of the specified edge for both triangles. As shown in Fig. 2, let the original triangles be ABC and BCD. The edge BC is specified to create a crease. Point E is the midpoint of the edge BC and F is the midpoint of AD. Then the position of G is parametrically defined so as to satisfy the relation G = sE + (1 − s)F
(8)
where s denotes the parameter to control the sharpness of the crease. Finally the extended vertex H is defined as the position to satisfy H = 2 AG and the control triangle BCH is produced. In the opposite side, similar procedure is conducted with same parameter s.
(a) s = 0 (smooth surface)
(b) s = 0.5 (crease)
(c) s = 1.0 (crease)
Fig. 3. Examples of generating crease edges for regular mesh
70
T. Oya, S. Seo, and M. Higashi
Inputting s, all B´ezier control points are determined and we get a regenerated surface where a sharp crease appears. By changing the value of s, the designer is able to control the sharpness of the crease. Fig. 3 shows examples of the surfaces created by this method. When s is equal to 0, the resulting surface is the original C 2 surface itself(Fig. 3(a)). When s is equal to 1, the resulting surface(Fig. 3 (c)) is same as the shape of the subdivision crease. For the details of generating a dart or a corner, see [12].
4
Sharp Features on Non-regular Meshes
This section introduces the rules to generate sharp features such as creases and corners on non-regular meshes. Higashi et al. [12] presented the method of mesh extension to create sharp features on regular meshes described in the previous section, however, computing rules for generating them on non-regular meshes are not shown. We have developed a method based on the mesh extension technique and Peters’ algorithm [16] to generate a smooth surface with sharp features on a mesh including an extraordinary vertex. 4.1
Creating a Crease
There are numerous types of non-regular meshes. Here, non-regular meshes mean the set of meshes around an extraordinary vertex whose valance is not six. In this paper, we deal with the case of n = 5 because the proposed method can be applied to other cases such as n = 4 or 7. In the case of n = 5, there are five meshes around an extraordinary vertex. Crease edges are defined on the two edges that divide these five meshes into two and three. On the side of the three meshes, the same rule is applied to obtain the control points as in the case of regular meshes. On the side of the two meshes, there are three steps to compute the control points. In Fig. 4 (a), the input meshes are shown. For the first step of the process, as depicted in Fig. 4 (b), one edge is changed to connect the vertex in orange with the extraordinary vertex. Then, two meshes including crease edges are extended to make parallelograms using two new vertices which are colored red. By this treatment, the original non-regular meshes are now regular. Using ordinal Sabin’s rules, control points represented by small red point are computed. Five white points are computed by Sabin’s rules with one extended vertex and five original vertices. And small black control points are obtained by using original six vertices. Second, the same process is conducted in the opposite side as shown in Fig. 4 (c). In the third step, as illustrated in Fig. 4 (d), the positions of two control points in yellow are modified to be middle between two adjacent control points. This calculation is done to keep G1 continuity along the edge. Now, all of the required control points are available and we have the resulting surface by composing five B´ezier patches that is expressed with Eq. (2). Note that the vertices of the extended meshes are only used to compute the necessary control
Generating Sharp Features on Non-regular Triangular Meshes (a)
(b)
(c)
(d)
Extraordinary vertex 1-ring ordinary vertices Adjacent vertices Vertex used in step 1 and 2 Vertex of extended mesh
71
Control points using Sabin’ s rules with extended vertices Control points using orange vertices in step 1 and 2 Control points using Sabin’ s rules with original vertices Control points to be modified for smoothness in step 3
Fig. 4. Description of the presented procedure: (a) the input meshes and vertices, (b) change of an edge(orange) and computation of control points(red) with extended meshes, (c) same procedure with (b) on the other side, (d) modification of the positions of the control points(yellow) to be smooth surface
points. This surface represents the case of s = 1, therefore, the shape of the crease is identical to the original mesh. In order to represent the case of s = 0, we adopt Peters’s scheme [16] and these two surfaces are linearly interpolated with parameter s. Thus the surface changes its shape between these two shapes by inputting the parameter s. 4.2
Creating a Corner
To represent a sharp corner, we defined another rule. For simplicity, the case of n = 3 is described. As shown in Fig. 5, there are three faces meeting at the target corner. Control points of each faces are obtained by using mesh extension procedure. Making parallelograms, five faces are generated as if the target corner vertex is the center of six meshes. Control points are calculated by Sabin’s rules with these six vertices. Performing same procedure on the other two faces, all required control points are obtained. These control points represent the shape of the input mesh itself (s = 1). Then, using Peters’ scheme [16] with the original vertices, we obtain control points to express a smooth surface (s = 0). Seven control points, namely the corner point and its surrounding six points, are employed to represent a sharp corner. These points are colored blue in Fig. 6. Using the shape control parameter s, these seven control points are linearly interpolated as pnew = (1 − s)psmooth + spsharp
(9)
72
T. Oya, S. Seo, and M. Higashi
Vertices of the original mesh Vertices of the extended meshes Control points by using the vertices of the extended meshes
Fig. 5. An illustration of mesh extension to obtain control points for corner triangle faces. Starting from one of the corner mesh, four vertices are generated by making parallelogram. The same procedure is conducted on remaining two faces.
Smooth surface
psharp 1-s s Control points obtained by using extended meshes Control points used for sharp corner Control points obtained by Peters’ method
pnew
psmooth pnew = (1 − s)psmooth + spsharp
Fig. 6. Description of sharp corner generation. To change the shape of the corner, colored seven control points are used. These control points are linearly interpolated between Peters’ control points (red) and control points (blue) obtained by using mesh extension.
where psmooth is the position of the control points obtained by using Peters’s scheme and psharp denotes the position of the control points generated by the mesh extension. Inputting some value to the parameter s, new control points pnew are computed by Eq. (9). By changing the value of the parameter s, we have a smooth corner (s = 0) and a sharp corner (s = 1).
Generating Sharp Features on Non-regular Triangular Meshes
5
73
Results
This section provides application results where the presented method is used to represent sharp features on non-regular meshes. Here, results of generating creases are given in the case of valence n = 4, 5 and 7. Tested meshes are depicted in Fig. 7. Figs. 8∼10 show results of each cases, where parameter s is changed from 0 to 0.5 and 1. When s = 0, the resulting surface is identical to the smooth surface that is obtained by using the input mesh. On the other hand, if s becomes greater than 0, creases appear at the specified edges. When s is equal to 1, the shape of the crease is same as the shape of the input mesh. A small undulation is observed around the extraordinary vertex when s = 0.5. The reason is that the smooth surface(s = 0) is constructed by using Peters’ scheme, where the tangential plane on the extraordinary vertex is arbitrarily input by a user. And the shapes of each B´ezier patches are influenced by the tangential plane. Therefore, the crease line undulates when the mesh is not regular because tangent vectors are not necessarily parallel to the crease edges. This must be conquered to generate high quality creases. Fig. 11 represents the case of sharp corner. From this picture, making a sharp corner is also successfully performed.
n = 4 (non-regular)
n = 5 (non-regular)
n = 6 (regular)
n = 7 (non-regular)
Ordinary vertex( regular meshes) Extraordinary vertex( non-regular meshes) 1-ring vertices Normal mesh edge Crease edge
Fig. 7. Types of meshes used to produce examples
(a) s = 0 (smooth surface)
(b) s = 0.5 (crease)
(c) s = 1.0 (crease)
Fig. 8. Results of generating creases in the case of n = 4
74
T. Oya, S. Seo, and M. Higashi
(a) s = 0 (smooth surface)
(b) s = 0.5 (crease)
(c) s = 1.0 (crease)
Fig. 9. Results of generating creases in the case of n = 5
(a) s = 0 (smooth surface)
(b) s = 0.5 (crease)
(c) s = 1.0 (crease)
Fig. 10. Results of generating creases in the case of n = 7
(a) s = 0 (smooth surface)
(b) s = 0.5 (corner)
(c) s = 1.0 (corner)
Fig. 11. Results of generating sharp corner in the case of n = 3
6
Conclusion
This paper presented a method to generate sharp features on non-regular meshes. Our method is based upon the regular version of the mesh extension technique and we have developed new schemes to deal with non-regular meshes. Results suggest that the method is effective for the tested cases. Future work would be an exploration for more various cases and a pursuit of the quality of features. Acknowledgement. This study was financially supported by the High-tech Research Center for Space Robotics from the Ministry of Education, Sports, Culture, Science and Technology, Japan.
Generating Sharp Features on Non-regular Triangular Meshes
75
References 1. Nasri, A.H.: Polyhedral Subdivision Methods for Free-Form Surfaces. ACM Transactions on Graphics 6(1), 29–73 (1987) 2. Hoppe, H., DeRose, T., Duchamp, T., Halstead, M.: Piecewise Smooth Surface Reconstruction. In: Proc. SIGGRAP 1994, pp. 295–302 (1994) 3. Loop, C.: Smooth Subdivision Surfaces Based on Triangles, Master’s thesis, Department of Mathematics, University of Utah (1987) 4. DeRose, T., Kass, M., Truong, T.: Subdivision Surfaces in Character Animation. In: Proc. SIGGRAPH 1998, pp. 85–94 (1998) 5. Biermann, H., Levin, A., Zorin, D.: Piecewise Smooth Subdivision Surfaces with Normal Control. In: Proc. SIGGRAPH 2000, pp. 113–120 (2000) 6. Ying, L., Zorin, D.: Nonmanifold Subdivision. In: Proc. IEEE Visualization, pp. 325–332 (2001) 7. Sederberg, T.W., Zheng, J., Bakenov, A., Nasri, A.: T-splines and T-NURCCs. ACM Transactions on Graphics 22(3), 477–484 (2003) 8. Hahmann, S., Bonneau, G.-P.: Triangular G1 interpolation by 4-splitting domain triangles. Computer Aided Geometric Design 17, 731–757 (2000) 9. Hahmann, S., Bonneau, G.-P.: Polynomial Surfaces Interpolating Arbitrary Triangulations. IEEE Transactions on Visualization and Computer Graphics 9(1), 99–109 (2003) 10. Hahmann, S., Bonneau, G.-P.: Hierarchical Triangular Splines. ACM Transactions on Graphics 24(4), 1374–1391 (2005) 11. Loop, C.: Smooth Spline Surfaces over Irregular Meshes. In: Proc. SIGGRAP 1994, pp. 303–310 (1994) 12. Higashi, M., Inoue, H., Oya, T.: High-Quality Sharp Features in Triangular Meshes. Computer-Aided Design & Applications 4, 227–234 (2007) 13. Farin, G.: Curves and Surfaces for CAGD, 5th edn. Academic Press, London (2005) 14. Boem, W.: The De Boor Algorithm for Triangular splines. In: Surfaces in Computer Aided Geometric Design, pp. 109–120. North-Holland, Amsterdam (1983) 15. Boem, W.: Generating the Bezier Points of Triangular Spline. In: Surfaces in Computer Aided Geometric Design, pp. 77–91. North-Holland Publishing Company, Amsterdam (1983) 16. Peters, J.: Smooth Patching of Refined Triangulations. ACM Transactions on Graphics 20(1), 1–9 (2001)
A Novel Artificial Mosaic Generation Technique Driven by Local Gradient Analysis Sebastiano Battiato, Gianpiero Di Blasi, Giovanni Gallo, Giuseppe Claudio Guarnera, and Giovanni Puglisi Dipartimento di Matematica e Informatica University of Catania, Italy {battiato,gdiblasi,gallo,guarnera,puglisi}@dmi.unict.it http://www.dmi.unict.it/∼ iplab
Abstract. Art often provides valuable hints for technological innovations especially in the field of Image Processing and Computer Graphics. In this paper we present a novel method to generate an artificial mosaic starting from a raster input image. This approach, based on Gradient Vector Flow computation and some smart heuristics, permit us to follow the most important edges maintaining at the same time high frequency details. Several examples and comparisons with other recent mosaic generation approaches show the effectiveness of our technique. Keywords: Artificial Mosaic, Non Photo-Realistic Rendering, Gradient Vector Flow.
1
Introduction
Mosaics are artwork constituted cementing together small colored tiles. Probably they can be considered the first example of image synthesis technique based on discrete primitives. The creation of a digital mosaic of artistic quality is a challenging task. Many factors like position, orientation, size and shape of tiles must be taken into account in the mosaic generation in order to densely pack the tiles and emphasize the orientation chosen by the artist. Digital mosaic generation from a raster image can be formulated as an optimization problem in the following way: Given an image I in the plane R2 and a vector field Φ(x, y) defined on that region by the influence of the edges of I, find N sites Pi (xi , yi ) in I and place N rectangles, one at each Pi , oriented with sides parallel to Φ(xi , yi ), such that all rectangles are disjoint, the area they cover is maximized and each tile is colored by a color which reproduces the image portion covered by the tile [1]. Many mosaic generation algorithms have been recently developed. Hausner [1] uses Centroidal Voronoi Diagram together with user selected features and Manhattan distance. This approach obtains good results but, due to the high number of iterations necessary to reach convergence, it is computationally slow. In [2,3] the authors present an approach based on directional guidelines and distance transform. They obtain very realistic results with a linear complexity M. Bubak et al. (Eds.): ICCS 2008, Part II, LNCS 5102, pp. 76–85, 2008. c Springer-Verlag Berlin Heidelberg 2008
A Novel Artificial Mosaic Generation Technique
77
with respect to image size. A novel technique for ancient mosaics generation has been presented in [4]. The authors, using graph-cut optimization algorithm, are able to work on tiles positioning without an explicit edge detection phase. Other related works can be found in [5,6,7]. A complete survey of the existing methods in the field of artificial mosaic is available in [8]. In this paper we propose a novel approach based on Gradient Vector Flow (GVF) [9] computation together with some smart heuristics used to drive tiles positioning. Almost all previous approaches filter out high frequencies in order to simplify mosaic generation. Preliminary works [10] have shown that GVF properties permit us to preserve edge information and maintain image details. The novelty of this paper is related to the heuristics used to follow principal edges and to maximize the overall mosaic area covering. In particular the tiles positioning is not based only on gradient magnitude [10] but makes use of local considerations to link together vectors that share the same ”logical” edge. Experimental results confirm the better quality of the new technique with respect to the state of the art proposals [8]. The paper is structured as follows. Next section describes in detail the proposed methodology. Experiments are reported in Section 3 whereas Section 4 closes the paper tracking direction for future works.
2
Proposed Algorithm
In order to emulate the style of an ancient artisan we have developed an automatic technique based on the following two steps: – GVF (Gradient Vector Flow) field computation based on [9] algorithm; – rule based tile positioning. GVF is a dense force field designed by the authors of [9] in order to solve the classical problems affecting snakes (sensitivity to initialization and poor convergence to boundary concavity). Starting from the gradient of an image, this field is computed through diffusion equations. GVF is a field of vectors v = [v, u] that minimizes the following energy function: (1) E= µ(u2x + u2y + vx2 + vy2 ) + |∇f |2 |v − ∇f |2 . where the subscripts represent partial derivates along x and y axes respectively, µ is a regularization parameter and |∇f | is the gradient computed from the intensity input image. Due to the formulation described above, GVF field values are close to |∇f | values where this quantity is large (energy E, to be minimized, is dominated by |∇f |2 |v − ∇f |2 ) and are slow-varying in homogeneous regions (the energy E is dominated by sum of the squares of the partial derivatives of GVF field). An example of GVF field is shown in Figure 1.
78
S. Battiato et al.
Fig. 1. Input image and its corresponding GVF field
This vector field can be used to effectively drive tiles positioning. Edge information is preserved, it is propagated in the close regions and merged together in a smoothly way. Let I be the input image to be mosaicized. In order to simplify the algorithm we work only on the luminance channel of the image I, eliminating hue and saturation information. The luminance L(I) is then equalized and the discrete gradient of the results is calculated, by means of crossing difference. The equalization process, especially for natural images, allows to normalize the overall gradient distribution. The horizontal and vertical components of the gradient ∇L(I) are used as input for the GVF algorithm. Notice that in the implementation gradient computation is performed using Robert’s Kernel. This choice is more noise sensitive and hence incorporates in the final mosaic a little, aesthetically pleasant, randomicity. All the tiles have the same rectangular shape and the same size. Moreover we impose that tiles do not overlap. Placing ordering is hence fundamental in terms of visual overall effect. First we consider local |GV F (I)| maxima with values greater than a threshold th . These pixels, sorted according to |GV F (I)|, are selected together with their neighbors with |GV F (I)| greater than tl (chains of tiles are built up and placed). We impose that the tile orientation is obtained according to the GVF direction in its central point. In this way we locate first the neighborhood of main edges in the input image, just to follow the perceptual orientation of the image itself. The second step of the algorithm is devoted to cover the homogeneous regions of the image. This is accomplished simply placing each tile one by one following the order left to right, up to bottom, starting form the upper-left corner of the image. This heuristic strategy, somewhat arbitrary, is justified by the properties of the GVF: this technique leads to aesthetically pleasant results, by preserving main orientations and covering a wide portion of pixels with tiles densely packed. The algorithm can be summarized as follows:
A Novel Artificial Mosaic Generation Technique 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15.
16. 17. 18. 19. 20. 21. 22. 23.
3
79
Input: a raster image I L(I) ← Luminance(I) G(I) ← Robert’s Gradient(Equalize(L(I))) [u, v] ← GV F (|G(I)|∞ , µ, nIterations) gvf (I) ← (u2 + v 2 )1/2 In (I) ← NonMaxSuppression(gvf (I)) let th , tl be threshold values, with th > tl Sort in queue Q pixels (i, j) according to decreasing In (i, j) values. Only pixels whose In is greater than the threshold th are put into Q. while Q is not empty Extract a pixel (i, j) from Q if (i, j) is not marked Place a tile centering it in (i, j) at angle α = tan−1 (v(i, j)/u(i, j)) if in this way the tile overlaps with previously placed tiles Skip tile positioning Starting from (i, j) follow and mark as visited the chain of local maxima (i.e. In (w, z) > tl ) in both directions perpendicular to α, to obtain a guideline Place a tile centering it in each (w, z) in the chain at angle β = tan−1 (v(w, z)/u(w, z)) if in this way the tile overlaps with previously placed tiles Skip tile positioning. for j ← 1 to length(I) for i ← 1 to width(I) Place a tile in the pixel(i, j) at angle γ = tan−1 (v(i, j)/u(i, j)) if in this way the tile overlaps with previously placed tiles Skip tile positioning.
Experimental Results
The above algorithm has been implemented in JAVA, using for GVF computation an external MATLAB module. The method as been compared, to assess the aesthetic quality, with the mosaics obtained by [2] and [4] by using their original implementations. We wish to thank all the authors of these papers for providing the output of their techniques upon our request. For sake of comparison Figure 2 reports the mosaic obtained from the standard Lena picture. A first clear advantage of the novel technique is that it is able to better preserve fine details. This happens because high frequency areas are prioritary on tiles placing. Observe, to support this claim, the areas around Lena’s nose, lips and high brow. Another performance index of mosaic algorithms is the amount and spatial distribution of untiled space. The area left uncovered by the proposed technique is comparable with the amount of uncovered area left by [2], but gaps are here better distributed. For example the constraints of [2] force the appearance of a long ”crack” in the vertical band on the wall behind Lena, while the proposed approach achieves in the same region a pleasant smoothness. Relatively to [4] it should be observed that the uncovered area left by our technique is considerably less. Observe that a higher percentage of covered area leads to a better preservation of the original
80
S. Battiato et al.
Fig. 2. Visual comparison between mosaics generated by our approach (B), [2] (C) and [4] (D), applied on input image (A) considering in all cases the same tile size 5×5
A Novel Artificial Mosaic Generation Technique
81
colors of the same picture (see Table 1). The perceived texture obtained with the proposed technique appears, finally, less chaotic than the texture obtained with [4]. As for the parameter adopted to produce Figure 2, the tile size is 5×5 and the image size is 667×667. Typically, considering other images, we obtain covered area greater than [4] but smaller than [2]. Table 1. Number of tiles and covered area comparison between various approaches Technique Number of tiles Covered area Our Method 13412 75.4% [2] 13994 78.6% [4] 11115 62.5%
Fig. 3. Comparison between the proposed approach and [10] on a Lena image detail (a). The novel heuristics (c) are able to follow the underlying edges (b) maintaining higher fidelity than (d) also considering the original colors.
Figure 3 shows a comparison between the proposed approach and [10] on a Lena image detail (a). Both approaches do not consider the final step of linear tiles placing. The novel heuristics (c) are able to follow the underlying edges (b) maintaining higher fidelity than (d) also considering the original colors. In Figure 4 we show the same image processed using increasing tile size. The right relation between image size (and its level of detail) of the input, and the tile size to be used in the mosaicing process, can be derived only by aesthetic considerations. Our algorithm is able to preserve the global appearance even with higher tile size. Finally we show in Figure 5 an example of mosaicized image by using rectangular tiles (3x9). This example shows how the proposed criteria are able to preserve fine details (due to GVF capabilities) maintaining at the same time the global orientation of almost all edge present in the original picture (due to the tile positioning rules).
82
S. Battiato et al.
Fig. 4. Mosaics generated with increasing tiles size A (3x3), B (6x6), C (10x10), D (14x14)
A Novel Artificial Mosaic Generation Technique
83
Fig. 5. An example of mosaic generated with rectangular tiles (3x9)
The overall complexity of the proposed technique is O(kn) + O(nlogn), where n is the number of pixels in the source image. Further results are depicted in Figures 6, 7. The mosaicized images can be also downloaded at the following web address: http://svg.dmi.unict.it/iplab/download/
84
S. Battiato et al.
Fig. 6. Input image (A) and its mosaic (B) generated by our approach (image size 595x744, tile size 5x5 )
Fig. 7. Input image (A) and its mosaic (B) generated by our approach (image size 532x646, tile size 4x4 )
A Novel Artificial Mosaic Generation Technique
4
85
Conclusions
We propose a novel technique to produce a traditionally looking mosaic from a digital source picture. The new technique tries to overcome the difficulties that rely on edge detection, using the Gradient Vector Flow. Tests show that the new technique produces aesthetically pleasant images that have a greater fidelity in dealing with fine details and a better management of gaps. The proposed technique does not cut tiles. Indeed the next research step will integrate heuristics like those proposed in [2] and [3] to cut tiles with the proposed method. Future works will be also devoted to color management and mosaic generation in vectorial format without using raster-to-vector conversion techniques [11].
References 1. Hausner, A.: Simulating decorative mosaics. In: Proc. SIGGRAPH 2001, pp. 573– 580 (2001) 2. Di Blasi, G., Gallo, G.: Artificial mosaics. The Visual Computer 21(6), 373–383 (2005) 3. Battiato, S., Di Blasi, G., Farinella, G.M., Gallo, G.: A novel technique for opus vermiculatum mosaic rendering. In: Proc. ACM/WSCG 2006(2006) 4. Liu, Y., Veksler, O., Juan, O.: Simulating classic mosaics with graph cuts. In: Yuille, A.L., Zhu, S.-C., Cremers, D., Wang, Y. (eds.) EMMCVPR 2007. LNCS, vol. 4679, pp. 55–70. Springer, Heidelberg (2007) 5. Faustino, G.M., de Figueiredo, L.H.: Simple adaptive mosaic effects. In: Proc. SIBGRAPI 2005, pp. 315–322 (2005) 6. Elber, E., Wolberg, G.: Rendering traditional mosaics. The Visual Computer 19(1), 67–78 (2003) 7. Schlechtweg, S., Germer, T., Strothotte, T.: Renderbots — multi-agent systems for direct image generation. Computer Graphics Forum 24(2), 137–148 (2005) 8. Battiato, S., Di Blasi, G., Farinella, G.M., Gallo, G.: Digital mosaic frameworks an overview. Computer Graphics Forum 26(4), 794–812 (2007) 9. Xu, C., Prince, L.: Snakes, shapes, and gradient vector flow. IEEE Transactions on Image Processing 7(3), 359–369 (1998) 10. Battiato, S., Di Blasi, G., Gallo, G., Guarnera, G.C., Puglisi, G.: Artificial mosaics by gradient vector flow. In: Proc. EUROGRAPHICS 2008 (2008) 11. Battiato, S., Farinella, G.M., Puglisi, G.: Statistical based vectorization for standard vector graphics. In: Alexandrov, V.N., van Albada, G.D., Sloot, P.M.A., Dongarra, J. (eds.) ICCS 2006. LNCS, vol. 3992, pp. 334–341. Springer, Heidelberg (2006)
Level-of-Detail Triangle Strips for Deforming Meshes Francisco Ramos1 , Miguel Chover1, Jindra Parus2, and Ivana Kolingerova2 1
2
Universitat Jaume I, Castellon, Spain {Francisco.Ramos,chover}@uji.es University of West Bohemia, Pilsen, Czech Republic {jparus,kolinger}@kiv.zcu.cz
Abstract. Applications such as video games or movies often contain deforming meshes. The most-commonly used representation of these types of meshes consists in dense polygonal models. Such a large amount of geometry can be efficiently managed by applying level-of-detail techniques and specific solutions have been developed in this field. However, these solutions do not offer a high performance in real-time applications. We thus introduce a multiresolution scheme for deforming meshes. It enables us to obtain different approximations over all the frames of an animation. Moreover, we provide an efficient connectivity coding by means of triangle strips as well as a flexible framework adapted to the GPU pipeline. Our approach enables real-time performance and, at the same time, provides accurate approximations. Keywords: Multiresolution, Level of Detail, GPU, triangle strips, deforming meshes.
1
Introduction
Nowadays, deforming surfaces are frequently used in fields such as games, movies and simulation applications. Due to their availability, simplicity and ease of use, these surfaces are usually represented by polygonal meshes. A typical approach to represent these kind of meshes is to represent a different mesh connectivity for every frame of an animation. However, this would require a high storage cost and the time to process the animation sequence would be significantly higher than in the case of using a single mesh connectivity for all frames. Even so, these meshes often include far more geometry than is actually necessary for rendering purposes. Many methods for polygonal mesh simplification have been developed [1,2,3]. However, these methods are not applicable to highly deformed meshes. A single simplification sequence for all frames can also generate unexpected results in those meshes. Hence, multiresolution techniques for static meshes are not directly applicable to deforming meshes and so we need to adapt these techniques to this context. Therefore, our goal consists in creating a multiresolution model for deforming meshes. We specifically design a solution for morphing meshes (see Fig. 1), M. Bubak et al. (Eds.): ICCS 2008, Part II, LNCS 5102, pp. 86–95, 2008. c Springer-Verlag Berlin Heidelberg 2008
Level-of-Detail Triangle Strips for Deforming Meshes
87
Fig. 1. A deforming mesh: Elephant to horse morph sequence
although it could be extended to any kind of deforming mesh. Our approach includes the following contributions: – Implicit connectivity primitives: we benefit from using optimized rendering primitives, such as triangle strips. If compared to the triangle primitive, triangle strips lead us to an important reduction in the rendering and storage costs. – A single mesh connectivity: for all the frames we employ the same connectivity information, that is, the same triangle strips. It generally requires less spatial and temporal cost than using a different mesh for every frame. – Real-time performance: meshes are stored, processed and rendered entirely by the GPU. In this way, we obtain greater frame-per-second rates. – Accurate approximations: we provide high quality approximations in every frame of an animation.
2 2.1
Related Work Deforming Meshes: Morphing
A solution to approximate deforming meshes is to employ mesh morphing [4,5]. Morphing techniques aim at transforming a given source shape into a target shape, and they involve computations on the geometry as well as the connectivity of meshes. In general, two meshes M0 = (T0 , V0 ) and M1 = (T1 , V1 ) are given, where T0 and T1 represent the connectivity (usually in triangles) and V0 and V1 the geometric positions of the vertices in R3 . The goal is to generate a family of meshes M (t) = (T, V (t)), t ∈ [0, 1], so that the shape represented by the new connectivity T together with the geometries V (0) and V (1) is identical to the original shapes. The generation of this family of shapes is typically done in three subsequent steps: finding a correspondence between the meshes, generating a new and consistent mesh connectivity T together with two geometric positions V (0), V (1) for each vertex so that the shapes of the original meshes can be reproduced and finally, creating paths V (t), t ∈ [0, 1], for the vertices. The traditional approach to generate T is to create a supermesh [5] of the meshes T0 and T1 , which is usually more complex than the input meshes. After
88
F. Ramos et al.
the computation of one mesh connectivity T and two mesh geometries represented by vertex coordinates V (0) and V (1), we must create the paths. The most-used technique to create them is the linear interpolation [6], see Fig. 1. Given a transition parameter t the coordinates of an interpolated shape are computed by: V (t) = (1 − t)V (0) + tV (1) (1) As commented before, connectivity information generated by morphing techniques usually gives rise to more dense and complex information than necessary for rendering purposes. In this context, we can make use of level-of-detail solutions to approximate such meshes and thus remove unnecessary geometry when required. We can also represent the connectivity of the mesh in triangle strips, which reduces in a factor of three the number of vertices to be processed [7]. 2.2
Multiresolution
A wide range of papers about multiresolution or level of detail [8,9,10,11,12,13] that benefit from using hardware optimized rendering primitives have recently appeared. However, as they are built from a fixed and static mesh, they usually produce low quality approximations when applied to a mesh with extreme deformations. Some methods also provide multiresolution models for deforming meshes [14,15,16], but they are based on the triangle primitive and their adaptation to the GPU pipeline is potentially difficult or does not exploit it maximally. Another important work introduced by Kircher et al. [17] is a triangle-based solution as well. This approach obtains accurate approximations over all levels of detail. However, temporal cost to update its simplification hierarchy is considerable, and GPU-adaptation is not straightforward. Recent graphics hardware capabilities have led to great improvements in rendering. Mesh morphing techniques are also favored when they are employed directly in the GPU. With the current architecture of GPUs, it is possible to store the whole geometry in the memory of the GPU and to modify the vertex positions in real time to morph a supermesh. This would greatly increase performance. In order to obtain all the intermediate meshes, we can take advantage of the GPU pipeline to interpolate vertex positions by means of a vertex shader. A combination of multiresolution techniques and GPU processing for deforming meshes can lead us to an approach that offers great improvements in rendering, providing, at the same time, high quality approximations.
3
Technical Background
Starting from two arbitrary polygonal meshes, M0 = (T0 , V0 ) and M1 = (T1 , V1 ), where V0 and V1 are sets of vertices and T0 and T1 are the connectivity to represent these meshes, our approach is built upon two algorithms: we first obtain a supermesh (Morphing Builder) and later we build the multiresolution scheme (Lod Builder). The general construction process is shown in Fig. 2.
Level-of-Detail Triangle Strips for Deforming Meshes
89
Fig. 2. General construction process data flow diagram
3.1
Generating Morphing Sequences
As commented before, linear interpolation is a well-known technique to create paths for vertices in morphing solutions. Vertex paths defined by this kind of technique are suitable to be implemented in recent GPUs offering considerable performance when generating intermediate meshes, M (t). Thus, we first generate a family of meshes M (t) = (T, V (t)), t ∈ [0, 1] by applying the method proposed by Parus [5]. As paths are linearly interpolated, we only need the geometries V (0) and V (1) and the connectivity information T , to reproduce the intermediate meshes M (t) by applying the equation 1. The FaceToFace morphing sequence shown in Fig. 6 was generated by using this method [5]. 3.2
Construction of the Multiresolution Scheme
A strip-based multiresolution scheme for polygonal models is preferred in this context as we obtain improvements both in rendering and in spatial cost. Thus, we perform an adaptation of the LodStrips multiresolution model [13] to deforming meshes. This work represents a mesh as a set of multiresolution strips. Let M the original polygonal surface and M r its multiresolution representation: M r = (V, S), where V is the set of all the vertices and S the triangle strips used to represent any resolution or level of detail. S can also be expressed as a tuple (S0 , C), where S0 consists of the set of triangle strips at the lowest level of detail and C is the set of operations required to extract the approximations. Every element in C contains the set of changes to be applied in the multiresolution strips so that they represent the required level of detail. Thus, the process to construct the multiresolution scheme performs two fundamental tasks. On the one hand, it generates the triangle strips to represent the connectivity by means of these primitives, S, and, on the other hand, it generates the simplification sequence which allows us to recover the different levels of detail, C. We generate the simplification sequence for each frame that we will consider in the animation. This task is performed by modifying the t factor in the supermesh. The number of frames to be taken into account is called |r|. The LOD builder subprocess first computes S, that is, it converts the supermesh into triangle strips. Later, it transforms the supermesh thus obtained into the subsequent intermediate meshes that we will use in the multiresolution scheme. We thus
90
F. Ramos et al.
store the sequence of modifications required into the triangle strips for each considered frame. After the general construction process has finished, we obtain the sets {V (0), V (1), S 0 , C }, where V (0) and V (1) comes from the Morphing builder, S 0 is the supermesh in triangle strips at the lowest level of detail, and C contains the sequences of simplification operations that enable us to change the resolution of the supermesh for each frame.
4
Real-Time Representation
Once construction has finished, we must build a level-of-detail representation with morphing during run-time. According to the requirements of the applications, it involves the extraction of a level of detail at a given frame. In Fig. 3, we show the main functional areas of the pipeline used in our approach. The underlying method to extract approximations of the models is based on the LodStrips work [13]. Among other advantages already commented, this model offers a low temporal cost when extracting any level of detail for stripbased meshes. We take advantage of this feature to perform fast updatings when traversing a supermesh from frame to frame in any level of detail.
Fig. 3. Multiresolution morphing pipeline using the current technology
Thereby, according to the frame and level of detail required by applications, the level-of-detail extraction algorithm is responsible for recovering the appropriate approximation in the triangle strips by means of the previously computed simplification sequence. In Fig. 3, we show the general operation of this algorithm. It reads the simplification sequence of the current frame from the data
Level-of-Detail Triangle Strips for Deforming Meshes
91
structure Changes, and it modifies the triangle strips located in the GPU so that they always have the geometry corresponding to the level of detail used at the current time. A more detailed algorithm is shown in Fig. 4. After extraction, vertices must also be transformed according to the current frame in such a way that the deforming mesh is correctly rendered. When an application uses the GPU to compute the interpolation operations, the CPU can spend time improving its performance rather than continuously blending frames. Thus, by using the processing ability of the GPU, the CPU takes over the task of frame blending. Therefore, after extracting the required approximation, we directly compute the linear interpolations between V (0) and V (1) in the GPU by means of a vertex shader. Function ExtractLODFromFrame (Frame,LOD) if Frame!=CurrentFrame then CurrentFrame=Frame; CurrentChanges=Changes[CurrentFrame]; ExtractLevelOfDetail(LOD); else if LOD!=CurrentLOD then ExtractLevelOfDetail(LOD); end if end Function Fig. 4. Extraction algorithm
Regarding the GPU pipeline, the first stage is the Input Assembler. The purpose of this stage is to read primitive data, in our case triangle strips, from the user-filled buffers and assemble the data into primitives that will be used by the other pipeline stages. As shown in the pipeline-block diagram, once the Input Assembler stage reads data from memory and assembles the data into primitives, the data is output to the Vertex Shader stage. This stage processes vertices from the Input Assembler, performing per-vertex morphing operations. Vertex shaders always operate on a single input vertex and produce a single output vertex. Once every vertex has been transformed and morphed, the Primitive Assembly stage provides the assembled triangle strips to the next stage.
5
Results
In the previous section, we described the sets required to represent our approach: V (0), V (1), S 0 and C. According to the multiresolution morphing pipeline that we propose in Fig. 3, our sets are implemented as follows: V (0), V (1) and S 0 are located in the GPU, whereas C is stored in the CPU. In particular, V (0) and V (1) are stored as vertex array buffers and S 0 as an element array buffer, which offers better performance than creating as many buffers as there are triangle strips. It is important to notice that we represent the geometry to be rendered by means of the data structures in the GPU, where the morphing process also takes
92
F. Ramos et al.
place. On the other hand, the simplification sequence for every frame is stored in the CPU. These data structures are efficiently managed in runtime in order to obtain different approximations of a model over all the frames of an animation. Tests and experiments were carried out with a Dell Precision PWS760 Intel Xeon 3.6 Ghz with 512 Megabytes of RAM, the graphics card was an NVidia GeForce 7800 GTX 512. Implementation was performed in C++, OpenGL as the supporting graphics library and Cg as the vertex shader programming language. The morphing models taken as a reference are shown in Fig. 6 and Fig. 7. The high quality of the approximations, some of which are reduced (in terms of number of vertices) by more than a 90%, can be seen. 5.1
Spatial Cost
Spatial costs from the FaceToFace and HorseToMan morphing models are shown in Table 1. For each model, we specify the number of vertices and triangle strips that compose them (strips generated by means of the STRIPE algorithm [7]), the number of approximations or levels of detail available, the number of frames generated and, finally, the spatial cost per frame in Kilobytes. It is divided into cost in the GPU (vertices and triangle strips) and cost in the CPU (simplification sequence). Finally, in the total column, we show the cost per frame, calculated as the total storage cost divided by the number of frames. As expected, the cost of storing the simplification sequence of every frame is the most important part of the spatial cost. Table 1. Spatial cost Cost/Frame Model #Verts #Strips #LODs #Frames GPU CPU Total FaceToFace 10,520 620 9,467 25 14.2 KB. 472.1 KB. 486.3 KB. HorseToMan 17,489 890 15,738 26 22.4 KB. 848.3 KB. 870.7 KB.
5.2
Temporal Cost
Results shown in this section were obtained under the conditions mentioned above. Levels of detail were in the interval [0, 1], zero being the highest LOD and one the lowest. Geometry was rendered by using the glMultiDrawElements OpenGL extension, which only sends the minimum amount of information that enables the GPU to correctly interpret data contained in its buffers. With glMultiDrawElements we only need one call per frame to render the whole geometry. In Fig. 5a, we show the level-of-detail extracting cost per frame of the FaceToFace morphing sequence. The per-frame time to extract the required level-ofdetail ranges between 6% and 1.4% of the frame time. If we consider the lowest level of detail as being the input mesh reduced by 90% (see LOD 0.9 in Fig. 5a), we obtain times around 6% of the frame time, which offers us better perfomance than other related works such as [17], which employs far more time in changing and applying the simplification sequence.
Level-of-Detail Triangle Strips for Deforming Meshes
93
(a) Level-of-detail extraction cost per (b) Frame-per-second rates by performing frame at a constant rate of 24 fps. one extraction every 24 frames. Fig. 5. Temporal cost. Results obtained by using the FaceToFace morphing model.
Fig. 6. Multiresolution morphing sequence for the FaceToFace model. Rows mean level of detail, 10,522 (original mesh), 3,000 and 720 vertices, respectively, and columns morphing adaptation, aproximations were taken with t=0.0, 0.2, 0.4, 0.6, 0.8 and 1.0, respectively.
We performed another test by extracting one approximation every 24 frames and, at the same time, we progressively changed the level of detail. This was carried out to simulate an animation which is switching its LOD as it is further from the viewer. In Fig. 5b, we show the results of this test. As expected, our approach is able to extract and render different approximations over all frames of an animation at considerable frame-per-second rates.
94
F. Ramos et al.
Fig. 7. Multiresolution morphing sequence for the HorseToMan model. Rows mean level of detail, 17,489 (original mesh), 5,000 and 1,000 vertices, respectively, and columns morphing adaptation, aproximations were taken with t=0.0, 0.2, 0.4, 0.6, 0.8 and 1.0, respectively.
6
Conclusions
We have introduced a multiresolution scheme suitable for deforming meshes such as those generated by means of morphing techniques. A solution for morphing sequences was specially designed, although it can be adapted to any kind of deformed mesh by storing the vertex positions of every frame within the animation. We also share the same topology storing the whole geometry in the GPU, thus saving bandwidth in the typical CPU-GPU bound bottleneck. Morphing is also computed in the GPU by exploiting its parallelism. We thus obtain real-time performance at high frame-per-second rates. At the same time, we offer high quality approximations in every frame of an animation. Acknowledgments. This work has been supported by the Spanish Ministry of Science and Technology (Contiene Project: TIN2007-68066-C04-02) and Bancaja (Geometria Inteligente project: P1 1B2007-56).
References 1. DeHaemer, M., Zyda, J.: Simplification of objects rendered by polygonal approximations. Computer and Graphics 2(15), 175–184 (1991) 2. Cignoni, P., Montani, C., Scopigno, R.: A comparison of mesh simplification methods. Computer and Graphics 1(22), 37–54 (1998)
Level-of-Detail Triangle Strips for Deforming Meshes
95
3. Luebke, D.P.: A developer’s survey of polygonal simplification algorithms. IEEE Computer Graphics and Applications 3(24), 24–35 (2001) 4. Aaron, L., Dobkin, D., Sweldens, W., Schroder, P.: Multiresolution mesh morphing. In: SIGGRAPH, pp. 343–350 (1999) 5. Parus, J.: Morphing of meshes. Technical report, DCSE/TR-2005-02, University of West Bohemia (2005) 6. Kanai, T., Suzuki, H., Kimura, F.: Metamorphosis of arbitrary triangular meshes. IEEE Computer Graphics and Applications 20, 62–75 (2000) 7. Evans, F., Skiena, S., Varshney, A.: Optimizing triangle srips for fast rendering. In: IEEE Visualization, pp. 319–326 (1996) 8. El-Sana, J., Azanli, E., Varshney, A.: Skip strips: Maintaining triangle strips for view-dependent rendering. In: Visualization, pp. 131–137 (1999) 9. Velho, L., Figueredo, L.H., Gomes, J.: Hierachical generalized triangle strips. The Visual Computer 15(1), 21–35 (1999) 10. Stewart, J.: Tunneling for triangle strips in continuous level-of-detail meshes. In: Graphics Interface, pp. 91–100 (2001) 11. Shafae, M., Pajarola, R.: Dstrips: Dynamic triangle strips for real-time mesh simplification and rendering. In: Pacific Graphics Conference, pp. 271–280 (2003) 12. Belmonte, O., Remolar, I., Ribelles, J., Chover, M., Fernandez, M.: Efficient use connectivity information between triangles in a mesh for real-time rendering. Computer Graphics and Geometric Modelling 20(8), 1263–1273 (2004) 13. Ramos, F., Chover, M.: Lodstrips: Level of detall strips. In: Bubak, M., van Albada, G.D., Sloot, P.M.A., Dongarra, J. (eds.) ICCS 2004. LNCS, vol. 3039, pp. 107–114. Springer, Heidelberg (2004) 14. Mohr, A., Gleicher, M.: Deformation sensitive decimation. In: Technical Report (2003) 15. Shamir, A., Pascucci, V.: Temporal and spatial levels of detail for dynamic meshes. In: Symposium on Virtual Reality Software and Technology, pp. 77–84 (2000) 16. Decoro, C., Rusinkiewicz, S.: Pose-independent simplification of articulated meshes. In: Symposium on Interactive 3D Graphics (2005) 17. Kircher, S., Garland, M.: Progressive multiresolution meshes for deforming surfaces. In: EUROGRAPHICS, pp. 191–200 (2005)
Triangular B´ ezier Approximations to Constant Mean Curvature Surfaces A. Arnal1 , A. Lluch1 , and J. Monterde2 1
2
Dep. de Matem` atiques, Universitat Jaume I Castell´ o, Spain
[email protected],
[email protected] Dep. de Geometria i Topologia, Universitat de Val`encia, Burjassot (Val`encia), Spain
[email protected]
Abstract. We give a method to generate polynomial approximations to constant mean curvature surfaces with prescribed boundary. We address this problem by finding triangular B´ezier extremals of the CMCfunctional among all polynomial surfaces with a prescribed boundary. Moreover, we analyze the C 1 problem, we give a procedure to obtain solutions once the tangent planes for the boundary curves are also given.
1
Introduction
Surfaces with constant mean curvature (CMC-surfaces) are the mathematical abstraction of physical soap films and soap bubbles, and can be seen as the critical points of area for those variations that left the enclosed volume invariable. The study of these surfaces is actually relevant since there is a wide range of practical applications involving surface curvatures, ranging from rendering problems to real settings in automotive industry as measurement and calibration problems, for instance. In general, the characterization of “area minimizing under volume constraint” is no longer true from a global point of view, since they could have self-intersections and extend to infinity. But locally, every small neighborhood of a point is still area minimizing while fixing the volume which is enclosed by the cone defined by the neighborhood’s boundary and the origin. An exhaustive discussion of the existence of surfaces of prescribed constant mean curvature spanning a Jordan curve in R3 can be found in [2]. Given H ∈ R the functional DH is defined as follows → → → DH (− x ) = D(− x ) + 2HV (− x) 1 2H → → → → → = − x u 2 + − x v 2 dudv + <− xu ∧− x v, − x > dudv, 2 T 3 T where <, > and ∧ denote the scalar and the cross product respectively. If an isothermal patch is an extremal of the functional DH , then it is a CMC→ surface. The “volume” term, V (− x ), measures the algebraic volume enclosed in M. Bubak et al. (Eds.): ICCS 2008, Part II, LNCS 5102, pp. 96–105, 2008. c Springer-Verlag Berlin Heidelberg 2008
Triangular B´ezier Approximations to Constant Mean Curvature Surfaces
97
→ the cone segment consisting of all lines joining points − x (u, v) on the surface → − with the origin. The first term, D( x ), is the Dirichlet functional. We will give a method to generate B´ezier extremals of DH , for prescribed boundary curves and constant mean curvature. Our method lets to obtain approximations to CMC-surfaces, since we have considered the problem of minimizing this functional restricted to the space of polynomials. Moreover, we will consider the C 1 problem, that is, we give a way to generate a polynomial approximation to CMC-surface once the boundary curves and the tangent planes along them have been prescribed.
2
Existence of Triangular B´ ezier Surfaces of Prescribed Constant Mean Curvature
Here, we are not working with parametrizations, we are working instead with triangular control nets. So, our aim is to find the minimum of the real function → → x P ), − x P being the triangular B´ezier patch associated to the control P → DH (− net P. The Dirichlet functional, D, has a minimum in the B´ezier case due to the following facts: 3(n−1)(n−2) 2 , First, it can be considered as a continuous real function defined on R 3 interior control points which belong to R . since there are (n−1)(n−2) 2 Second, the functional is bounded from below. Third, the infima is attained: when looking for a minimum, we can restrict this function to a suitable compact subset. → On the other hand, the function assigning the value V (− x P ) to each control net, P, with fixed boundary control points, has no global minimum. If that minimum existed, since spatial translations do not affect the curvature of the surface, we could suppose that the origin is located far enough away from the surface so that the control net is enclosed in a half-space passing through the origin. Let us move an interior control point, PI0 , toward the origin. Then, a well→ known property of B´ezier surfaces states that all the points of − x (u, v) change in n a parallel direction with intensity BI0 (u, v) . Then, since the new cone segment is totally included in the initial one, its volume decreases. → As we said, the function, P → D(− x P ), for control nets with fixed boundary → always has a minimum and, as we have just seen, the function P → V (− x P ), never has a minimum. Therefore, by using the constant H to balance both functions → x P ), will have a minimum only for we can say that the function, P → DH (− H ∈ [a, −a] for some constant a ∈ R. It should be noted that when H = 0, DH is reduced to the Dirichlet functional, D, and then there is a minimum, whereas when H is too big, the main term in DH is V , and therefore the minimum does not exist. The value of a depends on the boundary control points and the symmetry of the interval, [a, −a], is a consequence of the fact that reversing the orientation of a surface means a change in the sign of the mean curvature. A detailed explanation
98
A. Arnal, A. Lluch, and J. Monterde
about the existence conditions of CMC-surfaces suited to a boundary and this dependency can be found in [2].
3
The CMC-Functional B´ ezier Form
The following proposition gives a characterization of an isothermal CMC-surface. − Proposition 1. [2] An isothermal patch, → x , is a CMC-surface if and only if → → → Δ− x = 2H − xu∧− x v.
(1)
Expression (1) is the Euler-Lagrange equation of the functional DH . Moreover, an isothermal patch satisfies the PDE in (1) if and only if it is an extremal of DH . In [1], it was proved that an extremal of the Dirichlet functional among all B´ezier triangular surfaces with a prescribed boundary always exists and it is the solution of a linear system. Now we find two qualitative differences, the existence of the extremal of DH can only be ensured with certainty when |H| ≤ a, for a certain constant, a, depending on the boundary configuration, and they are computed as solutions of a quadratic system. Moreover, since the Euler-Lagrange equation of the functional DH , in Equation (1), is not linear we cannot determine a B´ezier solution as a solution of a linear system of equations in terms of the control points. Here we will give an expression of the CMC-functional in terms of the control points of a triangular B´ezier surface, which implies that the restriction of the functional to the B´ezier case can be seen as a function instead of as a functional. The following two results will simplify the way to obtain the formula in terms of control points of the functional DH . → Proposition 2. The Dirichlet functional, D(− x ), of a triangular B´ezier surface, → − x , associated to the control net, P = {PI }|I|=n , can be expressed in terms of the control points, PI = (x1I , x2I , x3I ), with |I| = |{I 1 , I 2 , I 3 }| = n by the formula 3 1 − → D( x ) = 2 a=1
CI0 I1 xaI0 xaI1
(2)
|I0 |=n |I1 |=n
n n
where
CI0 I1 = I0 2nI1 (a1 + a2 + 2a3 − b13 − b23 )
(3)
I0 +I1
and ar =
0 I0r I r (I0r +I r )(I0r +I r −1)
I r = 0, Ir > 0
brs =
(I0r
I0r I s + I0s I r . + I r ) (I0s + I s )
(4)
Proof. The Dirichlet functional is a second-order functional, therefore we compute its second derivative in order to obtain the coefficients CI0 I1 .
Triangular B´ezier Approximations to Constant Mean Curvature Surfaces
99
The first derivative with respect to the coordinates of an interior control point PI0 = x1I0 , x2I0 , x3I0 where I0 = (I01 , I02 , I03 ) for any a ∈ {1, 2, 3}, and any |I0 | = n, with I01 , I02 , I03 = 0, is → → ∂− x→ ∂− x ∂D(− x) u − v − → = (< , x→ u > +< a a a , xv >) du dv, ∂xI0 ∂x ∂x T I0 I0 and the second derivative → n n ∂ 2 D(− x) = BI0 u BI1 u + BIn0 v BIn1 v < ea , ea > dudv ∂xaI0 ∂xaI1 T n n 2n(2n − 1) I0 I1 n2 2n (a1 + a2 + 2a3 − b13 − b23 ), = 2n(2n − 1) n2 I+I 0
where we took into account the formula for the product of the Bernstein polynomials and the value of its integral. Therefore n n CI0 I1 = I0 2nI1 (a1 + a2 + 2a3 − b13 − b23 ), I+I0
where a1 , a2 , a3 , b13 , b23 were defined in Equation (4).
Now, we will work the volume term of the CMC-functional. → Proposition 3. Let − x be the triangular B´ezier surface associated to the control → x ), can be expressed in terms of the net, P = {PI }|I|=n , then the volume, V (− 1 2 3 control points, PI = (xI , xI , xI ), with |I| = n, by the formula → V (− x)=
CI0 I1 I2 x1I0 x2I1 x3I2
|I0 |=|I1 |=|I2 |=n
where
n n n CI0 I1 I2 = I0
I1 I2 3n I0 +I1 +I2
(dI120 I1 I2 + dI230 I1 I2 + dI130 I1 I2 )
(5)
with dIJK = rs
IrJs − JrIs . (I r + J r + K r )(I s + J s + K s )
(6)
→ Proof. The term V (− x ), is a cubical polynomial of the control points, so in order to compute the coefficients CI0 I1 I2 we will compute its third derivative. The derivative with respect to a first coordinate x1I0 of an arbitrary interior point PI0 = x1I0 , x2I0 , x3I0 , where |I0 | = n and I01 , I02 , I03 = 0, is given by
100
A. Arnal, A. Lluch, and J. Monterde
→ ∂V (− x) 1 = ∂x1I0 3 = T
T
→ → → → ( < BIn0 u e1 ∧ − x v, − x >+<− x u ∧ BIn0 v e1 , − x > → → x v , BIn0 e1 > ) du dv +<− xu ∧−
→ → → → → → < BIn0 e1 ∧ − x v, − x >u − < BIn0 e1 ∧ − x vu , − x >+<− x u ∧ BIn0 e1 , − x >v
→ → → → −<− x uv ∧ BIn0 e1 , − x >+<− xu ∧− x v , BIn0 e1 > du dv.
After computing the derivative with respect to an arbitrary first coordinate, we applied the integration by parts formula. Now, bearing in mind that → → → → < BIn0 e1 ∧ − x v, − x >u = <− x u ∧ BIn0 e1 , − x >v = 0, T
T
− v, v) = = = BIn0 (u, 1 − u) = 0 for |I0 | = n with 0, and the properties of the cross and the scalar triple product, we obtain that → ∂V (− x) 1 → → = <− xu ∧− x v , BIn0 e1 > . (7) ∂x1I0 3 T since BIn0 (1 I01 , I02 , I03 =
BIn0 (0, v)
BIn0 (u, 0)
Now we must compute the derivative with respect to a second coordinate, x2I1 , of an arbitrary interior point, such that, as before, |I1 | = n with I11 , I12 , I13 = 0. Using the same process as before we have: → ∂ 2 V (− x) 1 = 1 ∂xI0 ∂x2I1 3
T
→ → < (BIn1 )u e2 ∧ − x v , BIn0 e1 > + < − x u ∧ (BIn1 )v e2 , BIn0 e1 > dudv
= T
→ (BIn0 )u (BIn1 )v − (BIn0 )v (BIn1 )u < e1 ∧ e2 , − x > dudv.
Finally we compute the derivative with respect to an arbitrary third coordinate x3I2 with |I2 | = n and such that I21 , I22 , I23 = 0, that is, → x) ∂ 2 V (− Cx1I x2I x3I = = ((BIn0 )u (BIn1 )v − (BIn0 )v (BIn1 )u ) BIn2 dudv 0 1 2 ∂x1I0 ∂x2I1 ∂x3I2 T n n n = I0
I1 I2 3n I0 +I1 +I2
(dI120 I1 I2 + dI230 I1 I2 + dI130 I1 I2 )
where we have achieved the last formula after computing the integral of the Bernstein polynomials and performing some simplifications like the following: n−1 n−1 n I1 −e2 I2 n−1 n−1 n I0 −e1 3n−2 BI3n−2 BI0 −e1 BI1 −e2 BI2 dudv = dudv 0 +I1 +I2 −e1 −e2 T
T
I +I +I −e −e
n n0 1n 2 1 2 3n(3n − 1) I I I = 0 3n1 2 2 I0 +I1 +I2
n
(I01
+
I11
I01 I12 . + I21 )(I02 + I12 + I22 )
Triangular B´ezier Approximations to Constant Mean Curvature Surfaces
101
Lemma 1. The coefficients CIJK verify the following symmetry relations CIJK = −CJIK = CJKI . Proof. The symmetry of the coefficients C’s is a direct consequence of the sym= −dJIK metry of d’s: dIJK rs rs , which is immediate from its definition in Proposition 3, since: JrIs − IrJs . = r dJIK rs r (I + J + K r )(I s + J s + K s ) → In the following proposition we give a formula for the CMC-functional, DH (− x) → − in terms of the control net, P = {PI }|I|=n , of the B´ezier triangular surface, x . → Proposition 4. Let − x be the triangular B´ezier surface associated to the control net, P = {PI }|I|=n , where PI = (x1I , x2I , x3I ) with |I| = |{I 1 , I 2 , I 3 }| = n. The CMC-functional, DH , can be expressed by the formula 3 1 → DH (− x)= 2 a=1
CI0 I1 xaI0 xaI1 + 2H
|I0 |=n |I1 |=n
CI0 I1 I2 x1I0 x2I1 x3I2
|I0 |=|I1 |=|I2 |=n
n n
where
CI0 I1 = I0 2nI1 (a1 + a2 + 2a3 − b13 − b23 ) I0 +I1
with ar and brs defined in Equation (4) and n n n CI0 I1 I2 = I0
I1 I2 3n I0 +I1 +I2
(dI120 I1 I2 + dI230 I1 I2 + dI130 I1 I2 )
defined in Equation (6). with dIJK rs
4
B´ ezier Approximations to CMC-Surfaces
We have just seen in Proposition 4 that the CMC-functional, is a function of the control points, so let us now compute its gradient with respect to the coordinates of an arbitrary control point. This will let us to give a characterization of the control net of the triangular B´ezier extremals of DH , which are B´ezier approximations to CMC-surfaces. The gradient of the first addend, corresponding to the Dirichlet functional, with respect to the coordinates of a control point PI0 = x1I0 , x2I0 , x3I0 ⎞ ⎛ − → ∂D( x ) ⎝ = CI0 J x1J CI0 J x2J , CI0 J x3J ⎠ = CI0 J PJ ∂PI0 |J|=n
|J|=n
|J|=n
|J|=n
(8)
102
A. Arnal, A. Lluch, and J. Monterde
→ So, let us consider the volume expression V (− x ) = |I|,|J|,|K|=n CIJK x1I x2J x3K , and compute its gradient with respect to the coordinates of a control point PI0 . → ∂V (− x) = ∂PI0 =
|J|,|K|=n
|J|,|K|=n
1 2
=
1 = 2
CI0 JK (x2J x3K , −x1J x3K , x1J x2K ) CI0 JK − CI0 KJ 2 3 (xJ xK , −x1J x3K , x1J x2K ) 2
(9)
CI0 JK (x2J x3K − x2K x3J , x1K x3J − x1J x3K , x1J x2K − x1K x2J )
|J|,|K|=n
(10) CI0 JK PJ ∧ PK .
|J|,|K|=n
Now we can characterize the triangular control net of an extremal of the CMCfunctional among all triangular B´ezier patches constrained by a given boundary. Proposition 5. A triangular control net, P = {PI }|I|=n , is an extremal of the CMC-functional, DH , among all triangular control nets with a prescribed boundary if and only if: 0=
|J|=n
CI0 J PJ + H
CI0 JK PJ ∧ PK
(11)
|J|,|K|=n
for all |I0 = (I01 , I02 , I03 )| = n with I01 , I02 , I03 = 0, where the coefficients CI0 J and CI0 JK are defined in Equation (3) and Equation (5) respectively. The last result lets us to obtain B´ezier approximations to CMC-surfaces since we compute solutions to a restricted problem, that is, we find extremals of the functional DH among all polynomial patches with prescribed border. The following proposition characterizes the extremals of this restricted prob→ lem: − x is an extremal of the functional DH among all triangular B´ezier patches with a prescribed boundary if and only if a weak version of the condition in Equation (1) is fulfilled. → Proposition 6. A triangular B´ezier patch − x is an extremal of the CMC-functional, DH , among all patches with a prescribed boundary if and only if: 0= T
→ → → (Δ− x − 2H − xu∧− x v ) BIn0 dudv
with I01 , I02 , I03 = 0.
for all
|I0 = (I01 , I02 , I03 )| = n
(12)
Triangular B´ezier Approximations to Constant Mean Curvature Surfaces
103
Proof. We simply compute the gradient of the CMC-functional with respect to an arbitrary control point. The boundary curves of our example in Fig. 1 describe an approximation to a circle. Therefore we obtain approximations to spheres. In Fig. 1 top, we have asked the interior control points to fulfill a symmetry condition: P112 =
a cos
4π 4π , a sin ,b 3 3
P121 =
a cos
2π 2π , a sin ,b 3 3
P211 = (a, 0, b)
and we show three different approximations to CMC-surfaces. The three surfaces at the bottom are obtained as a solution of the system of quadratic equations described in Equation (11). Here we don’t ask for any kind of symmetry.
Fig. 1. These surfaces are approximations to CMC-surfaces with curvatures H = −1.5, H = −1 and H = −0.5 respectively
In Fig. 2 we present two more examples. The boundary curves in the first are built in such a way that any associated patch would be isothermal at the corner points and in the bottom surfaces in Fig. 2 the boundaries are approximations to three circular arcs, and therefore our results look like pieces of a sphere. The resulting plots are pleasant and moreover they can be continuously deformed by the parameter H, thus allowing the designer to choose of the shape which best fits the objective. We maintain the good shapes we got with the Dirichlet results in [1], but now the choice of the curvature gives the designer another degree of freedom, although the surfaces are obtained as a solution of a quadratic system of the control points.
104
A. Arnal, A. Lluch, and J. Monterde
Fig. 2. These surfaces are approximations to CMC-surfaces with curvatures H = −1, H = 0 and H = 1 at the top and H = −2, H = −1.5 and H = −1 respectively at the bottom
5
The C 1 Problem
In this section we will consider the prescription of not only the boundary but also the tangent planes along the boundary curves, the C 1 problem. Now, the boundary and the next to the boundary control points are fixed, but again the extremals of the CMC-functional, where the other interior control points are considered as variables, can be computed. Here we show an example. We prescribe the border control points along a planar equilateral triangle and three more lines of control points as it is shown in Fig. 3.
Fig. 3. The border control points and their neighboring lines of control points are prescribed
The following figures show approximations to CMC-surfaces obtained as a solution of the quadratic system of the control points in Equation (11), but now for all |I0 = (I01 , I02 , I03 )| = n with I01 , I02 , I03 > 1. The free points are the interior control points outside the boundary and its next line of control points.
Triangular B´ezier Approximations to Constant Mean Curvature Surfaces
105
Fig. 4. These surfaces are approximations to CMC-surfaces with curvatures H = −2, H = −1.5 and H = −1 respectively
6
Conclusions
An isothermal patch has constant mean curvature H if and only if it is an extremal of the functional → → → DH (− x ) = D(− x ) + 2HV (− x ). We have generated approximations to CMC-surfaces, since we have considered the problem of minimizing this functional restricted to the space of polynomials. We have obtained an expression of DH in terms of the control points of a triangular B´ezier surface. After that, we deduced the condition that a triangular control net must fulfill in order to be an extremal of DH among all B´ezier triangles with a prescribed boundary. This characterization of the B´ezier extremals of DH allowed us to compute them as a solution of a quadratic system of the control points. The surfaces that are obtained have regular shapes and have the advantage of allowing prescription of the desired curvature in addition to the boundary. This makes it possible to ensure, for a given boundary, the existence of a family of polynomial approximations to CMC-surfaces with this boundary and curvatures within a particular interval. Therefore, the prescription of the curvature in this method can be seen as another degree of freedom in comparison with the Dirichlet surface generation method in [1]. Finally, in the last section, we consider the C 1 problem, that is, once the boundary curves and the tangent planes along them have been prescribed we give a way to generate a polynomial approximation to CMC-surface associated to this initial information.
References 1. Arnal, A., Lluch, A., Monterde, J.: Triangular B´ezier Surfaces of Minimal Area. In: Kumar, V., Gavrilova, M.L., Tan, C.J.K., L’Ecuyer, P. (eds.) ICCSA 2003. LNCS, vol. 2669, pp. 366–375. Springer, Heidelberg (2003) 2. Struwe, M.: Plateau’s problem and the calculus of variations. Mathematical Notes. Princeton University Press, Princeton (1988)
Procedural Graphics Model and Behavior Generation J.L. Hidalgo, E. Camahort, F. Abad, and M.J. Vicent Dpto. de Sistemas Inform´ aticos y Computaci´ on Universidad Polit´ecnica de Valencia, 46021 Valencia, Spain
Abstract. Today’s virtual worlds challenge the capacity of human creation. Trying to reproduce natural scenes, with large and complex models, involves reproducing their inherent complexity and detail. Procedural generation helps by allowing artists to create and generalize objects for highly detailed scenes. But existing procedural algorithms can not always be applied to existing applications without major changes. We introduce a new system that helps include procedural generation into existing modeling and rendering applications. Due to its design, extensibility and comprehensive interface, our system can handle user’s objects to create and improve applications with procedural generation of content. We demonstrate this and show how our system can generate both models and behaviours for a typical graphics application.
1
Introduction
Many application areas of Computer Graphics require generating automatic content at runtime. TV and movies, console and computer games, simulation and training applications, and massive on-line games also require large numbers of object models and complex simulations. Automatic content generation systems are also useful to create a large number of members of the same class of an object with unique attributes, thus producing more realistic scenes. With the advent of high-definition displays, simulation and game applications also require highly detailed models. In many situations, it is not enough to procedurally generate the geometric models of the actors in the scene. And it is not practical to create their animations by hand, so automatic modeling behavior is another problem to solve. Our goal in this paper is to provide a unified approach to the generation of models for simulation and computer games. To achieve this goal we implement a system that combines procedural modeling with scripting and object-oriented programming. Procedural models may be of many different kinds: fractals, particle systems, grammar-based systems, etc. Ours are based on L-systems, but it can be used to implement all the other models. Our system supports features like parameterized, stochastic, context-sensitive and open L-systems. Moreover, we want our system to be as flexible as possible, and to allow the user to embed it in her own applications. Thus, we provide a method to use our procedural engines in many application domains. Also, our system is able M. Bubak et al. (Eds.): ICCS 2008, Part II, LNCS 5102, pp. 106–115, 2008. c Springer-Verlag Berlin Heidelberg 2008
Procedural Graphics Model and Behavior Generation
107
to combine different types of objects (both system- and user-provided) within a single framework. Geometry generators based on L-systems are usually targeted at specific applications with fixed symbols and tools based on LOGO’s turtle metaphor. They are highly dependable on the rewriting engine, thus preventing grammar improvement, language extensions, and code reuse. These generators can not generate different models for the same application. They require multiple L-systems that are difficult to integrate within the same application framework. To overcome these problems we introduce a procedural model generator that is easily extensible and supports different types of representations and application areas. It stems from a generator based on modular L-systems, L-systems that generate models using a rewriting engine witten in C/C++ and using Lua [1] as scripting language for grammar programming. We show how we can implement procedural, growth, image-based and other types of models using our system. This paper is structured as follows. The next section reviews previous work in modeling and automatic model generation. The following sections present our system implementation and several results obtained with it. We implement three different improvements on L-system: stochastic, context-sensible and open L-systems. Finally, we finish our paper with some conclusions and directions for future work.
2
Background
Procedural generators are typically based on techniques like fractals [2], particle systems [3], and grammar-based systems [4]. One may also find generators of simple primitives, subdivision surfaces, complex geometries [5] and Constructive Solid Geometry. All these generators allow the creation of texture images [6], terrain models, water and rain, hair, and plants and trees, among others. Historically, the most expressive procedural models have been the grammarbased technique called L-systems. It was introduced by Lindenmayer to model cellular interaction [7]. L-systems use a set of symbols, an axiom and a set of rewriting rules. The axiom is rewritten using the rules. Then, an output symbol string is generated and interpreted. The result of the interpretation is a freshly generated model of a tree, a building or any other object. Initially L-systems were used to create plant ecosystems [4]. Subsequently, they have been used for shell texturing [8], virtual urban landscaping [9],[10],[11], and geometry mesh generation [5]. L-systems have also been used for behavior modeling. Early L-systems were later modified to improve their expressiveness. First, they were parameterized, allowing arithmetic and boolean expressions on the parameters during the rewriting process. Later, stochastic L-systems introduced random variables into parameter expressions to support modeling the randomness of natural species [4]. Finally, context-sensitive rules and external feedback were added to L-systems to support interaction among generated objects and
108
J.L. Hidalgo et al.
between objects and their environment [12]. These systems are all based on the turtle metaphor [6]. Recent improvements on L-systems include FL-systems and the L+C language. In the L+C language the symbols are C data structures and the righthand sides of the rules are C functions from user developed libraries [13]. This improves on earlier systems by adding computation and data management to the rewriting process. Alternatively, FL-systems are L-systems that do not use the turtle metaphor [14]. Instead, they interpret the symbols of the derived string as function calls that can generate any geometry type. FL-systems have been used to generate VRML buildings.
3
Procedural Modeling and L-Systems
A general modeling system must support building many objects of many different types like, for example, crowd models made of people and city models made of streets and buildings. People may be represented using the same geometry, but each actual person should have slightly different properties, appearances and behaviors. Modeling such objects and behaviors by hand is impractical due to their complexity and large number of instances. We need systems to generate models automatically. Procedural modeling has been successfuly used to generate multiple instances of a same class of models. Our system can generate procedural models and behaviors of many kinds. It was originally developed to generate geometry using L-systems [15]. We have now extended it to generate image-based, grammar-based, and growth-based models as well as behaviors. In this paper we will show how to implement in our system stochastic and context-sensitive L-systems, as well as systems that can interact with their environment. The system’s interface and programming are based on Lua [1], a scripting language. Lua is used to handle all the higher-level elements of the modeling like: rule definition, user code, plugins, . . . . Additionally, lower-level objects are implemented in C/C++ and bound to Lua elements. These objects are loaded during the initialization of the system. Our system includes the classes used for basic graphics modeling, and the framework to allow the user to provide his own classes. This was designed with reusability in mind: objects, rules and bindings are organized in plugins that may be selectively loaded depending on the application. Object modeling is decoupled from string rewriting and offers a flexibility unavailable in other systems. To generate a procedural model and/or behavior, the user must provide an axiom and a set of rules written in the scripting language. These rules can use both the modeling objects provided by the system as well as custom, userprovided modeling objects. Currently our system provides objects like extruders, metaball generators, 3D line drawers and geometry generators based on Euler operators.
Procedural Graphics Model and Behavior Generation
109
Rewriting and interpretation rules are applied to the axiom and the subsequently derived strings. Internally the process may load dynamic objects, run code to create object instances, call object methods, and access and possibly modify the objects’ and the environment’s states. During the derivation process, any object in the system can use any other object, both system-provided or user-provided. This is why our L-systems are more flexible and more expressive than previous ones. For example, our system supports the same features as FL-systems and the L+C language: we generate geometry without the turtle metaphor, we include a complete and extensible rewriting engine, and we allow rules that include arithmetic and boolean expressions, flow control statements and other imperative language structures. Using a scripting language allows us to perform fast prototyping and avoids the inconvenience derived of the compiling/linking process. Since we use plugins and C/C++ bindings to handle objects that are instances of Object Oriented Programming classes, we offer more expressiveness than the L+C system.
4
Derivation Engine and Programming
We illustrate the features of our approach by describing its basic execution and a few application examples. To create a model or behavior we need to select the supporting classes. These classes can be already available in the system or they have to be written by the user. Then we use plugins to load them into the system, we instantiate the required objects and we create the system’s global state. Finally, the user has to provide the axiom and the rules (in Lua) that will control the derivation of the model. Currently, our system only implements a generic L-system deriving engine. Other engines are planned to be implemented, like genetic algorithms, recursive systems, etc. Our engine takes an L-system made of a set of symbols, a symbol called axiom, and the two sets of rewriting and interpretation rules. Then it alternatively and repeatedly applies rewriting and interpretation rules to the axiom and its derived strings, thus obtaining new derived strings like any other L-system. The difference is what happens during rewriting and interpretation. Our system is different because each time a rule is applied, a set of C/C++ code may be executed. Rewriting rules modify the derivation string without changing the C/C++ objects’ state and the system’s global state. Interpretation rules change the objects’ state without modifying the derivation string. Both types of rules have a left-hand side (LHS) and a right-hand side (RHS). The LHS has the form AB < S > DE where S is the symbol being rewritten and AB and DE are the left and right contexts, respectively. These contexts are optional. To match a rule we compare the rewriting string with the LHS’s symbol and its contexts. If the rule matches we run its RHS’s associated code, a Lua function that computes the result of the rewriting process or does the interpretation.
110
5
J.L. Hidalgo et al.
Generating Models and Behaviors
To illustrate the power of our approach we show how to generate models and behaviors based on three types of improved L-systems. First, we implement stochastic L-systems, a kind of parametric L-system whose parameters may include random variables [4]. Then, we show how our system supports context-sensitive L-Systems, an improvement that allows modeling interaction of an object with itself. Finally, we implement open L-systems, an extension of context-sensitive L-systems that allows modeling objects and their interactions with each other and the environment [12]. 5.1
Stochastic L-Systems
We implement stochastic L-systems by allowing parameters containing random variables. Fig. 1 shows code to generate the set of three buildings in the back of Fig. 3. Symbol City is rewritten as itself with one building less, followed by a translation and a Building symbol. Building is rewritten as a set of symbols that represent the floor, the columns and the roof of a building. The interpretation rules for those symbols generate geometry using a 3D extruder implemented in C/C++. The extruder can create 3D objects by extruding a given 2D shape and a path. obj: