1日でできる!ARCoreことはじめ

7e6a79d3fd57e49905f6f4fe53550021?s=47 zukkey
August 23, 2018

 1日でできる!ARCoreことはじめ

初心者でARCoreに興味がある人のために
AR初心者の私が、1日あれば大体できることをまとめてみました

7e6a79d3fd57e49905f6f4fe53550021?s=128

zukkey

August 23, 2018
Tweet

Transcript

  1. 18.

    18 wϨϯμϦϯάͨ͠΋ͷΛԾ૝ΦϒδΣΫτͷ/PEFʹͯ͠ ਌ͷ/PEF ΞϯΧʔ ʹ௥Ճ͢Δ 7JFX"DUJWJUZKBWB TransformableNode view = new

    TransformableNode(arFragment.getTransformationSystem()); view.setParent(anchorNode); view.setRenderable(viewRenderable); AndroidͷWidgetͷදࣔ
  2. 20.

    20 w࢛֯ΛྫʹͱΔͱɺԼهͷΑ͏ʹ.BUFSJBM'BDUPSZΫϥεΛ༻͍ͯ$PMPSΛࢦఆ͠ 7JFX"DUJWJUZKBWB MaterialFactory.makeOpaqueWithColor(this, new Color(android.graphics.Color.BLUE)) .thenAccept( material -> {

    blueSquareRenderable = ShapeFactory.makeCube(new Vector3(0.2f, 0.15f, 0.2f), new Vector3(0.0f, 0.15f, 0.0f), material); } ); ؙɺ࢛֯ɺԁபͳͲͷදࣔ
  3. 22.

    22 wؙ΍ԁபΛද͍ࣔͨ͠৔߹͸4IBQF'BDUPSZΫϥεʹ͋ΔNBLF4QIFSFͱ NBLF$ZMJOEFSΛ༻͍Δ͜ͱͰ࣮ݱͰ͖Δ #BMM"DUJWJUZKBWB ShapeFactory.makeSphere(0.1f, new Vector3(0.0f, 0.15f, 0.0f), material);

    }); $ZMJOEFS"DUJWJUZKBWB ShapeFactory.makeCylinder(0.1f, 0.3f, new Vector3(0.0f, 0.15f, 0.0f), material); ؙɺ࢛֯ɺԁபͳͲͷදࣔ
  4. 29.

    29 w%σʔλͷϦιʔεΛಡΈࠐΜͰϨϯμϦϯά͢Δ 3DϞσϧͷදࣔ .PEFM"DUJWJUZKBWB ModelRenderable.builder() .setSource(this, R.raw.andy) .build() .thenAccept(renderable ->

    andyRenderable = renderable) .exceptionally( throwable -> { Toast toast = Toast.makeText(this, "Unable to load andy renderable", Toast.LENGTH_LONG); toast.setGravity(Gravity.CENTER, 0, 0); toast.show(); return null; });
  5. 30.

    30 w%σʔλͷϦιʔεΛಡΈࠐΜͰϨϯμϦϯά͢Δ 3DϞσϧͷදࣔ .PEFM"DUJWJUZKBWB ModelRenderable.builder() .setSource(this, R.raw.andy) .build() .thenAccept(renderable ->

    andyRenderable = renderable) .exceptionally( throwable -> { Toast toast = Toast.makeText(this, "Unable to load andy renderable", Toast.LENGTH_LONG); toast.setGravity(Gravity.CENTER, 0, 0); toast.show(); return null; });