SlideShare une entreprise Scribd logo
1  sur  17
WRITING 3D
APPLICATIONS USING
 RUBY-PROCESSING
          Preston Lee
     http://prestonlee.com
      http://openrain.com
processing.org

Toolkit for creating visualization.
Primitive shapes, positioning, lighting etc.
3D accelerated. (OpenGL rendering available.)
Java.
Both web and desktop friendly.
!processing.org

An application framework. No design assumptions.
Object-oriented. BYOOOA&D.
Physics
Ruby.
Nutshell.
Processing provides you with a canvas and powerful
primitives, but is in no way a “framework” like Shoes or
Rails.
IMHO, processing is less quirky that the other popular
Ruby GUI toolkits.
Using processing effectively requires design effort
specific to your application.
A general GUI framework
 application architecture.
A main application/rendering/animation loop that
executes constantly.
CPU intense stuff in separate threads to keep rendering
fast.
I/O (such as network and disk access) in separate
threads to prevent render loop from blocking.
HID events arrive asynchronously and outside of the
rendering loop. Thread safety a must!
ruby-processing
`sudo gem install ruby-processing`
Ruby bindings to processing.
Comes bundled with a version of jruby. You do not
need a separate jruby installation.
`rp5 watch my_sketch.rb` to run your app.
Best API documentation from processing.org. (Java)
Great 3D use cases.
Data visualization: many things make more sense in
a 3D world, since we live in one and all.
Simulation: real or non-real-time execution.
Computation sometimes distributed across the tubes
with local visualization.
Gaming: real-time visuals with asynchronous state I/
O, as well as asynchronous input, graphics and audio.
3D-Specific Challenges
Underutilized: several   Positioning/
high learning curves.    Orientation: Tracking
                         where everything is at a
Math: strong spatial     given point in time.
reasoning skills are a
must.                    Input: click detection
                         and other HID.
Performance: models
sometimes need lots of   Collision detection.
CPU before rendering.
                         Physics.
Bundled examples.


`cd ruby-processing/samples/processing_app/3D`
`rp5 run form/brick_tower.rb`
`rp5 run typography/kinetic_type.rb`
Important missing stuff.
Camera position and object creation position do not
need to be the same. (The camera is fixed in the 3D
examples.)
No sophisticated movement or input methods.
Everything is in the animation (“main”) thread. This
does not scale for real applications.
Rendering is based on CPU time, not wall clock time.
Physics should be the same against a wall clock
regardless of CPU speed.
No I/O. All real-world apps have I/O.
Let’s build something cool!
A star field simulator      Behave according to
and twitter feed reader.   wall-clock time, even
                           on a crappy system.
All visible objects have
their own thread, and      First person shooter-
can execute arbitrary      style movement.
code such as I/O and       Keyboard and mouse
heavy computation.         both act on wall-clock
(Implausible on the 1.8    time.
                                       Note: object
MRI. JVM FTW!)                         execution
                                       parallelization is not
                                       needed for most
                                       games, but is useful to
                                       distribute CPU load
                                       across nodes.
Modeling the system.
The universe is a giant cube (the “clipping plane”).
The sun is stationary with start whizzing by it.
Camera position in discrete X, Y, Z integers.
Orientation as a vector and rotation.
Starting position and velocity (speed + direction)
for each star.
Stars get “recycled” when they leave the clipping
plane.
Every star has a thread.
Each star instance has its own thread that updates
its own state based on wall-clock time. It calculates its
own state when it can.
Stars move according to their own parameters. (We
could make them talk to each other, too.)
Let’s test our model in a simple ruby script..
`jruby starfield_1_model.rb`
Now let’s use ruby-
 processing to visualize it.

Callbacks: setup and draw.
Create our models and start the rendering loop.
Finally, we’ll add control.

Callbacks: key_pressed, key_released, mouse_dragged,
mouse_released etc.
Math: calculate ∆translation and ∆rotation for camera
on each render based on ∆time.
Move: apply movement to the camera on each draw.
Let’s add some I/O.


Bundled twitter gem dependent on native C code.
API call to pull in friends and their tweets.
Fill the twiverse with information asynchronously
Packaging as an OS X app.


`rp5 app my_sketch.rb`
Drop in your own icon.
Shove it all in a .dmg.

Contenu connexe

Tendances

