Slide 1

Slide 1 text

UISFFKTͱ3BQJFSͰ ϨʔεήʔϜ͕ ೔ͰͰ͖ͨ࿩ UISFFKTͱ3BQJFSͰ ϨʔεήʔϜ͕ ೔ͰͰ͖ͨ࿩ 0DUTU4IJ[VPLBKT খࢁాߊߒ

Slide 2

Slide 2 text

ձࣾͷ߹॓ ձٞࣨ෇͖ͷԹઘ॓Ͱ ޷͖ͳ΋ͷΛ̏೔ؒͰ࡞Δ

Slide 3

Slide 3 text

No content

Slide 4

Slide 4 text

̏೔ؒͰϨʔεήʔϜΛ ࡞Γ·ͨ͠

Slide 5

Slide 5 text

https://63172814.rapier-tryout.pages.dev/ %FNP

Slide 6

Slide 6 text

גࣜձࣾϐΫηϧάϦου খࢁాߊߒ !ZPNPUTV

Slide 7

Slide 7 text

ٕज़બఆ ྨࣅϥΠϒϥϦʔ ྨࣅϥΠϒϥϦʔ BNNPKTDBOOPOKT ෺ཧγϛϡϨʔγϣϯ %දࣔ

Slide 8

Slide 8 text

w ୯ʹ࢖͍׳Ε͍ͯΔ w ͔ͳΓ׆ൃʹΞοϓσʔτ͞Ε͍ͯΔ w ਺ֶػೳ΋ɺͱͯ΋๛෋ ʢϕΫλʔɺΫΥʔλχΦϯɺߦྻͳͲʣ ࢓ࣄͰ਺ֶػೳ͕ඞཁͳ৔߹͸ɺࢀߟʹ͍ͯ͠Δ ඳըUISFFKT

Slide 9

Slide 9 text

No content

Slide 10

Slide 10 text

No content

Slide 11

Slide 11 text

w BNNPKTͱDBOOPOKT͸ݹ͘ ౰͔࣌Βػೳ௥Ճ͕ͳ͍ͷͰআ֎ w )BWPL͸ʢ࢖ͬͯΈ͍͚ͨͲʣ #BCZMPOҎ֎͸ ૬ੑѱͦ͏ͳͷͰݟૹΓ w 3BQJFS͸ൺֱత৽͠ΊͳͷͰɺ࠾༻ͯ͠Έͨ ෺ཧԋࢉ3BQJFS

Slide 12

Slide 12 text

https://rapier.rs/

Slide 13

Slide 13 text

w 3VTUͰॻ͔Εͨɺ෺ཧԋࢉϥΠϒϥϦʔ w 8BTNͷ+4൛΋͋Γɺܕ΋͍ͭͯ͘Δ w %෺ཧɺ%෺ཧͷ྆ํʹରԠ w جຊతͳ෺ཧԋࢉػೳ͸ଗ͍ͬͯΔ w ࣗಈंγϛϡϨʔγϣϯػೳ΋͋Γͦ͏ʜ ෺ཧԋࢉ3BQJFS

Slide 14

Slide 14 text

w ϓϦϛςΟϒਤܗʢ௚ํମ΍ٿମͳͲʣ Ҏ֎ʹ΋ɺ ޷͖ͳܗͷ߶ମΛ࡞ΕΔ w UISFFKTͷδΦϝτϦʔ͔Β௚઀ 3BQJFSͷ߶ମΛ࡞ΕΔ ෺ཧԋࢉ3BQJFS

Slide 15

Slide 15 text

೚ҙϝογϡ͔Β߶ମΛ࡞Δ

Slide 16

Slide 16 text

terrainMesh.updateWorldMatrix( true, true ); terrainMesh.traverse( ( object ) => { if ( ! object.isMesh ) return; const geometry = object.geometry.clone(); geometry.applyMatrix4( object.matrix ); geometry.computeVertexNormals(); const vertices = new Float32Array( geometry.attributes.position.array ); const indices = new Uint32Array( geometry.index.array ); const groundColliderDesc = RAPIER.ColliderDesc.trimesh( new Float32Array(vertices), new Uint32Array(indices) ) .setActiveEvents( RAPIER.ActiveEvents.COLLISION_EVENTS ); const groundCollider = world.createCollider( groundColliderDesc ); } ); QPTJUJPO΍SPUBUJPO͕ ద༻͞Ε͍ͯΔ৔߹͸ ࣄલʹߦྻʹ൓ө͢Δ ʢ௨ৗ͸SFOEFS࣌ʹద༻͞ΕΔʣ

