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
0
740
Optimize Collision Detection with Octree
yomotsu
October 08, 2014
Tweet
Share
More Decks by yomotsu
See All by yomotsu
three.jsとRapierでレースゲームが3日でできた話
yomotsu
0
470
PBR in three.js
yomotsu
1
860
dialog要素でつくるモーダルダイアログ
yomotsu
0
980
IE to Edge
yomotsu
1
330
A Camera Control Library for three.js
yomotsu
1
1.2k
Let’s try AR on mobile Web with <model-viewer>
yomotsu
0
540
WebXR: Beyond WebGL
yomotsu
2
1.7k
Non-DOM components with WebGL in Vue.js
yomotsu
5
12k
WebGL Libs for WebApp Frameworks
yomotsu
4
7.8k
Other Decks in Programming
See All in Programming
Boos Performance and Developer Productivity with Jakarta EE 11
ivargrimstad
0
600
Webフレームワークとともに利用するWeb components / JSConf.jp おかわり
spring_raining
1
130
未経験でSRE、はじめました! 組織を支える役割と軌跡
curekoshimizu
1
200
CDKを使ったPagerDuty連携インフラのテンプレート化
shibuya_shogo
0
120
Lambdaの監視、できてますか?Datadogを用いてLambdaを見守ろう
nealle
2
730
Generating OpenAPI schema from serializers throughout the Rails stack - Kyobashi.rb #5
envek
1
420
Swift Testingのモチベを上げたい
stoticdev
2
190
Expoによるアプリ開発の現在地とReact Server Componentsが切り開く未来
yukukotani
1
210
Learning Kotlin with detekt
inouehi
1
200
Drawing Heighway’s Dragon- Recursive Function Rewrite- From Imperative Style in Pascal 64 To Functional Style in Scala 3
philipschwarz
PRO
0
150
iOSでQRコード生成奮闘記
ktcryomm
2
120
Amazon Bedrockマルチエージェントコラボレーションを諦めてLangGraphに入門してみた
akihisaikeda
1
160
Featured
See All Featured
XXLCSS - How to scale CSS and keep your sanity
sugarenia
248
1.3M
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
40
2k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
366
25k
Building Flexible Design Systems
yeseniaperezcruz
328
38k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
6
580
A better future with KSS
kneath
238
17k
Build your cross-platform service in a week with App Engine
jlugia
229
18k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
30
4.6k
Into the Great Unknown - MozCon
thekraken
35
1.6k
The Illustrated Children's Guide to Kubernetes
chrisshort
48
49k
Building Applications with DynamoDB
mza
93
6.2k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
47
5.2k
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