Developing Next-Generation Games with Stage3D (Molehill)
Developing Next-Generation Games with Stage3D (Molehill) Developing Next-Generation Games with Stage3D (Molehill)
Developing Next-Generation Games with Stage3D (Molehill) Jean-Philippe Doiron
 
【Unite 2017 Tokyo】Unityを使ったNintendo Switch™ローンチタイトル制作~スーパーボンバーマンRの事例~
【Unite 2017 Tokyo】Unityを使ったNintendo Switch™ローンチタイトル制作~スーパーボンバーマンRの事例~【Unite 2017 Tokyo】Unityを使ったNintendo Switch™ローンチタイトル制作~スーパーボンバーマンRの事例~
【Unite 2017 Tokyo】Unityを使ったNintendo Switch™ローンチタイトル制作~スーパーボンバーマンRの事例~Unite2017Tokyo
 
GDC16: Arbitrary amount of 3D data running on Gear VR by Vinh Truong
GDC16: Arbitrary amount of 3D data running on Gear VR by Vinh TruongGDC16: Arbitrary amount of 3D data running on Gear VR by Vinh Truong
GDC16: Arbitrary amount of 3D data running on Gear VR by Vinh TruongUmbra Software
 
[HTML5 BUG] 2,5D RTS Game in HTML5 by Dawid Lijewski
[HTML5 BUG] 2,5D RTS Game in HTML5 by Dawid Lijewski[HTML5 BUG] 2,5D RTS Game in HTML5 by Dawid Lijewski
[HTML5 BUG] 2,5D RTS Game in HTML5 by Dawid LijewskiBeMyApp
 
2 Dimensions Of Awesome: Advanced ActionScript For Platform Games by Iain Lobb
2 Dimensions Of Awesome: Advanced ActionScript For Platform Games by Iain Lobb2 Dimensions Of Awesome: Advanced ActionScript For Platform Games by Iain Lobb
2 Dimensions Of Awesome: Advanced ActionScript For Platform Games by Iain Lobbmochimedia
 
Optimizing Unity games for mobile devices
Optimizing Unity games for mobile devicesOptimizing Unity games for mobile devices
Optimizing Unity games for mobile devicesBruno Cicanci
 
[UniteKorea2013] Memory profiling in Unity
[UniteKorea2013] Memory profiling in Unity[UniteKorea2013] Memory profiling in Unity
[UniteKorea2013] Memory profiling in UnityWilliam Hugo Yang
 
The next frontier: WebGL and WebVR
The next frontier: WebGL and WebVRThe next frontier: WebGL and WebVR
The next frontier: WebGL and WebVRCodemotion
 
Deep Learning on iOS #360iDev
Deep Learning on iOS #360iDevDeep Learning on iOS #360iDev
Deep Learning on iOS #360iDevShuichi Tsutsumi
 
【Unite 2017 Tokyo】Anima2Dについて語るで!2Dアニメーションの未来
【Unite 2017 Tokyo】Anima2Dについて語るで!2Dアニメーションの未来【Unite 2017 Tokyo】Anima2Dについて語るで!2Dアニメーションの未来
【Unite 2017 Tokyo】Anima2Dについて語るで!2Dアニメーションの未来Unite2017Tokyo
 
【Unite 2017 Tokyo】インスタンシングを用いた美麗なグラフィックの実現方法
【Unite 2017 Tokyo】インスタンシングを用いた美麗なグラフィックの実現方法【Unite 2017 Tokyo】インスタンシングを用いた美麗なグラフィックの実現方法
【Unite 2017 Tokyo】インスタンシングを用いた美麗なグラフィックの実現方法Unite2017Tokyo
 
【Unite 2017 Tokyo】Unity UI最適化ガイド 〜ベストプラクティスと新機能
【Unite 2017 Tokyo】Unity UI最適化ガイド 〜ベストプラクティスと新機能【Unite 2017 Tokyo】Unity UI最適化ガイド 〜ベストプラクティスと新機能
【Unite 2017 Tokyo】Unity UI最適化ガイド 〜ベストプラクティスと新機能Unity Technologies Japan K.K.
 
Umbra 3 IGDA & Unity Presentation
Umbra 3 IGDA & Unity PresentationUmbra 3 IGDA & Unity Presentation
Umbra 3 IGDA & Unity PresentationThomas Puha
 
UI Debugging - Cocoaheads Dresden (English)
UI Debugging - Cocoaheads Dresden (English)UI Debugging - Cocoaheads Dresden (English)
UI Debugging - Cocoaheads Dresden (English)Pit Garbe
 
