SlideShare uma empresa Scribd logo
1 de 20
Baixar para ler offline
+




Scala LWJGL
          3D   	
 
                     @chimerast
+
                              	
 

    n 
          n    Twitter: @chimerast
          n    Blog: http://chimera.st/
          n    Scala : 1
          n    LWJGL : 3

    n               NEET
          n          Web/
          n    Seasar Foundation          S2Wicket 1.4
          n    wicket-ja, java-ja

    n                      3D
          n                3D
          n    DirectX7 Immediate Mode
+
                	
 

    n 
          n 


    n 
          n 
          n 


    n 
          n 


    n 
          n 
          n 
+
    Scala                                3D              	
 

    n 
          n               3D             (or        )

    n 
          n                    MikuMikuDance   3D


    n 
          n    Scala
          n    LWJGL
          n    Slick
+
    MikuMikuDance	
 

    n 
          n    http://www.geocities.jp/higuchuu4/
          n 

          n    DirectX

                                                     http://www.nicovideo.jp/watch/sm9647253

    n 
          n 

          n 

          n 

                n    JVM
+
    Scala
    A Scalable Language	
 

    n                            +
          n 


    n 
          n    Java                             1
          n    3D

            scala> List(3,2,5,1).reduceLeft(math.max)
            res0: Int = 5	
 

    n    Java
          n 
+
    LWJGL
    Lightweight Java Game Library	
 

    n                                                +
          n    http://www.lwjgl.org/
          n    OpenGL
                n  3D             API
                n 
          n    OpenAL
                n                       3D     API
                n 
          n    OpenCL
                n  GPGPU          GPU                    API
          n 
          n 
+
    Slick
    2D Game Library based on LWJGL	
 

    n                  LWJGL       2D
          n    http://slick.cokeandcode.com/
          n    LWJGL(OpenGL)           2D



    n 
          n    2D
                n 

                n 

                n    SVG
+
    LWJGL
                                        	
 
    n    https://github.com/chimerast/scala-lwjgl-sample
          n               sbt

    n 
          n          3D

          n                     3D

    n    LWJGL native                         java.library.path

          n    sbt              fork
+
                              	
 

    n    3D

    n 


          n    IK    (   )
          n 


    n 

          n 

                n 

          n 

                n 
+
                                          	
 
    n 
          n 

          n          60fps(1    60   )
                n        16ms
+
    Java/Scala
                                                       	
 
    n                             (GC)
          n 

          n 


    n    C++
          n    JIT                       C++                JIT

          n                              SIMD               C+
                +
                n    SIMD        1CPU
                      n                   10
                      n     3D
+
                                                	
 

    n 
          n 
                n              Array[Float]
          n 


          n                                   Scala immutable.List
          n               GC

    n 
          n    Java
                n  OpenGL                     GPU
                n  GPU SIMD
          n 
+
    Scala
                                                                                                	
 
        :              	
                  .apply	
       .update	
      .foreach	
  .prepend	
  .append	
        .insert	
 

    java.util.ArrayList[AnyRef]	
                11	
            19	
          16	
    19,746	
         158	
       39,317	
 

    java.util.LinkedList[AnyRef]	
           38.622	
      388,877	
           43	
       152	
         141	
           320

    Array[AnyRef]	
                                1	
           21	
         174	
              -	
       -	
             -	
 

    mutable.ArrayBuffer[AnyRef]	
                11	
            19	
         122	
    19,734	
         172	
       40,118	
 

    mutable.ListBuffer[AnyRef]	
             94,595	
       94,861	
          367	
       119	
         170	
       95,643	
 

    mutable.Queue[AnyRef]	
                  99.916	
      100,672	
          497	
       142	
         230	
              -	
 

    immutable.List[AnyRef]	
                 94,543	
  4,718,559	
            312	
       175	
  2,482,455	
               -	
 

    immutable.Vector[AnyRef]	
                  107	
          517	
          211	
       779	
         662	
              -	
 


         Scala
    http://d.hatena.ne.jp/chimerast/20110304/1299237142
    Array[AnyRef].apply              JIT                         (DCE)
                                                                                          	
                JIT
