Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
軽率にVue 3で リアルタイム3Dアプリを作れる ライブラリを作ってみた/vue-with-...
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
にー兄さん
March 06, 2024
Programming
2.4k
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 にー兄さん
UnityでSystem.Net.WebSocketsなWebSocketサーバが動かないのでUnity Monoのコードを覗いてみた / about implementing websocket server with unity mono
drumath2237
1
550
ついにAuraも登場したのでJetpack XR SDKについて今一度語りたい / i wanna talk about xreal aura
drumath2237
0
47
『Ground Truth: How We Create Geometrically Accurate Reconstructions (Niantic Spatial Blog)』 を読む / read Ground Truth: How We Create Geometrically Accurate Reconstructions
drumath2237
0
80
この時代にOSS開発に向き合ってみる / face the oss development in this era
drumath2237
0
65
プログラマの職能が代替可能になりつつあるこの時代でプログラムと向き合う修行を積む / dedicating myself to the discipline of programming
drumath2237
0
140
個人的3D Gaussian Splattingニュースをご紹介 / sharing 3d gaussian splatting news
drumath2237
0
670
Jetpack XR SDKから紐解くAndroid XR開発と技術選定のヒント / about-androidxr-and-jetpack-xr-sdk
drumath2237
1
910
XRエンジニアの視点から XRのイマと社会実装の実現について考える / thinking-about-xr-popularization
drumath2237
0
99
軽率にプログラミング言語のシンタックスについて考えてみよう / lets-think-about-programming-lang-syntax
drumath2237
0
150
Other Decks in Programming
See All in Programming
Agents on Rails - Rails at Scale 2026
irinanazarova
0
330
APNsからLive Activityを開始する話
yumnumm
0
150
Java 27新機能 / Java 27 new features
kishida
2
200
コードレビューのボトルネックを"する側"と"される側"の両面から解消する
yub0n
2
1.5k
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
450
パーソナライズPodcastを作った話
repunit11
0
120
AI Agent時代のリアーキテクチャ戦略と実践
hokaccha
9
5.4k
動作中のプログラムの中身をリアルタイムに覗く / Realtime Debugger for CSharp with Roslyn
prota
1
1.8k
iOS 27でニュースアプリはどう変わる!? 〜日経電子版の新機能対応と、開発事例から〜
lynnswap
7
13k
SREの越境 / SRE Collaboration
y0hgi
2
300
マイコン向けの軽量Ruby「PicoRuby」で各種デバイスを制御するネイティブアプリの実現手法
bash0c7
0
470
モデルのリファクタリングが難しいと思ったら、そもそも複雑だったのはビジネス仕様だった ? / is-the-business-domain-the-real-complexity
hatsu38
0
440
Featured
See All Featured
AI: The stuff that nobody shows you
jnunemaker
PRO
10
1.1k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.8k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
287
14k
GraphQLの誤解/rethinking-graphql
sonatard
75
12k
AI Search: Where Are We & What Can We Do About It?
aleyda
0
8k
コードの90%をAIが書く世界で何が待っているのか / What awaits us in a world where 90% of the code is written by AI
rkaga
63
46k
What the history of the web can teach us about the future of AI
inesmontani
PRO
1
720
WENDY [Excerpt]
tessaabrams
14
40k
Git: the NoSQL Database
bkeepers
PRO
433
67k
Raft: Consensus for Rubyists
vanstee
142
7.7k
[RailsConf 2023] Rails as a piece of cake
palkan
59
7.1k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
360
31k
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