Slide 17

Slide 17 text

terrainMesh.updateWorldMatrix( true, true ); terrainMesh.traverse( ( object ) => { if ( ! object.isMesh ) return; const geometry = object.geometry.clone(); geometry.applyMatrix4( object.matrix ); geometry.computeVertexNormals(); const vertices = new Float32Array( geometry.attributes.position.array ); const indices = new Uint32Array( geometry.index.array ); const groundColliderDesc = RAPIER.ColliderDesc.trimesh( new Float32Array(vertices), new Uint32Array(indices) ) .setActiveEvents( RAPIER.ActiveEvents.COLLISION_EVENTS ); const groundCollider = world.createCollider( groundColliderDesc ); } ); .FTI಺ͷ શδΦϝτϦʔʹରͯ͠ʜ

Slide 18

Slide 18 text

terrainMesh.updateWorldMatrix( true, true ); terrainMesh.traverse( ( object ) => { if ( ! object.isMesh ) return; const geometry = object.geometry.clone(); geometry.applyMatrix4( object.matrix ); geometry.computeVertexNormals(); const vertices = new Float32Array( geometry.attributes.position.array ); const indices = new Uint32Array( geometry.index.array ); const groundColliderDesc = RAPIER.ColliderDesc.trimesh( new Float32Array(vertices), new Uint32Array(indices) ) .setActiveEvents( RAPIER.ActiveEvents.COLLISION_EVENTS ); const groundCollider = world.createCollider( groundColliderDesc ); } ); ίϐʔͨ͠δΦϝτϦΛ ഁյૢ࡞͍ͯ͘͠

Slide 19

Slide 19 text

terrainMesh.updateWorldMatrix( true, true ); terrainMesh.traverse( ( object ) => { if ( ! object.isMesh ) return; const geometry = object.geometry.clone(); geometry.applyMatrix4( object.matrix ); geometry.computeVertexNormals(); const vertices = new Float32Array( geometry.attributes.position.array ); const indices = new Uint32Array( geometry.index.array ); const groundColliderDesc = RAPIER.ColliderDesc.trimesh( new Float32Array(vertices), new Uint32Array(indices) ) .setActiveEvents( RAPIER.ActiveEvents.COLLISION_EVENTS ); const groundCollider = world.createCollider( groundColliderDesc ); } ); ม׵ߦྻΛ௖఺ʹম͖෇͚Δ

Slide 20

Slide 20 text

terrainMesh.updateWorldMatrix( true, true ); terrainMesh.traverse( ( object ) => { if ( ! object.isMesh ) return; const geometry = object.geometry.clone(); geometry.applyMatrix4( object.matrix ); geometry.computeVertexNormals(); const vertices = new Float32Array( geometry.attributes.position.array ); const indices = new Uint32Array( geometry.index.array ); const groundColliderDesc = RAPIER.ColliderDesc.trimesh( new Float32Array(vertices), new Uint32Array(indices) ) .setActiveEvents( RAPIER.ActiveEvents.COLLISION_EVENTS ); const groundCollider = world.createCollider( groundColliderDesc ); } ); UISFFKTͷHFPNFUSZ͔Β ಺༰ΛऔΓग़ͯ͠

Slide 21

Slide 21 text

terrainMesh.updateWorldMatrix( true, true ); terrainMesh.traverse( ( object ) => { if ( ! object.isMesh ) return; const geometry = object.geometry.clone(); geometry.applyMatrix4( object.matrix ); geometry.computeVertexNormals(); const vertices = new Float32Array( geometry.attributes.position.array ); const indices = new Uint32Array( geometry.index.array ); const groundColliderDesc = RAPIER.ColliderDesc.trimesh( new Float32Array(vertices), new Uint32Array(indices) ) .setActiveEvents( RAPIER.ActiveEvents.COLLISION_EVENTS ); const groundCollider = world.createCollider( groundColliderDesc ); } ); ௖఺഑ྻ͔Β 3BQJFSͷ߶ମΛ࡞ΕΔ

Slide 22

Slide 22 text

+4൛ʹ͸ɺࣗಈं෺ཧ͕ͳ͍ʂ