+
    MikuMikuDance                                                	
 

    n    PMD                (.pmd)
          n    3D

    n    VMD                 (.vmd)
          n    3D

    n                                           2ch

          n                          - MMD       (PMD)    	
          	
 
                http://bit.ly/fFYlS
          n 

    n 
          n    AS3 (b2ox ): http://www.libspark.org/browser/as3/FLARMMD
          n    XNA (wilfrem ): http://sourceforge.jp/projects/mmdx/
+
    PMD                                                    	
 

    n                                            in MMD
          n                       3D
          n 
          n 
          n 
          n    IK
          n 
                n 


    n    Direct3D OpenGL
          n 
                n    OpenGL            DirectX
                n             z
+
    VMD               	
 

    n 
          n 

          n 

          n 


    n 


          n 
+
       in Scala	
 
val file = new File(path)
using(new RandomAccessFile(file, "r")) { f =>
  val channel = f.getChannel
  val buffer = channel.map(FileChannel.MapMode.READ_ONLY, 0, channel.size)
  buffer.order(ByteOrder.LITTLE_ENDIAN)

       Some(new PMDModel(file, buffer))
}	
 

class      PMDModel(file: File, buffer: ByteBuffer) {
  val      header = new PMDHeader(buffer)
  val      vertices = Array.fill(buffer.getInt) { new PMDVertex(buffer) }
  val      indices = Array.fill(buffer.getInt) { buffer.getShort }
  val      materials = Array.fill(buffer.getInt) { new PMDMaterial(buffer) }
  val      bones = Array.fill(buffer.getShort) { new PMDBone(buffer) }
  val      iks = Array.fill(buffer.getShort) { new PMDIKData(buffer) }
  val      skins = Array.fill(buffer.getShort) { new PMDSkinData(buffer) }
  val      skinIndex = Array.fill(buffer.get) { buffer.getShort }
  val      boneDispName = Array.fill(buffer.get) { buffer.getString(50) }
  val      boneDisp = Array.fill(buffer.getInt) { new PMDBoneDisp(buffer) }
}
+
                                                    	
 

    n    IK
          n 


    n 
          n    JBullet: http://jbullet.advel.cz/

    n 
          n 

                n 

          n    Prolog     =
+
          	
 

    n 

Mais conteúdo relacionado

Mais procurados

Creating Custom Charts With Ruby Vector Graphics
Creating Custom Charts With Ruby Vector GraphicsCreating Custom Charts With Ruby Vector Graphics
Creating Custom Charts With Ruby Vector GraphicsDavid Keener
 
05 - Qt External Interaction and Graphics
05 - Qt External Interaction and Graphics05 - Qt External Interaction and Graphics
05 - Qt External Interaction and GraphicsAndreas Jakl
 
Using Multi-Touch and Gestures with Qt
Using Multi-Touch and Gestures with QtUsing Multi-Touch and Gestures with Qt
Using Multi-Touch and Gestures with Qtaccount inactive
 
Qt on Real Time Operating Systems
Qt on Real Time Operating SystemsQt on Real Time Operating Systems
Qt on Real Time Operating Systemsaccount inactive
 
Advanced Visualization with OpenGL in Oil & Gas
Advanced Visualization with OpenGL in Oil & GasAdvanced Visualization with OpenGL in Oil & Gas
Advanced Visualization with OpenGL in Oil & Gasaccount inactive
 
Petri Niemi Qt Advanced Part 1
Petri Niemi Qt Advanced Part 1Petri Niemi Qt Advanced Part 1
Petri Niemi Qt Advanced Part 1NokiaAppForum
 
Advanced Scenegraph Rendering Pipeline
Advanced Scenegraph Rendering PipelineAdvanced Scenegraph Rendering Pipeline
Advanced Scenegraph Rendering PipelineNarann29
 
Modern OpenGL Usage: Using Vertex Buffer Objects Well
Modern OpenGL Usage: Using Vertex Buffer Objects Well Modern OpenGL Usage: Using Vertex Buffer Objects Well
Modern OpenGL Usage: Using Vertex Buffer Objects Well Mark Kilgard
 
Dx11 performancereloaded
Dx11 performancereloadedDx11 performancereloaded
Dx11 performancereloadedmistercteam
 
