Upgrade to Pro — share decks privately, control downloads, hide ads and more …

ARCoreの導入から応用まで @ABC 2018 autumn

ARCoreの導入から応用まで @ABC 2018 autumn

Google AR ハンズオン at ABC2018 Autumn ( https://japan-android-group.connpass.com/event/103063/ )でARCoreの概要説明に使った資料です。6月のABC 2018 springの時の資料 ( https://speakerdeck.com/ktaka/androiddearfalsemeng-wozai-bi-arcorefalsedao-ru-karaying-yong-made )に少しだけ最新情報を追加しました。

Kenichi Takahashi

October 13, 2018
Tweet

More Decks by Kenichi Takahashi

Other Decks in Programming

Transcript

  1. ରԠ୺຤ w ݱࡏͷ"3$PSFͷόʔδϣϯ͸  w όʔδϣϯΛॏͶΔ͝ͱʹର Ԡ୺຤΋͍ͩͿ૿͑·ͨ͠ w 9QFSJB9; w

    (BMBYZ" " " /PUF  4 4 4 w -(( )VBXFJ1౳ IUUQTEFWFMPQFSTHPPHMFDPNBSEJTDPWFSTVQQPSUFEEFWJDFT
  2. ͜ͷ͋ͱͷίʔυϥϘͰ ମݧͰ͖·͢ w 4DFOFGPSNΛ࢖ͬͯछྨͷ% ϞσϧΛ഑ஔ w ࣸਅΛࡱͬͯอଘ w ͓·͚ͷ՝୊ w

    ೚ҙͷจࣈྻΛ 7JFX3FOEFSBCMFͰ഑ஔ w IUUQCJUMZ+#PJ2# IUUQTDPEFMBCTEFWFMPQFSTHPPHMFDPNDPEFMBCTTDFOFGPSNJOUSP
  3. ΦϒδΣΫτΛΧϝϥͷํ޲ʹ ޲͚Δࡍͷճస Vector3 GetLookVector () { Vector3 lookVector = Camera.main.transform.position

    - hitTransform.transform.position; lookVector.y = 0.0f; // Y軸の差分は無視する lookVector.Normalize (); return lookVector; } hitTransform.transform.rotation = Quaternion.LookRotation (GetLookVector());
  4. ௥Ճ͢ΔγΣʔμʔͷϓϩύςΟ w @$POTUSVDU: w ΫϦοϐϯά͢Δ:࠲ඪͷ஋ w @$POTUSVDU(BQ w ੵ૚͍ͯ͘͠ࡍʹ৭Λม͑Δڥ քͷߴ͞

    w @$POTUSVDU$PMPS w ੵ૚͍ͯ͘͠ࡍͷڥքͷ৭ ৄࡉ͸IUUQTXXXLBCVLVDPKQEFWFMPQFSTBSE@QSJOU
  5. γΣʔμʔͷίʔυ if(IN.worldPos.y > _ConstructY + _ConstructGap) { discard; } ඳը͞Εͳ͍Α͏ΫϦοϐϯά͢ΔॲཧͰ͢ɻ

    ϐΫηϧͷϫʔϧυҐஔͷ:࠲ඪͷ஋͕ʮΫϦοϐϯά͢Δ:࠲ඪ ڥ քͷߴ͞ʯΑΓେ͖͍ʢΫϦοϐϯά͢ΔҐஔΑΓߴ͍Ґஔʹ͋Δʣ৔ ߹ɺEJTDBSEͯ͠ඳը͠ͳ͍Α͏ʹ͠·͢ɻ
  6. γΣʔμʔͷίʔυ if(IN.worldPos.y < _ConstructY) { fixed4 c = tex2D(_MainTex, IN.uv_MainTex);

    o.Albedo = c.rgb; o.Alpha = c.a; } else { o.Albedo = _ConstructColor.rgb; o.Alpha = _ConstructColor.a; } ϐΫηϧͷϫʔϧυҐஔͷ:࠲ඪͷ஋͕ΫϦοϐϯά͢Δ:࠲ඪΑΓখ͍͞৔ ߹ɺ௨ৗඳըͷର৅ͱͯ͠ςΫενϟ͔Βͷ৭Λ൓ө͠·͢ɻ:࠲ඪͷ஋Ҏ্ ͷ৔߹ɺڥք෦෼ͷඳըର৅ͱͯ͠ڥքͷ৭Λ൓ө͠·͢ɻ