Slide 23

Slide 23 text

͍͢͝ਓ͕ɺಠࣗʹ࡞͍ͬͯͨʜ

Slide 24

Slide 24 text

w 5XJUUFSͰҎલ͔Β গ͠ݟ͔͚͍ͯͨ w φϏήʔγϣϯϝογϡͱ ΤʔδΣϯτػೳΛ+4΋ ެ։ͯ͠Δ *TBBD͞Μɺ͍͢͝

Slide 25

Slide 25 text

φϏήʔγϣϯϝογϡ

Slide 26

Slide 26 text

ΤʔδΣϯτ IUUQTUZQJDBMTZOPOZNPVTTQJSJUHMJUDINF

Slide 27

Slide 27 text

w UISFFKT w %ඳըػೳ w ೚ҙϞσϧͷಡΈࠐΈʢHM5'ʣ w 3BQJFS w ೚ҙϝογϡ͔Β߶ମΛ࡞Δ w ࣗಈं෺ཧγϛϡϨʔγϣϯʢ*TBBD͞Μ੡ʣ ཁ݅ୡ੒ʹඞཁͳػೳ

Slide 28

Slide 28 text

ίʔυΛॻ͍͍ͯ͘ʜʂ

Slide 29

Slide 29 text

෺ཧԋࢉͱඳը ෺ཧԋࢉ ʢ3BQJFSͷXPSMEʣ දࣔ ʢUISFFKTͷTDFOFʣ

Slide 30

Slide 30 text

w Ұൠతʹɺ෺ཧԋࢉͷੈք͸XPSMEͱݺ͹Ε දࣔͷੈք͸TDFOFͱݺ͹ΕΔ w ෺ཧԋࢉʢ3BQJFSʣͰ ࣌ؒ͝ͱͷγϛϡϨʔγϣϯΛ͢Δ w γϛϡϨʔγϣϯ݁ՌʢXPSMEʣΛ UISFFKTͷTDFOFʹ൓ө͢Δ ෺ཧԋࢉͱඳը

Slide 31

Slide 31 text

// 物理 const gravity = { x: 0, y: -9.81, z: 0 }; const world = new RAPIER.World( gravity ); world.timestep = 0.016; // 表示 const width = window.innerWidth; const height = window.innerHeight; const clock = new THREE.Clock(); const scene = new THREE.Scene(); const camera = new THREE.PerspectiveCamera( 60, width / height, 0.01, 100 ); const renderer = new THREE.WebGLRenderer(); renderer.setSize( width, height ); document.body.appendChild( renderer.domElement ); https://github.com/yomotsu/rapier-tryout ෺ཧγϛϡϨʔγϣϯೖΕ෺XPSME දࣔͷೖΕ෺TDFOF

Slide 32

Slide 32 text

const radius = 1; // 表示 const ballMesh = new Mesh( new SphereGeometry( radius, 16, 16 ), new MeshNormalMaterial( { wireframe: true } ) ); scene.add( ballMesh ); // 物理 const rigidBodyDesc = RAPIER.RigidBodyDesc.dynamic() .setLinearDamping( 0.1 ) .setTranslation( 0, 3, 0 ); const rigidBody = world.createRigidBody( rigidBodyDesc ); const colliderDesc = RAPIER.ColliderDesc.ball( radius ) .setFriction( 0.1 ) .setFrictionCombineRule( RAPIER.CoefficientCombineRule.Max ) .setRestitution( 0.6 ) .setRestitutionCombineRule( RAPIER.CoefficientCombineRule.Max ); world.createCollider( colliderDesc, rigidBody ); https://github.com/yomotsu/rapier-tryout ൒ܘ̍ͷٿମͷϝογϡ ൒ܘ̍ͷٿମͷ߶ମ TDFOF಺ʹ഑ஔ XPSME಺ʹ഑ஔ

Slide 33

Slide 33 text

( function gameLoop() { world.step(); ballMesh.position.copy( rigidBody.translation() ); ballMesh.quaternion.copy( rigidBody.rotation() ); setTimeout( gameLoop, world.timestep ); } )(); https://github.com/yomotsu/rapier-tryout UJNFTUFQ͸ඵͰݻఆࡁΈ ෺ཧ͸S"'Λ࢖Θͣɺݻఆඵϧʔϓͤ͞Δ ෺ཧγϛϡϨʔγϣϯ݁ՌΛ දࣔҐஔʹίϐʔ