Low-level Shader Optimization for Next-Gen and DX11 by Emil Persson
Low-level Shader Optimization for Next-Gen and DX11 by Emil PerssonLow-level Shader Optimization for Next-Gen and DX11 by Emil Persson
Low-level Shader Optimization for Next-Gen and DX11 by Emil PerssonAMD Developer Central
 

Mais procurados (13)

Creating Custom Charts With Ruby Vector Graphics
Creating Custom Charts With Ruby Vector GraphicsCreating Custom Charts With Ruby Vector Graphics
Creating Custom Charts With Ruby Vector Graphics
 
Qt Widget In-Depth
Qt Widget In-DepthQt Widget In-Depth
Qt Widget In-Depth
 
05 - Qt External Interaction and Graphics
05 - Qt External Interaction and Graphics05 - Qt External Interaction and Graphics
05 - Qt External Interaction and Graphics
 
Using Multi-Touch and Gestures with Qt
Using Multi-Touch and Gestures with QtUsing Multi-Touch and Gestures with Qt
Using Multi-Touch and Gestures with Qt
 
Qt on Real Time Operating Systems
Qt on Real Time Operating SystemsQt on Real Time Operating Systems
Qt on Real Time Operating Systems
 
Qt Animation
Qt AnimationQt Animation
Qt Animation
 
Advanced Visualization with OpenGL in Oil & Gas
Advanced Visualization with OpenGL in Oil & GasAdvanced Visualization with OpenGL in Oil & Gas
Advanced Visualization with OpenGL in Oil & Gas
 
Petri Niemi Qt Advanced Part 1
Petri Niemi Qt Advanced Part 1Petri Niemi Qt Advanced Part 1
Petri Niemi Qt Advanced Part 1
 
Advanced Scenegraph Rendering Pipeline
Advanced Scenegraph Rendering PipelineAdvanced Scenegraph Rendering Pipeline
Advanced Scenegraph Rendering Pipeline
 
04 - Qt Data
04 - Qt Data04 - Qt Data
04 - Qt Data
 
Modern OpenGL Usage: Using Vertex Buffer Objects Well
Modern OpenGL Usage: Using Vertex Buffer Objects Well Modern OpenGL Usage: Using Vertex Buffer Objects Well
Modern OpenGL Usage: Using Vertex Buffer Objects Well
 
Dx11 performancereloaded
Dx11 performancereloadedDx11 performancereloaded
Dx11 performancereloaded
 
Low-level Shader Optimization for Next-Gen and DX11 by Emil Persson
Low-level Shader Optimization for Next-Gen and DX11 by Emil PerssonLow-level Shader Optimization for Next-Gen and DX11 by Emil Persson
Low-level Shader Optimization for Next-Gen and DX11 by Emil Persson
 

Destaque

