SlideShare a Scribd company logo
1 of 25
L-systemで
木を生やす
やったこと
openglを使い、「L-system」を用いることで、
幾何学模様と木を生成!!
やったこと
openglを使い、「L-system」を用いることで、
幾何学模様と木を生成!!
こんな感じ→
L-sysyemとは
・再帰的な構造を文字列で表現
・文字列をあるルールに従って再帰的に進化
L-sysyemの例
例1: 木の構造
= 枝が3本に分かれる
=枝が3本に分かれる
→ 再帰的!
L-sysyemの例
これを例えば、
初期文字列 = “FA”
ルール : ’A’ = “[&FA]/[&FA]/[&FA]”
F: 進む
[]: 一つのかたまり
/ : 回転 &: 倒す
L-sysyemの例
これを例えば、
初期文字列 = “FA”
ルール : ’A’ = “[&FA]/[&FA]/[&FA]”
F: 進む
[]: 一つのかたまり
/ : 回転 &: 倒す
2世代目の文字列: F [&FA]/[&FA]/[&FA] ←Aから進化
やったこと
この文字列を前から読んでいく
→ 線を一本ずつ描画
F [&FA]/[&FA]/[&FA]
やったこと
この文字列を前から読んでいく
→ 線を一本ずつ描画
・始点, 長さ, 角度がわかれば線が描ける!
→これらの情報を保持、変更していく
F [&FA]/[&FA]/[&FA]
やったこと
1世代目 2世代目 3世代目
描画するとこんな感じ
やったこと
1世代目 2世代目 3世代目
描画するとこんな感じ
枝を3本生やして、その先でそれぞれ3本生やして…
L-sysyemの例
例2:ペンローズタイル
右図… ペンローズタイル
非周期的な平面充填構造
※ ロジャー・ペンローズ: 2020にノーベル物理学賞受賞
L-sysyemの例
例2: ペンローズタイル
二つのタイルのみを使って、
再帰的に大きくしていく
…
L-sysyemの例
例2: ペンローズタイル
二つのタイルのみを使って、
再帰的に大きくしていく
→ L-system で実装
…
苦労した点①
・3次元の枝の回転の処理
𝜃
←座標は?
苦労した点①
・3次元の枝の回転の処理
※glRotatef()では、回転した先の座標が
分からない → 次の世代に繋げられない
𝜃
←座標は?
工夫した点①
3次元のベクトル回転
…3種類存在(右図)
工夫した点①
3次元のベクトル回転
…3種類存在(右図)
+ 任意軸回転
ロール
ピッチ
工夫した点①
・任意軸回転
→「ロドリゲスの回転行列」
を右のベクトル 𝑟 に掛けて、回転
解決策
工夫した点②
葉っぱのモデリング
右図: 四角の平面を葉っぱとして描画
→光の当たり方、形が不自然
工夫した点②
・葉っぱを4つの平面に分割
・y軸方向の膨らみをつける
→本物の葉っぱに近づけた!
解決策
推しポイント①
「木」と「幾何学模様」は一見全然異なる
全然違う…?
推しポイント①
「再帰的」という性質に着目
「L-system」という一貫したアルゴリズムで描写!
推しポイント②
ギミックを多数用意
・幾何学模様が回転 → 木が生成
・幾何学模様、木ともに複数種類切り替え可能
・幾何学模様の回転のスピードアップ/ダウン
・光源の位置変更
etc…
終わり
続きはビデオでお楽しみください!

More Related Content

Featured

Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
 
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them wellGood Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Saba Software
 
Introduction to C Programming Language
Introduction to C Programming LanguageIntroduction to C Programming Language
Introduction to C Programming Language
Simplilearn
 

Featured (20)

How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike RoutesMore than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
 
Barbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationBarbie - Brand Strategy Presentation
Barbie - Brand Strategy Presentation
 
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them wellGood Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
 
Introduction to C Programming Language
Introduction to C Programming LanguageIntroduction to C Programming Language
Introduction to C Programming Language
 

L-systemを用いた幾何学模様と木の生成.pptx