Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Optimize Collision Detection with Octree
Search
yomotsu
October 08, 2014
Programming
780
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Optimize Collision Detection with Octree
yomotsu
October 08, 2014
More Decks by yomotsu
See All by yomotsu
three.jsとRapierでレースゲームが3日でできた話
yomotsu
0
900
PBR in three.js
yomotsu
1
1.4k
dialog要素でつくるモーダルダイアログ
yomotsu
0
1.1k
IE to Edge
yomotsu
1
410
A Camera Control Library for three.js
yomotsu
1
1.5k
Let’s try AR on mobile Web with <model-viewer>
yomotsu
0
600
WebXR: Beyond WebGL
yomotsu
2
1.9k
Non-DOM components with WebGL in Vue.js
yomotsu
5
13k
WebGL Libs for WebApp Frameworks
yomotsu
4
7.9k
Other Decks in Programming
See All in Programming
運用ダッシュボードの設計を誰も教えてくれないのだけどみなさんどうしてるんですか? - チームに監視するという文化を根付かせるための第一歩を踏みたい -
satoshi256kbyte
1
120
進化を続けるGo toolsの現在地 / The Current State of Ever-Evolving Go Tools
hond0413
0
230
バグを直したら useEffect が消えた
colorful12
2
440
そこに3びきプロダクトがいるじゃろう——生成AI時代における“価値が届かない理由”の構造
kosuket
0
500
komatsuna「分散システムにおけるバグ分析手法」
komatsunaqa
0
260
yield再入門 #phpcon
o0h
PRO
0
1.1k
PostgreSQL 18で考えるUUID主キー
kazuhiro1982
0
470
全PRの83%がAIレビューだけでマージできるようになった開発組織はその後どうなったか
athug
1
1.7k
AI時代に設計が 最大の生産性レバーになる 意図駆動開発とデータを消さない設計|Don't Delete Your Data or Your Intent — Design as the Deepest Lever in the AI Era
tomohisa
1
980
Detecting Compromised CI with eBPF and Cilium Tetragon
lizrice
0
200
AI時代のPHPer生存戦略 ~「言語、もうなんでもよくない?」に本気で向き合う~
vivion
0
750
ルールを書いて終わらせないハーネスエンジニアリング
yug1224
5
1.9k
Featured
See All Featured
Into the Great Unknown - MozCon
thekraken
41
2.7k
What's in a price? How to price your products and services
michaelherold
247
13k
Being A Developer After 40
akosma
91
590k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
49
10k
Principles of Awesome APIs and How to Build Them.
keavy
128
18k
ラッコキーワード サービス紹介資料
rakko
1
4.4M
State of Search Keynote: SEO is Dead Long Live SEO
ryanjones
0
240
Between Models and Reality
mayunak
4
390
Organizational Design Perspectives: An Ontology of Organizational Design Elements
kimpetersen
PRO
1
790
sira's awesome portfolio website redesign presentation
elsirapls
0
320
Highjacked: Video Game Concept Design
rkendrick25
PRO
1
430
SEOcharity - Dark patterns in SEO and UX: How to avoid them and build a more ethical web
sarafernandez
0
240
Transcript
1 Optimize Collision Detection with Octree Presented by Akihiro Oyamada
(@yomotsu) Frontend Engineer at PixelGrid, Inc. Oct 7, 2014
2
3
4
5
6
7 Collision Detection vs 524 Tris
8 vs only about 30 Tris by partitioning
ׂۭͨؒ͠ .PSUPOPSEFSʹैͬͯฒΔ 9
10
11
12
13
14
15 // maxDepth4のoctreeのツリー構成例 ! octree.nodes = [ [node], //level 1
(node*1個) [node,node...] //level 2 (node*8個) [node,node...] //level 3 (node*64個) [node,node...] //level 4 (node*512個) ]
16 // node単体の構成例 ! OctreeNode = function ( params )
{ ! this.tree // <Octree> this.depth // <Number> this.mortonNumber // <Number> this.min // <THREE.Vector3> this.max // <THREE.Vector3> this.trianglePool // <Array> ! }
17 -FWFMͷͷࢠϊʔυΛٻΊΔʹʜ
18 var i; ! var parentMotonNum = 1; ! for
( i = 0; i < 8; i ++ ) { ! console.log( ( parentMotonNum << 3 ) + i ); ! } ! // 8, 9, 10, 11, 12, 14, 15
19 -FWFMͷͷϊʔυΛٻΊΔʹʜ
20 var childMotonNum = 10; console.log( childMotonNum >> 3 );
! // 1
ϏοτγϑτͰ ٻΊΒΕΔ 21
ϊʔυʹܗͷ τϥΠΞϯάϧΛొ͢Δ 22
""##WT5SJBOHMF ϊʔυ""## 23
24
25
NBY%FQUIΛʹͨ͠Β $ISPNF͕ࢭ·ͬͨ ? ? ? ʜ ? ݸͷϊʔυ͕Ͱ͖Δ 26
܁Γฦ͠ͷΛݮΒ͢͜ͱ͕Ͱ͖ ͨ 27
%Ͱ͋Δ͚ΕͲɺ ܗฏ໘ʹ͍ۙͷͰɺ 2VBEUSFF % Ͱ͍͍͔ .PSUPO/VNͱϏοτγϑτ 28
• THREE.RayΛΊͯɺಠࣗͷ Segment-Triangleަࠩςετʹஔ͖͑ • ίϝϯτΛେྔʹೖΕͨ(ຊޠ͚ͩͲ) 29 ଞʹͬͨ͜ͱ
30 gl.finish(); @yomotsu