【Unite 2017 Tokyo】最適化をする前に覚えておきたい技術
【Unite 2017 Tokyo】最適化をする前に覚えておきたい技術【Unite 2017 Tokyo】最適化をする前に覚えておきたい技術
【Unite 2017 Tokyo】最適化をする前に覚えておきたい技術Unity Technologies Japan K.K.
 

Tendances (18)

Unity project
Unity projectUnity project
Unity project
 
Developing Next-Generation Games with Stage3D (Molehill)
Developing Next-Generation Games with Stage3D (Molehill) Developing Next-Generation Games with Stage3D (Molehill)
Developing Next-Generation Games with Stage3D (Molehill)
 
【Unite 2017 Tokyo】Unityを使ったNintendo Switch™ローンチタイトル制作~スーパーボンバーマンRの事例~
【Unite 2017 Tokyo】Unityを使ったNintendo Switch™ローンチタイトル制作~スーパーボンバーマンRの事例~【Unite 2017 Tokyo】Unityを使ったNintendo Switch™ローンチタイトル制作~スーパーボンバーマンRの事例~
【Unite 2017 Tokyo】Unityを使ったNintendo Switch™ローンチタイトル制作~スーパーボンバーマンRの事例~
 
GDC16: Arbitrary amount of 3D data running on Gear VR by Vinh Truong
GDC16: Arbitrary amount of 3D data running on Gear VR by Vinh TruongGDC16: Arbitrary amount of 3D data running on Gear VR by Vinh Truong
GDC16: Arbitrary amount of 3D data running on Gear VR by Vinh Truong
 
[HTML5 BUG] 2,5D RTS Game in HTML5 by Dawid Lijewski
[HTML5 BUG] 2,5D RTS Game in HTML5 by Dawid Lijewski[HTML5 BUG] 2,5D RTS Game in HTML5 by Dawid Lijewski
[HTML5 BUG] 2,5D RTS Game in HTML5 by Dawid Lijewski
 
Cap
CapCap
Cap
 
2 Dimensions Of Awesome: Advanced ActionScript For Platform Games by Iain Lobb
2 Dimensions Of Awesome: Advanced ActionScript For Platform Games by Iain Lobb2 Dimensions Of Awesome: Advanced ActionScript For Platform Games by Iain Lobb
2 Dimensions Of Awesome: Advanced ActionScript For Platform Games by Iain Lobb
 
VR Optimization Techniques
VR Optimization Techniques VR Optimization Techniques
VR Optimization Techniques
 
Optimizing Unity games for mobile devices
Optimizing Unity games for mobile devicesOptimizing Unity games for mobile devices
Optimizing Unity games for mobile devices
 
[UniteKorea2013] Memory profiling in Unity
[UniteKorea2013] Memory profiling in Unity[UniteKorea2013] Memory profiling in Unity
[UniteKorea2013] Memory profiling in Unity
 
The next frontier: WebGL and WebVR
The next frontier: WebGL and WebVRThe next frontier: WebGL and WebVR
The next frontier: WebGL and WebVR
 
Deep Learning on iOS #360iDev
Deep Learning on iOS #360iDevDeep Learning on iOS #360iDev
Deep Learning on iOS #360iDev
 
【Unite 2017 Tokyo】Anima2Dについて語るで!2Dアニメーションの未来
【Unite 2017 Tokyo】Anima2Dについて語るで!2Dアニメーションの未来【Unite 2017 Tokyo】Anima2Dについて語るで!2Dアニメーションの未来
【Unite 2017 Tokyo】Anima2Dについて語るで!2Dアニメーションの未来
 
【Unite 2017 Tokyo】インスタンシングを用いた美麗なグラフィックの実現方法
【Unite 2017 Tokyo】インスタンシングを用いた美麗なグラフィックの実現方法【Unite 2017 Tokyo】インスタンシングを用いた美麗なグラフィックの実現方法
【Unite 2017 Tokyo】インスタンシングを用いた美麗なグラフィックの実現方法
 
【Unite 2017 Tokyo】Unity UI最適化ガイド 〜ベストプラクティスと新機能
【Unite 2017 Tokyo】Unity UI最適化ガイド 〜ベストプラクティスと新機能【Unite 2017 Tokyo】Unity UI最適化ガイド 〜ベストプラクティスと新機能
【Unite 2017 Tokyo】Unity UI最適化ガイド 〜ベストプラクティスと新機能
 
