Contenu connexe
Similaire à A frameハンズオン 20170129 (20)
A frameハンズオン 20170129
- 3. 自己紹介
杉井 庸一 @ 修羅の国( 広島に単身出張中 )
興味本位で買ったRicohThetaS、の画像を見るお手軽なViewer
がほしくて、いろいろ調べてA-Frameに出会う。
ブラウザで手軽にコンテンツを作れるのが面白くて、いろいろ
作ってFacrebookで公開していたら、いつの間にかハンズオンを
開催@福岡することに。
仕事はバックエンドのシステムエンジニア。JavaやらSQLやらを好
みます。実はA-Frameに出会うまでJavascript使ったことなかった
です。
- 22. A-frame inspector
Ctrl + Alt + iと入力する。
ブラウザ上で、エンティティの新規作成や修正
を行うことができます。
移動:右クリック+マウス移動
回転:左クリック+マウス移動
前後:マウスホイール
作成したエンティティはHTML形式でExportす
ることもできます。
- 29. ソース構成
添付のZIPファイルをA-Frameボイラープレート
フォルダ直下に解凍する。
> npm start で起動し、
http://localhost:3000/maze/ へアクセスする。
迷路ロジックは実装済み。3Dシーンに迷路エ
ンティティを作成していきます。
修正するのはindex.htmlだけです。
本ページに添付している「ソースファイル」か
ら取得してください。
aframe-boilerplate-master
│ .gitignore
│ AFRAME_SITE.yml
│ index.html
│ LICENSE
│ package.json
│ README.md
└─maze
│ index.html
└─js
maze.js
- 30. 実装手順1
var sceneEntity = document.querySelector("#maze-scene");
後でA-BOXを追加するため、追加先のA-SCENEを
取得します。
IDの設定に間違いがないことを確認しましょう。
- 31. 実装手順2
var wall = document.createElement("a-box");
sceneEntity.appendChild(wall);
A-BOXエンティティを作成し、A-SCENEに追加します。
足元に小さなBOXが現れています。
A-BOXの場所を設定しましょう。
- 34. 実装手順5
posX + " " + width/2 + " " + posZ
A-BOXエンティティ追加前に、Y軸位置を調整して
壁をすべて床の上に表示します。設定値は、変数
設定(width)している壁幅を利用しましょう。
見た目は迷路となりましたが、壁を突き抜けます。
- 46. 実装手順5
} else {
if (this.el.object3D.visible == true) {
this.el.object3D.visible = false;
}
}
逆に以下の場合に、壁を非表示とします。
・カメラと壁の距離が10m以上
・壁が表示状態のもの
Notes de l'éditeur
- WebVR対応ブラウザ情報
https://iswebvrready.org/
- https://developer.mozilla.org/ja/docs/Games/Techniques/3D_on_the_web/Building_up_a_basic_demo_with_A-Frame
https://framesynthesis.jp/tech/2015/12/aframe/
- 公式サイトのblogの情報は有益です。様々なA-Frameの使い方や新しいライブラリの紹介など週1で更新されていますので、チェックすると面白いかと。
- http://www4.atwiki.jp/tmagic_teu/pages/84.html
- Easingについて http://easings.net/ja
A-Frame RoadMap https://github.com/aframevr/aframe/blob/master/ROADMAP.md
- https://github.com/aframevr/aframe-inspector
- http://mikan-daisuki.hatenablog.com/entry/2015/10/22/220439
- aframe-extras
https://github.com/donmccurdy/aframe-extras
aframe-bmfont-text-component
https://github.com/bryik/aframe-bmfont-text-component
aframe-look-at-component
https://github.com/ngokevin/aframe-look-at-component
aframe-crawling-cursor
http://vr-lab.voyagegroup.com/entry/2016/11/02/101503
aframe-leap-hands
https://github.com/openleap/aframe-leap-hands
- 詳しく知りたい人は、以下のサイトで学習できます。
https://aframe.io/docs/0.4.0/guides/building-with-components.html
- Javascriptデバッグ
http://qiita.com/snoguchi/items/8f6bb62a3166eca23ac3
Android Chromeのデバッグ
http://qiita.com/hojishi/items/12b726f8b02ef3d713e4