Lifthub (rpscala #31)
Lifthub (rpscala #31)Lifthub (rpscala #31)
Lifthub (rpscala #31)k4200
 
Scala勉強会 in 渋谷 2010→2011(鹿島)
Scala勉強会 in 渋谷 2010→2011(鹿島)Scala勉強会 in 渋谷 2010→2011(鹿島)
Scala勉強会 in 渋谷 2010→2011(鹿島)k4200
 
20120718 scalaで転職
20120718 scalaで転職20120718 scalaで転職
20120718 scalaで転職大翼 福田
 
Lifthub (#rpscala 26)
Lifthub (#rpscala 26)Lifthub (#rpscala 26)
Lifthub (#rpscala 26)k4200
 
sbt 0.10 for beginners?
sbt 0.10 for beginners?sbt 0.10 for beginners?
sbt 0.10 for beginners?k4200
 
Sns suite presentation
Sns suite presentationSns suite presentation
Sns suite presentationJason Namkung
 
私とScalaと2010 @hito_asa
私とScalaと2010 @hito_asa私とScalaと2010 @hito_asa
私とScalaと2010 @hito_asaHitoshi Asai
 
rpscala35-scala2.9.0
rpscala35-scala2.9.0rpscala35-scala2.9.0
rpscala35-scala2.9.0Kenji Yoshida
 
Scala design pattern
Scala design patternScala design pattern
Scala design patternKenji Yoshida
 
Grass
GrassGrass
Grassk4200
 

Destaque (15)

Lifthub (rpscala #31)
Lifthub (rpscala #31)Lifthub (rpscala #31)
Lifthub (rpscala #31)
 
Scala勉強会 in 渋谷 2010→2011(鹿島)
Scala勉強会 in 渋谷 2010→2011(鹿島)Scala勉強会 in 渋谷 2010→2011(鹿島)
Scala勉強会 in 渋谷 2010→2011(鹿島)
 
Rpscala18th
Rpscala18thRpscala18th
Rpscala18th
 
20120718 scalaで転職
20120718 scalaで転職20120718 scalaで転職
20120718 scalaで転職
 
Scala lang evolution
Scala lang evolutionScala lang evolution
Scala lang evolution
 
Lifthub (#rpscala 26)
Lifthub (#rpscala 26)Lifthub (#rpscala 26)
Lifthub (#rpscala 26)
 
sbt 0.10 for beginners?
sbt 0.10 for beginners?sbt 0.10 for beginners?
sbt 0.10 for beginners?
 
Sns suite presentation
Sns suite presentationSns suite presentation
Sns suite presentation
 
私とScalaと2010 @hito_asa
私とScalaと2010 @hito_asa私とScalaと2010 @hito_asa
私とScalaと2010 @hito_asa
 
Rpscala2011 0601
Rpscala2011 0601Rpscala2011 0601
Rpscala2011 0601
 
Scala repl
Scala replScala repl
Scala repl
 
rpscala35-scala2.9.0
rpscala35-scala2.9.0rpscala35-scala2.9.0
rpscala35-scala2.9.0
 
Scala design pattern
Scala design patternScala design pattern
Scala design pattern
 
scala-kaigi1-sbt
scala-kaigi1-sbtscala-kaigi1-sbt
scala-kaigi1-sbt
 
Grass
GrassGrass
Grass
 

Semelhante a Real-Time 3D Programming in Scala

7nm "Navi" GPU - A GPU Built For Performance
7nm "Navi" GPU - A GPU Built For Performance 7nm "Navi" GPU - A GPU Built For Performance
7nm "Navi" GPU - A GPU Built For Performance AMD
 
State of the art: Server-side JavaScript - MoscowJS
State of the art: Server-side JavaScript - MoscowJSState of the art: Server-side JavaScript - MoscowJS
State of the art: Server-side JavaScript - MoscowJSAlexandre Morgaut
 
State of the art server side java script
State of the art server side java scriptState of the art server side java script
State of the art server side java scriptThibaud Arguillere
 
State of the art - server side JavaScript - web-5 2012
State of the art - server side JavaScript - web-5 2012State of the art - server side JavaScript - web-5 2012
State of the art - server side JavaScript - web-5 2012Alexandre Morgaut
 
[DSC 2016] 系列活動:李泳泉 / 星火燎原 - Spark 機器學習初探
[DSC 2016] 系列活動:李泳泉 / 星火燎原 - Spark 機器學習初探[DSC 2016] 系列活動:李泳泉 / 星火燎原 - Spark 機器學習初探
[DSC 2016] 系列活動:李泳泉 / 星火燎原 - Spark 機器學習初探台灣資料科學年會
 
Genome Browser based on Google Maps API
Genome Browser based on Google Maps APIGenome Browser based on Google Maps API
Genome Browser based on Google Maps APIHong ChangBum
 
Syysgraph 2018 - Modern Graphics Abstractions & Real-Time Ray Tracing
Syysgraph 2018 - Modern Graphics Abstractions & Real-Time Ray TracingSyysgraph 2018 - Modern Graphics Abstractions & Real-Time Ray Tracing
Syysgraph 2018 - Modern Graphics Abstractions & Real-Time Ray TracingElectronic Arts / DICE
 
State of the art: Server-Side JavaScript - dejeuner fulljs
State of the art: Server-Side JavaScript - dejeuner fulljsState of the art: Server-Side JavaScript - dejeuner fulljs
State of the art: Server-Side JavaScript - dejeuner fulljsAlexandre Morgaut
 
Building a Big Data Machine Learning Platform
Building a Big Data Machine Learning PlatformBuilding a Big Data Machine Learning Platform
Building a Big Data Machine Learning PlatformCliff Click
 
Getting started with Ray Tracing in Unity 2019.3 - Unite Copenhagen 2019
Getting started with Ray Tracing in Unity 2019.3 - Unite Copenhagen 2019Getting started with Ray Tracing in Unity 2019.3 - Unite Copenhagen 2019
Getting started with Ray Tracing in Unity 2019.3 - Unite Copenhagen 2019Unity Technologies
 
BDD - Buzzword Driven Development - Build the next cool app for fun and for.....
BDD - Buzzword Driven Development - Build the next cool app for fun and for.....BDD - Buzzword Driven Development - Build the next cool app for fun and for.....
BDD - Buzzword Driven Development - Build the next cool app for fun and for.....Michele Orselli
 
BDD - Buzzword Driven Development - Build the next cool app for fun and for.....
BDD - Buzzword Driven Development - Build the next cool app for fun and for.....BDD - Buzzword Driven Development - Build the next cool app for fun and for.....
BDD - Buzzword Driven Development - Build the next cool app for fun and for.....Alessandro Cinelli (cirpo)
 
State of the art: server-side javaScript - NantesJS
State of the art: server-side javaScript - NantesJSState of the art: server-side javaScript - NantesJS
State of the art: server-side javaScript - NantesJSAlexandre Morgaut
 
Efficient Graphics with Qt
Efficient Graphics with QtEfficient Graphics with Qt
Efficient Graphics with QtAriya Hidayat
 
쉐도우맵을 압축하여 대규모씬에 라이팅을 적용해보자
쉐도우맵을 압축하여 대규모씬에 라이팅을 적용해보자쉐도우맵을 압축하여 대규모씬에 라이팅을 적용해보자
쉐도우맵을 압축하여 대규모씬에 라이팅을 적용해보자Seongdae Kim
 
NoSQL and JavaScript: a love story
NoSQL and JavaScript: a love storyNoSQL and JavaScript: a love story
NoSQL and JavaScript: a love storyAlexandre Morgaut
 
2013.02.02 지앤선 테크니컬 세미나 - Xcode를 활용한 디버깅 팁(OSXDEV)
2013.02.02 지앤선 테크니컬 세미나 - Xcode를 활용한 디버깅 팁(OSXDEV)2013.02.02 지앤선 테크니컬 세미나 - Xcode를 활용한 디버깅 팁(OSXDEV)
2013.02.02 지앤선 테크니컬 세미나 - Xcode를 활용한 디버깅 팁(OSXDEV)JiandSon
 

Semelhante a Real-Time 3D Programming in Scala (20)

7nm "Navi" GPU - A GPU Built For Performance
7nm "Navi" GPU - A GPU Built For Performance 7nm "Navi" GPU - A GPU Built For Performance
7nm "Navi" GPU - A GPU Built For Performance
 
State of the art: Server-side JavaScript - MoscowJS
State of the art: Server-side JavaScript - MoscowJSState of the art: Server-side JavaScript - MoscowJS
State of the art: Server-side JavaScript - MoscowJS
 
State of the art server side java script
State of the art server side java scriptState of the art server side java script
State of the art server side java script
 
State of the art - server side JavaScript - web-5 2012
State of the art - server side JavaScript - web-5 2012State of the art - server side JavaScript - web-5 2012
State of the art - server side JavaScript - web-5 2012
 
[DSC 2016] 系列活動:李泳泉 / 星火燎原 - Spark 機器學習初探
[DSC 2016] 系列活動:李泳泉 / 星火燎原 - Spark 機器學習初探[DSC 2016] 系列活動:李泳泉 / 星火燎原 - Spark 機器學習初探
[DSC 2016] 系列活動:李泳泉 / 星火燎原 - Spark 機器學習初探
 
Genome Browser based on Google Maps API
Genome Browser based on Google Maps APIGenome Browser based on Google Maps API
Genome Browser based on Google Maps API
 
Syysgraph 2018 - Modern Graphics Abstractions & Real-Time Ray Tracing
Syysgraph 2018 - Modern Graphics Abstractions & Real-Time Ray TracingSyysgraph 2018 - Modern Graphics Abstractions & Real-Time Ray Tracing
Syysgraph 2018 - Modern Graphics Abstractions & Real-Time Ray Tracing
 
State of the art: Server-Side JavaScript - dejeuner fulljs
State of the art: Server-Side JavaScript - dejeuner fulljsState of the art: Server-Side JavaScript - dejeuner fulljs
State of the art: Server-Side JavaScript - dejeuner fulljs
 
3 673 (1)
3 673 (1)3 673 (1)
3 673 (1)
 
Building a Big Data Machine Learning Platform
Building a Big Data Machine Learning PlatformBuilding a Big Data Machine Learning Platform
Building a Big Data Machine Learning Platform
 
Getting started with Ray Tracing in Unity 2019.3 - Unite Copenhagen 2019
Getting started with Ray Tracing in Unity 2019.3 - Unite Copenhagen 2019Getting started with Ray Tracing in Unity 2019.3 - Unite Copenhagen 2019
Getting started with Ray Tracing in Unity 2019.3 - Unite Copenhagen 2019
 
BDD - Buzzword Driven Development - Build the next cool app for fun and for.....
BDD - Buzzword Driven Development - Build the next cool app for fun and for.....BDD - Buzzword Driven Development - Build the next cool app for fun and for.....
BDD - Buzzword Driven Development - Build the next cool app for fun and for.....
 
BDD - Buzzword Driven Development - Build the next cool app for fun and for.....
BDD - Buzzword Driven Development - Build the next cool app for fun and for.....BDD - Buzzword Driven Development - Build the next cool app for fun and for.....
BDD - Buzzword Driven Development - Build the next cool app for fun and for.....
 
State of the art: server-side javaScript - NantesJS
State of the art: server-side javaScript - NantesJSState of the art: server-side javaScript - NantesJS
State of the art: server-side javaScript - NantesJS
 
最新の異常検知手法(NIPS 2018)
最新の異常検知手法(NIPS 2018)最新の異常検知手法(NIPS 2018)
最新の異常検知手法(NIPS 2018)
 
Efficient Graphics with Qt
Efficient Graphics with QtEfficient Graphics with Qt
Efficient Graphics with Qt
 
NvFX GTC 2013
NvFX GTC 2013NvFX GTC 2013
NvFX GTC 2013
 
쉐도우맵을 압축하여 대규모씬에 라이팅을 적용해보자
쉐도우맵을 압축하여 대규모씬에 라이팅을 적용해보자쉐도우맵을 압축하여 대규모씬에 라이팅을 적용해보자
쉐도우맵을 압축하여 대규모씬에 라이팅을 적용해보자
 
NoSQL and JavaScript: a love story
NoSQL and JavaScript: a love storyNoSQL and JavaScript: a love story
NoSQL and JavaScript: a love story
 
2013.02.02 지앤선 테크니컬 세미나 - Xcode를 활용한 디버깅 팁(OSXDEV)
2013.02.02 지앤선 테크니컬 세미나 - Xcode를 활용한 디버깅 팁(OSXDEV)2013.02.02 지앤선 테크니컬 세미나 - Xcode를 활용한 디버깅 팁(OSXDEV)
2013.02.02 지앤선 테크니컬 세미나 - Xcode를 활용한 디버깅 팁(OSXDEV)
 

Mais de Hideyuki Takeuchi

もっとデータ可視化をカジュアルに! OSSプロジェクト「E2D3」
もっとデータ可視化をカジュアルに! OSSプロジェクト「E2D3」もっとデータ可視化をカジュアルに! OSSプロジェクト「E2D3」
もっとデータ可視化をカジュアルに! OSSプロジェクト「E2D3」Hideyuki Takeuchi
 
オープンソースプロジェクト E2D3のご紹介
オープンソースプロジェクト E2D3のご紹介オープンソースプロジェクト E2D3のご紹介
オープンソースプロジェクト E2D3のご紹介Hideyuki Takeuchi
 
どんなデータでもキレイに魅せる! 〜HTML5/JavaScriptでグラフを描画する今時の手法〜
どんなデータでもキレイに魅せる! 〜HTML5/JavaScriptでグラフを描画する今時の手法〜どんなデータでもキレイに魅せる! 〜HTML5/JavaScriptでグラフを描画する今時の手法〜
どんなデータでもキレイに魅せる! 〜HTML5/JavaScriptでグラフを描画する今時の手法〜Hideyuki Takeuchi
 
SPEEDA/NewsPicksを支える価値を生み出す技術の選定手法
SPEEDA/NewsPicksを支える価値を生み出す技術の選定手法SPEEDA/NewsPicksを支える価値を生み出す技術の選定手法
SPEEDA/NewsPicksを支える価値を生み出す技術の選定手法Hideyuki Takeuchi
 
とあるCTØの切込隊長日誌(スタートアップ) ビジネス篇
とあるCTØの切込隊長日誌(スタートアップ) ビジネス篇とあるCTØの切込隊長日誌(スタートアップ) ビジネス篇
とあるCTØの切込隊長日誌(スタートアップ) ビジネス篇Hideyuki Takeuchi
 
Web時代の大富豪的プログラミングのススメ
Web時代の大富豪的プログラミングのススメWeb時代の大富豪的プログラミングのススメ
Web時代の大富豪的プログラミングのススメHideyuki Takeuchi
 
Communication between Wicket and Flex
Communication between Wicket and FlexCommunication between Wicket and Flex
Communication between Wicket and FlexHideyuki Takeuchi
 

Mais de Hideyuki Takeuchi (9)

もっとデータ可視化をカジュアルに! OSSプロジェクト「E2D3」
もっとデータ可視化をカジュアルに! OSSプロジェクト「E2D3」もっとデータ可視化をカジュアルに! OSSプロジェクト「E2D3」
もっとデータ可視化をカジュアルに! OSSプロジェクト「E2D3」
 
オープンソースプロジェクト E2D3のご紹介
オープンソースプロジェクト E2D3のご紹介オープンソースプロジェクト E2D3のご紹介
オープンソースプロジェクト E2D3のご紹介
 
どんなデータでもキレイに魅せる! 〜HTML5/JavaScriptでグラフを描画する今時の手法〜
どんなデータでもキレイに魅せる! 〜HTML5/JavaScriptでグラフを描画する今時の手法〜どんなデータでもキレイに魅せる! 〜HTML5/JavaScriptでグラフを描画する今時の手法〜
どんなデータでもキレイに魅せる! 〜HTML5/JavaScriptでグラフを描画する今時の手法〜
 
SPEEDA/NewsPicksを支える価値を生み出す技術の選定手法
SPEEDA/NewsPicksを支える価値を生み出す技術の選定手法SPEEDA/NewsPicksを支える価値を生み出す技術の選定手法
SPEEDA/NewsPicksを支える価値を生み出す技術の選定手法
 
とあるCTØの切込隊長日誌(スタートアップ) ビジネス篇
とあるCTØの切込隊長日誌(スタートアップ) ビジネス篇とあるCTØの切込隊長日誌(スタートアップ) ビジネス篇
とあるCTØの切込隊長日誌(スタートアップ) ビジネス篇
 
Web時代の大富豪的プログラミングのススメ
Web時代の大富豪的プログラミングのススメWeb時代の大富豪的プログラミングのススメ
Web時代の大富豪的プログラミングのススメ
 
Reactive Programming
Reactive ProgrammingReactive Programming
Reactive Programming
 
ScalaCL in ScalaKaigi
ScalaCL in ScalaKaigiScalaCL in ScalaKaigi
ScalaCL in ScalaKaigi
 
Communication between Wicket and Flex
Communication between Wicket and FlexCommunication between Wicket and Flex
Communication between Wicket and Flex
 

Último

Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 

Último (20)

Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 

Real-Time 3D Programming in Scala

  • 1. + Scala LWJGL 3D @chimerast
  • 2. + n  n  Twitter: @chimerast n  Blog: http://chimera.st/ n  Scala : 1 n  LWJGL : 3 n  NEET n  Web/ n  Seasar Foundation S2Wicket 1.4 n  wicket-ja, java-ja n  3D n  3D n  DirectX7 Immediate Mode
  • 3. + n  n  n  n  n  n  n  n  n  n 
  • 4. + Scala 3D n  n  3D (or ) n  n  MikuMikuDance 3D n  n  Scala n  LWJGL n  Slick
  • 5. + MikuMikuDance n  n  http://www.geocities.jp/higuchuu4/ n  n  DirectX http://www.nicovideo.jp/watch/sm9647253 n  n  n  n  n  JVM
  • 6. + Scala A Scalable Language n  + n  n  n  Java 1 n  3D scala> List(3,2,5,1).reduceLeft(math.max) res0: Int = 5 n  Java n 
  • 7. + LWJGL Lightweight Java Game Library n  + n  http://www.lwjgl.org/ n  OpenGL n  3D API n  n  OpenAL n  3D API n  n  OpenCL n  GPGPU GPU API n  n 
  • 8. + Slick 2D Game Library based on LWJGL n  LWJGL 2D n  http://slick.cokeandcode.com/ n  LWJGL(OpenGL) 2D n  n  2D n  n  n  SVG
  • 9. + LWJGL n  https://github.com/chimerast/scala-lwjgl-sample n  sbt n  n  3D n  3D n  LWJGL native java.library.path n  sbt fork
  • 10. + n  3D n  n  IK ( ) n  n  n  n  n  n 
  • 11. + n  n  n  60fps(1 60 ) n  16ms
  • 12. + Java/Scala n  (GC) n  n  n  C++ n  JIT C++ JIT n  SIMD C+ + n  SIMD 1CPU n  10 n  3D
  • 13. + n  n  n  Array[Float] n  n  Scala immutable.List n  GC n  n  Java n  OpenGL GPU n  GPU SIMD n 
  • 14. + Scala : .apply .update .foreach .prepend .append .insert java.util.ArrayList[AnyRef] 11 19 16 19,746 158 39,317 java.util.LinkedList[AnyRef] 38.622 388,877 43 152 141 320 Array[AnyRef] 1 21 174 - - - mutable.ArrayBuffer[AnyRef] 11 19 122 19,734 172 40,118 mutable.ListBuffer[AnyRef] 94,595 94,861 367 119 170 95,643 mutable.Queue[AnyRef] 99.916 100,672 497 142 230 - immutable.List[AnyRef] 94,543 4,718,559 312 175 2,482,455 - immutable.Vector[AnyRef] 107 517 211 779 662 - Scala http://d.hatena.ne.jp/chimerast/20110304/1299237142 Array[AnyRef].apply JIT (DCE) JIT
  • 15. + MikuMikuDance n  PMD (.pmd) n  3D n  VMD (.vmd) n  3D n  2ch n  - MMD (PMD) http://bit.ly/fFYlS n  n  n  AS3 (b2ox ): http://www.libspark.org/browser/as3/FLARMMD n  XNA (wilfrem ): http://sourceforge.jp/projects/mmdx/
  • 16. + PMD n  in MMD n  3D n  n  n  n  IK n  n  n  Direct3D OpenGL n  n  OpenGL DirectX n  z
  • 17. + VMD n  n  n  n  n  n 
  • 18. + in Scala val file = new File(path) using(new RandomAccessFile(file, "r")) { f => val channel = f.getChannel val buffer = channel.map(FileChannel.MapMode.READ_ONLY, 0, channel.size) buffer.order(ByteOrder.LITTLE_ENDIAN) Some(new PMDModel(file, buffer)) } class PMDModel(file: File, buffer: ByteBuffer) { val header = new PMDHeader(buffer) val vertices = Array.fill(buffer.getInt) { new PMDVertex(buffer) } val indices = Array.fill(buffer.getInt) { buffer.getShort } val materials = Array.fill(buffer.getInt) { new PMDMaterial(buffer) } val bones = Array.fill(buffer.getShort) { new PMDBone(buffer) } val iks = Array.fill(buffer.getShort) { new PMDIKData(buffer) } val skins = Array.fill(buffer.getShort) { new PMDSkinData(buffer) } val skinIndex = Array.fill(buffer.get) { buffer.getShort } val boneDispName = Array.fill(buffer.get) { buffer.getString(50) } val boneDisp = Array.fill(buffer.getInt) { new PMDBoneDisp(buffer) } }
  • 19. + n  IK n  n  n  JBullet: http://jbullet.advel.cz/ n  n  n  n  Prolog =
  • 20. + n