Umbra 3 IGDA & Unity Presentation
Umbra 3 IGDA & Unity PresentationUmbra 3 IGDA & Unity Presentation
Umbra 3 IGDA & Unity Presentation
 
UI Debugging - Cocoaheads Dresden (English)
UI Debugging - Cocoaheads Dresden (English)UI Debugging - Cocoaheads Dresden (English)
UI Debugging - Cocoaheads Dresden (English)
 
【Unite 2017 Tokyo】最適化をする前に覚えておきたい技術
【Unite 2017 Tokyo】最適化をする前に覚えておきたい技術【Unite 2017 Tokyo】最適化をする前に覚えておきたい技術
【Unite 2017 Tokyo】最適化をする前に覚えておきたい技術
 

Similaire à Writing 3D Applications Using ruby-processing

GPU Programming: CocoaConf Atlanta
GPU Programming: CocoaConf AtlantaGPU Programming: CocoaConf Atlanta
GPU Programming: CocoaConf AtlantaJanie Clayton
 
GPU Programming: Chicago CocoaConf 2015
GPU Programming: Chicago CocoaConf 2015GPU Programming: Chicago CocoaConf 2015
GPU Programming: Chicago CocoaConf 2015Janie Clayton
 
GPU Programming 360iDev
GPU Programming 360iDevGPU Programming 360iDev
GPU Programming 360iDevJanie Clayton
 
【Unite 2017 Tokyo】インスタンシングを用いた美麗なグラフィックの実現方法
【Unite 2017 Tokyo】インスタンシングを用いた美麗なグラフィックの実現方法【Unite 2017 Tokyo】インスタンシングを用いた美麗なグラフィックの実現方法
【Unite 2017 Tokyo】インスタンシングを用いた美麗なグラフィックの実現方法Unity Technologies Japan K.K.
 
Gpu Programming With GPUImage and Metal
Gpu Programming With GPUImage and MetalGpu Programming With GPUImage and Metal
Gpu Programming With GPUImage and MetalJanie Clayton
 
Visibility Optimization for Games
Visibility Optimization for GamesVisibility Optimization for Games
Visibility Optimization for GamesUmbra
 
Visibility Optimization for Games
Visibility Optimization for GamesVisibility Optimization for Games
Visibility Optimization for GamesSampo Lappalainen
 
Introduction to html5 game programming with impact js
Introduction to html5 game programming with impact jsIntroduction to html5 game programming with impact js
Introduction to html5 game programming with impact jsLuca Galli
 
CUDA by Example : Constant Memory and Events : Notes
CUDA by Example : Constant Memory and Events : NotesCUDA by Example : Constant Memory and Events : Notes
CUDA by Example : Constant Memory and Events : NotesSubhajit Sahu
 
CNC plotter controlled using Android application
CNC plotter controlled using Android applicationCNC plotter controlled using Android application
CNC plotter controlled using Android applicationYuval Yoskovits
 
Distributed computing and hyper-parameter tuning with Ray
Distributed computing and hyper-parameter tuning with RayDistributed computing and hyper-parameter tuning with Ray
Distributed computing and hyper-parameter tuning with RayJan Margeta
 
Game Engine Overview
Game Engine OverviewGame Engine Overview
Game Engine OverviewSharad Mitra
 
Video Terminal Evolution and The Future of Browsers
Video Terminal Evolution and The Future of BrowsersVideo Terminal Evolution and The Future of Browsers
Video Terminal Evolution and The Future of BrowsersThomas Walker Lynch
 
Introduction to three.js & Leap Motion
Introduction to three.js & Leap MotionIntroduction to three.js & Leap Motion
Introduction to three.js & Leap MotionLee Trout
 
VisionizeBeforeVisulaize_IEVC_Final
VisionizeBeforeVisulaize_IEVC_FinalVisionizeBeforeVisulaize_IEVC_Final
VisionizeBeforeVisulaize_IEVC_FinalMasatsugu HASHIMOTO
 
Wp7 performance challenges
Wp7 performance challengesWp7 performance challenges
Wp7 performance challengesGergely Orosz
 