Slide 34

Slide 34 text

( function renderLoop () { requestAnimationFrame( renderLoop ); renderer.render( scene, camera ); } )(); https://github.com/yomotsu/rapier-tryout දࣔ͸S"'Ͱɺ σόΠεෛՙʹԠͨ͡ϧʔϓΛͤ͞Δ

Slide 35

Slide 35 text

No content

Slide 36

Slide 36 text

No content

Slide 37

Slide 37 text

https://booth.pm/ja/items/1098032

Slide 38

Slide 38 text

No content

Slide 39

Slide 39 text

No content

Slide 40

Slide 40 text

No content

Slide 41

Slide 41 text

https://on-jin.com/sound/listshow.php?pagename=nori&title=ंɾΫϥΫγϣϯ02

Slide 42

Slide 42 text

No content

Slide 43

Slide 43 text

Web audio https://github.com/yomotsu/rapier-tryout/blob/main/6_hone/index.html

Slide 44

Slide 44 text

%FNP

Slide 45

Slide 45 text

No content

Slide 46

Slide 46 text

const curvePath: THREE.CurvePath = new THREE.CurvePath(); curvePath.add( new THREE.CatmullRomCurve3( [ new THREE.Vector3( 0, 0, 0 ), new THREE.Vector3( 0, 0, 0.1 ), new THREE.Vector3( 0, 0, 10 ), new THREE.Vector3( 0, 18, 50 ), new THREE.Vector3( 20, 18, 60 ), new THREE.Vector3( 20, 18, 0 ), new THREE.Vector3( 0, 18, 0 ), new THREE.Vector3( - 10, 18, 0 ), new THREE.Vector3( - 50, 0, - 50 ), new THREE.Vector3( 0, 0, - 50 ), new THREE.Vector3( 0, 0, - 10 ), ] ) );

Slide 47

Slide 47 text

No content

Slide 48

Slide 48 text

three.jsʹ͸ɺ ఺͔ΒεϓϥΠϯΛ࡞Δػೳ͕͋Δ

Slide 49

Slide 49 text

No content

Slide 50

Slide 50 text

͋Δ఺ʹ͓͍ͯɺ Ұॠલͷ఺ Ұॠޙͷ఺ ͷࠩ෼ϕΫτϧ͔Βɺ ਐߦํ޲ʢλϯδΣϯτʣ͕Θ͔Δ

Slide 51

Slide 51 text

ਐߦํ޲ʢλϯδΣϯτʣ͕Θ͔Ε͹ɺ ্ํ޲ʢϊʔϚϧʣ΋ܭࢉͰ͖Δ

Slide 52

Slide 52 text

ԣํ޲ʢόΠϊʔϚϧʣ΋ܭࢉͰ͖Δ

Slide 53

Slide 53 text

No content

Slide 54

Slide 54 text

No content

Slide 55

Slide 55 text

No content

Slide 56

Slide 56 text

ϑϨωɾηϨ

Slide 57

Slide 57 text

࿈ଓ͢Δ఺ͷ λϯδΣϯτɾϊʔϚϧɾόΠϊʔϥϧ ͔ΒɺϦϘϯঢ়ͷδΦϝτϦʔ͕࡞ΕΔ

Slide 58

Slide 58 text

No content

Slide 59

Slide 59 text

w /PEFKTίϚϯυϥΠϯπʔϧ w HMCϑΝΠϧΛѹॖ͢Δ w %SBDPΦϓγϣϯ w (MC಺ͷେαΠζະѹॖ1/(ςΫενϟΛ αΠζͷXFCQʹม׵ w ͳͲͳͲ HMUGUSBOTGPSN

Slide 60

Slide 60 text

https://gltf-transform.dev/

Slide 61

Slide 61 text

w ϥΠϒϥϦʔɺϒϥ΢βͷਐԽͷ݁Ռ͸ ໨֮·͍͠ w ϞόΠϧ୺຤ɾճઢঢ়گ΋ਐԽͨ͠ w +BWB4DSJQUͬͯԿͰ΋Ͱ͖ͦ͏ʜʂ ·ͱΊ

Slide 62

Slide 62 text

͓ΘΓ খࢁాߊߒ !ZPNPUTV