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
軽率にVue 3で リアルタイム3Dアプリを作れる ライブラリを作ってみた/vue-with-...
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
にー兄さん
March 06, 2024
Programming
2.2k
3
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
軽率にVue 3で リアルタイム3Dアプリを作れる ライブラリを作ってみた/vue-with-3d-app
v-tokyoにてLT登壇した資料です
にー兄さん
March 06, 2024
More Decks by にー兄さん
See All by にー兄さん
『Ground Truth: How We Create Geometrically Accurate Reconstructions (Niantic Spatial Blog)』 を読む / read Ground Truth: How We Create Geometrically Accurate Reconstructions
drumath2237
0
56
この時代にOSS開発に向き合ってみる / face the oss development in this era
drumath2237
0
43
プログラマの職能が代替可能になりつつあるこの時代でプログラムと向き合う修行を積む / dedicating myself to the discipline of programming
drumath2237
0
92
個人的3D Gaussian Splattingニュースをご紹介 / sharing 3d gaussian splatting news
drumath2237
0
580
Jetpack XR SDKから紐解くAndroid XR開発と技術選定のヒント / about-androidxr-and-jetpack-xr-sdk
drumath2237
1
690
XRエンジニアの視点から XRのイマと社会実装の実現について考える / thinking-about-xr-popularization
drumath2237
0
85
軽率にプログラミング言語のシンタックスについて考えてみよう / lets-think-about-programming-lang-syntax
drumath2237
0
120
エンジニアが軽率に趣味から始める、OSS貢献を軸とした個人活動 / oss-contribution-as-a-hoby-project
drumath2237
0
91
Babylon.js 8.0のアプデ情報を 軽率にキャッチアップ / catch-up-babylonjs-8
drumath2237
0
440
Other Decks in Programming
See All in Programming
はてなアカウント基盤 State of the Union
cockscomb
1
900
Webフレームワークの ベンチマークについて
yusukebe
0
180
Contextとはなにか
chiroruxx
1
380
どこまでゆるくて許されるのか
tk3fftk
0
260
Honoでのサプライチェーン侵害対策 〜 3つのライブラリに学ぶ
yusukebe
7
1.5k
The ROI of Quarkus for Spring Boot Applications
hollycummins
0
140
Observability in Practice:Grafana 與 Edge Device SRE 的那些事
blueswen
0
180
例外の正しい扱い方 そのエラー try-catchして大丈夫?
jinwatanabe
0
290
過去最大のMCPアップデート! 2026-07-28 RC版の謎に迫る
licux
6
400
気圧・高度・GPSを記録&可視化するアプリ「Koudo」を作った話
hjmkth
1
320
LLM本来の能力を解き放つサンドボックス技術とAI民主化への適用
yukukotani
3
4.6k
肥大化するレガシーコードに立ち向かうためのインターフェース分離と依存の逆転 / JJUG CCC 2026 Spring
hirokunimaeta
0
640
Featured
See All Featured
Done Done
chrislema
186
16k
職位にかかわらず全員がリーダーシップを発揮するチーム作り / Building a team where everyone can demonstrate leadership regardless of position
madoxten
62
55k
SEO in 2025: How to Prepare for the Future of Search
ipullrank
3
3.6k
Neural Spatial Audio Processing for Sound Field Analysis and Control
skoyamalab
0
350
Measuring & Analyzing Core Web Vitals
bluesmoon
9
870
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
35k
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
1
250
Lessons Learnt from Crawling 1000+ Websites
charlesmeaden
PRO
1
1.3k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
2.9k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
37
6.5k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
10k
技術選定の審美眼(2025年版) / Understanding the Spiral of Technologies 2025 edition
twada
PRO
118
120k
Transcript
軽率にVue 3で リアルタイム3Dアプリを作れる ライブラリを作ってみた にー兄さん(@ninisan_drumath) Vue.js v-tokyo Meetup #19
にー兄さん(@ninisan_drumath) ソフトウェアエンジニア 株式会社ホロラボ / Iwaken Lab. / Babylon.js勉強会 お仕事ではUnityを使ったxR開発がメイン 趣味ではBabylon.jsをよく触る
うちの猫たち→
本日の話 Vue.js × 3DCG(Babylon.js)
本日の話 Vue.js × 3DCG(Babylon.js) Web3D, Babylon.js面白そう と思ってもらえると嬉しいです
アジェンダ - VueでWeb3Dがしたい! - BabyuewJSの紹介 - おわりに
VueでWeb3Dがしたい!
Webブラウザ上でのリアルタイム3DCG ここでのWeb3Dとは、WebGL(WebGPU)を使って リアルタイムレンダリングによって3Dシーンを扱うこと 昨今のブラウザやデバイスの進化によって Web上でもリッチなグラフィクスを実現できるように フレームワークとしてThree.jsが一番有名 本日の主役はBabylon.js (Babylon.jsはいいぞ!!)
JSフレームワークと3D連携 pmndrs/react-three-fiber - React + Three.js - Reactのコンポーネントとして3Dシーンを扱える - GitHub
starは25.5K Tresjs/tres - Vue + Three.js - 同じくVueコンポーネントとして3Dシーンを扱える - アプデ頻度も高くドキュメントもしっかししていてすごい
TresJSがイケてる <script setup> import { TresCanvas } from '@tresjs/core' </script>
<template> <TresCanvas clear-color=”#82DBC5” window-size> <TresPerspectiveCamera /> <TresMesh @click=”onClick” > <TresBoxGeometry :args="[1, 1, 1]" /> <TresMeshNormalMaterial /> </TresMesh> </TresCanvas> </template> 公式サイトからコードを引用https://tresjs.org/
TresJSがイケてる <script setup> import { TresCanvas } from '@tresjs/core' </script>
<template> <TresCanvas clear-color=”#82DBC5” window-size> <TresPerspectiveCamera /> <TresMesh @click="onClick" > <TresBoxGeometry :args="[1, 1, 1]" /> <TresMeshNormalMaterial /> </TresMesh> </TresCanvas> </template> 公式サイトからコードを引用https://tresjs.org/ どんなオブジェクトがあるのか パッと見でわかりやすい propsにリアクティブな オブジェクトをバインドできる
BabyuewJSの紹介
BabyuewJS概要 α版をGitHub・npmで公開中 https://github.com/drumath2237/BabyuewJS モチベーション: Vue × Babylon.jsなフレームワークを作ってみたい 実現したいこと: Babylon.jsによる3Dシーンの構築を Vueコンポーネントを使って実現したい
素のBabylon.jsのコード import { Engine, MeshBuilder, Scene } from "@babylonjs/core"; const
main = () => { const renderCanvas = document.querySelector<HTMLCanvasElement>("#renderCanvas"); if (!renderCanvas) { return; } const engine = new Engine(renderCanvas); const scene = new Scene(engine); scene.createDefaultCameraOrLight(true, true, true); MeshBuilder.CreateBox("box", { size: 0.2 }); window.addEventListener("resize", () => engine.resize()); engine.runRenderLoop(() => scene.render()); }; main(); canvasを取得し、 engineやsceneを初期化して サイズ0.2のCubeを表示する
BabyuewJSのコード <template> <BabyuewScene antialias> <ArcRotateCamera name="camera" :alpha="Math.PI / 3" :beta="Math.PI
/ 3" :radius="0.5" :target="[0, 0.05, 0]" > </ArcRotateCamera> <DirectionalLight name="light" :direction="[0.25, -1, -0.6]" :intensity="1" ></DirectionalLight> <Box name="my-box" :position="[0, 0.05, 0]" :size="0.1"> </Box> </BabyuewScene> </template> Sceneコンポーネントの子に カメラ、ライト、Boxがある
まだ機能は不十分......。 - 現状まだ簡単な形状やライトなどを置くことしかできない - ???「たぶん動くと思うからリリースしようぜ」 - コンポーネントの追加実装をしていきたい - コード自動生成ができるといいかもしれない -
GitHub Projectsを公開しています - https://github.com/users/drumath2237/projects/9
技術的な詳細について 前回の技術書典15で本を出していますので もしよければ... https://techbookfest.org/product/4tAihHPnGQ9wL6nAMZ1s91?productVariantID=j EN8uRgQmjPELRjF4KQ2tw 気になる部分あれば お気軽にお声がけください!
おわりに
Vue ❤ 3D
参考 drumath2237/BabyuewJS https://github.com/drumath2237/BabyuewJS 『Vue3 + Babylon.jsなOSSライブラリをリリースするまでの開発録』 https://techbookfest.org/product/4tAihHPnGQ9wL6nAMZ1s91?productVariantID=jEN8uRgQmjPELRjF4KQ2tw 開発時に使っていた作業ログ( Zenn) https://zenn.dev/drumath2237/scraps/c32dde3c04deba
TresJS https://tresjs.org/ React Three Fiber Documentation https://docs.pmnd.rs/react-three-fiber/getting-started/introduction