The Intersection of Game Engines & GPUs: Current & Future (Graphics Hardware ...
The Intersection of Game Engines & GPUs: Current & Future (Graphics Hardware ...The Intersection of Game Engines & GPUs: Current & Future (Graphics Hardware ...
The Intersection of Game Engines & GPUs: Current & Future (Graphics Hardware ...Johan Andersson
 
Web3D - Semantic standards, WebGL, HCI
Web3D - Semantic standards, WebGL, HCIWeb3D - Semantic standards, WebGL, HCI
Web3D - Semantic standards, WebGL, HCIVictor Porof
 
Vpu technology &gpgpu computing
Vpu technology &gpgpu computingVpu technology &gpgpu computing
Vpu technology &gpgpu computingArka Ghosh
 
jChampions JSR381 Visual recognition for java
jChampions   JSR381 Visual recognition for javajChampions   JSR381 Visual recognition for java
jChampions JSR381 Visual recognition for javaZoran Sevarac, PhD
 

Similaire à Writing 3D Applications Using ruby-processing (20)

GPU Programming: CocoaConf Atlanta
GPU Programming: CocoaConf AtlantaGPU Programming: CocoaConf Atlanta
GPU Programming: CocoaConf Atlanta
 
GPU Programming: Chicago CocoaConf 2015
GPU Programming: Chicago CocoaConf 2015GPU Programming: Chicago CocoaConf 2015
GPU Programming: Chicago CocoaConf 2015
 
GPU Programming 360iDev
GPU Programming 360iDevGPU Programming 360iDev
GPU Programming 360iDev
 
【Unite 2017 Tokyo】インスタンシングを用いた美麗なグラフィックの実現方法
【Unite 2017 Tokyo】インスタンシングを用いた美麗なグラフィックの実現方法【Unite 2017 Tokyo】インスタンシングを用いた美麗なグラフィックの実現方法
【Unite 2017 Tokyo】インスタンシングを用いた美麗なグラフィックの実現方法
 
Gpu Programming With GPUImage and Metal
Gpu Programming With GPUImage and MetalGpu Programming With GPUImage and Metal
Gpu Programming With GPUImage and Metal
 
Visibility Optimization for Games
Visibility Optimization for GamesVisibility Optimization for Games
Visibility Optimization for Games
 
Visibility Optimization for Games
Visibility Optimization for GamesVisibility Optimization for Games
Visibility Optimization for Games
 
Introduction to html5 game programming with impact js
Introduction to html5 game programming with impact jsIntroduction to html5 game programming with impact js
Introduction to html5 game programming with impact js
 
CUDA by Example : Constant Memory and Events : Notes
CUDA by Example : Constant Memory and Events : NotesCUDA by Example : Constant Memory and Events : Notes
CUDA by Example : Constant Memory and Events : Notes
 
CNC plotter controlled using Android application
CNC plotter controlled using Android applicationCNC plotter controlled using Android application
CNC plotter controlled using Android application
 
Distributed computing and hyper-parameter tuning with Ray
Distributed computing and hyper-parameter tuning with RayDistributed computing and hyper-parameter tuning with Ray
Distributed computing and hyper-parameter tuning with Ray
 
Game Engine Overview
Game Engine OverviewGame Engine Overview
Game Engine Overview
 
Video Terminal Evolution and The Future of Browsers
Video Terminal Evolution and The Future of BrowsersVideo Terminal Evolution and The Future of Browsers
Video Terminal Evolution and The Future of Browsers
 
Introduction to three.js & Leap Motion
Introduction to three.js & Leap MotionIntroduction to three.js & Leap Motion
Introduction to three.js & Leap Motion
 
VisionizeBeforeVisulaize_IEVC_Final
VisionizeBeforeVisulaize_IEVC_FinalVisionizeBeforeVisulaize_IEVC_Final
VisionizeBeforeVisulaize_IEVC_Final
 
Wp7 performance challenges
Wp7 performance challengesWp7 performance challenges
Wp7 performance challenges
 
The Intersection of Game Engines & GPUs: Current & Future (Graphics Hardware ...
The Intersection of Game Engines & GPUs: Current & Future (Graphics Hardware ...The Intersection of Game Engines & GPUs: Current & Future (Graphics Hardware ...
The Intersection of Game Engines & GPUs: Current & Future (Graphics Hardware ...
 
Web3D - Semantic standards, WebGL, HCI
Web3D - Semantic standards, WebGL, HCIWeb3D - Semantic standards, WebGL, HCI
Web3D - Semantic standards, WebGL, HCI
 
Vpu technology &gpgpu computing
Vpu technology &gpgpu computingVpu technology &gpgpu computing
Vpu technology &gpgpu computing
 
jChampions JSR381 Visual recognition for java
jChampions   JSR381 Visual recognition for javajChampions   JSR381 Visual recognition for java
jChampions JSR381 Visual recognition for java
 

Dernier

SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DaySri Ambati
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 

Dernier (20)

SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 

Writing 3D Applications Using ruby-processing

  • 1. WRITING 3D APPLICATIONS USING RUBY-PROCESSING Preston Lee http://prestonlee.com http://openrain.com
  • 2. processing.org Toolkit for creating visualization. Primitive shapes, positioning, lighting etc. 3D accelerated. (OpenGL rendering available.) Java. Both web and desktop friendly.
  • 3. !processing.org An application framework. No design assumptions. Object-oriented. BYOOOA&D. Physics Ruby.
  • 4. Nutshell. Processing provides you with a canvas and powerful primitives, but is in no way a “framework” like Shoes or Rails. IMHO, processing is less quirky that the other popular Ruby GUI toolkits. Using processing effectively requires design effort specific to your application.
  • 5. A general GUI framework application architecture. A main application/rendering/animation loop that executes constantly. CPU intense stuff in separate threads to keep rendering fast. I/O (such as network and disk access) in separate threads to prevent render loop from blocking. HID events arrive asynchronously and outside of the rendering loop. Thread safety a must!
  • 6. ruby-processing `sudo gem install ruby-processing` Ruby bindings to processing. Comes bundled with a version of jruby. You do not need a separate jruby installation. `rp5 watch my_sketch.rb` to run your app. Best API documentation from processing.org. (Java)
  • 7. Great 3D use cases. Data visualization: many things make more sense in a 3D world, since we live in one and all. Simulation: real or non-real-time execution. Computation sometimes distributed across the tubes with local visualization. Gaming: real-time visuals with asynchronous state I/ O, as well as asynchronous input, graphics and audio.
  • 8. 3D-Specific Challenges Underutilized: several Positioning/ high learning curves. Orientation: Tracking where everything is at a Math: strong spatial given point in time. reasoning skills are a must. Input: click detection and other HID. Performance: models sometimes need lots of Collision detection. CPU before rendering. Physics.
  • 9. Bundled examples. `cd ruby-processing/samples/processing_app/3D` `rp5 run form/brick_tower.rb` `rp5 run typography/kinetic_type.rb`
  • 10. Important missing stuff. Camera position and object creation position do not need to be the same. (The camera is fixed in the 3D examples.) No sophisticated movement or input methods. Everything is in the animation (“main”) thread. This does not scale for real applications. Rendering is based on CPU time, not wall clock time. Physics should be the same against a wall clock regardless of CPU speed. No I/O. All real-world apps have I/O.
  • 11. Let’s build something cool! A star field simulator Behave according to and twitter feed reader. wall-clock time, even on a crappy system. All visible objects have their own thread, and First person shooter- can execute arbitrary style movement. code such as I/O and Keyboard and mouse heavy computation. both act on wall-clock (Implausible on the 1.8 time. Note: object MRI. JVM FTW!) execution parallelization is not needed for most games, but is useful to distribute CPU load across nodes.
  • 12. Modeling the system. The universe is a giant cube (the “clipping plane”). The sun is stationary with start whizzing by it. Camera position in discrete X, Y, Z integers. Orientation as a vector and rotation. Starting position and velocity (speed + direction) for each star. Stars get “recycled” when they leave the clipping plane.
  • 13. Every star has a thread. Each star instance has its own thread that updates its own state based on wall-clock time. It calculates its own state when it can. Stars move according to their own parameters. (We could make them talk to each other, too.) Let’s test our model in a simple ruby script.. `jruby starfield_1_model.rb`
  • 14. Now let’s use ruby- processing to visualize it. Callbacks: setup and draw. Create our models and start the rendering loop.
  • 15. Finally, we’ll add control. Callbacks: key_pressed, key_released, mouse_dragged, mouse_released etc. Math: calculate ∆translation and ∆rotation for camera on each render based on ∆time. Move: apply movement to the camera on each draw.
  • 16. Let’s add some I/O. Bundled twitter gem dependent on native C code. API call to pull in friends and their tweets. Fill the twiverse with information asynchronously
  • 17. Packaging as an OS X app. `rp5 app my_sketch.rb` Drop in your own icon. Shove it all in a .dmg.

Notes de l'éditeur