|
@@ -1,56 +1,88 @@
|
|
|
-# A-Frame & VWF simple scene
|
|
|
-# Copyright 2017 Krestianstvo.org project
|
|
|
+# A-Frame & VWF simple scene in AR
|
|
|
+# Copyright 2018 Krestianstvo.org project
|
|
|
---
|
|
|
extends: http://vwf.example.com/aframe/ascene.vwf
|
|
|
properties:
|
|
|
transparent: true
|
|
|
+ assets: "assets.json"
|
|
|
children:
|
|
|
- arcamera:
|
|
|
- extends: http://vwf.example.com/aframe/acamera.vwf
|
|
|
+ arcamera:
|
|
|
+ extends: http://vwf.example.com/aframe/abox.vwf
|
|
|
properties:
|
|
|
- look-controls-enabled: false
|
|
|
- wasd-controls-enabled: false
|
|
|
- user-height: 0
|
|
|
+ position: "0 0 0"
|
|
|
+ rotation: "0 0 0"
|
|
|
+ opacity: 0.5
|
|
|
+ depth: 0.3
|
|
|
+ width: 0.3
|
|
|
+ height: 0.5
|
|
|
+ children:
|
|
|
+ camera:
|
|
|
+ extends: http://vwf.example.com/aframe/acamera.vwf
|
|
|
+ properties:
|
|
|
+ look-controls-enabled: false
|
|
|
+ wasd-controls-enabled: false
|
|
|
+ user-height: 0
|
|
|
aranchor:
|
|
|
extends: http://vwf.example.com/aframe/a-arjs-anchor.vwf
|
|
|
properties:
|
|
|
+ position: "0 0 -5"
|
|
|
+ hit-testing-enabled: true
|
|
|
+ changeMatrixMode: "modelViewMatrix"
|
|
|
+ preset: "hiro"
|
|
|
+ children:
|
|
|
+ model:
|
|
|
+ extends: http://vwf.example.com/aframe/aobjmodel.vwf
|
|
|
+ properties:
|
|
|
+ src: "#nwtree-obj"
|
|
|
+ mtl: "#nwtree-mtl"
|
|
|
+ position: "0 0.5 0"
|
|
|
+ rotation: "0 -45 0"
|
|
|
+ scale: "2 2 2"
|
|
|
+ children:
|
|
|
+ interpolation:
|
|
|
+ extends: http://vwf.example.com/aframe/interpolation-component.vwf
|
|
|
+ properties:
|
|
|
+ enabled: true
|
|
|
+ methods:
|
|
|
+ run:
|
|
|
+ body: |
|
|
|
+ var time = vwf.now;
|
|
|
+ let rot = this.rotation; //AFRAME.utils.coordinates.parse(this.rotation);
|
|
|
+ this.rotation = [rot[0], rot[1]+2, rot[2]];
|
|
|
+ this.future( 0.05 ).run(); // schedule the next step
|
|
|
+ aranchor2:
|
|
|
+ extends: http://vwf.example.com/aframe/a-arjs-anchor.vwf
|
|
|
+ properties:
|
|
|
+ position: "-5 0 -5"
|
|
|
hit-testing-enabled: true
|
|
|
- changeMatrixMode: "cameraTransformMatrix"
|
|
|
+ changeMatrixMode: "modelViewMatrix"
|
|
|
+ preset: "kanji"
|
|
|
children:
|
|
|
- sphere:
|
|
|
- extends: http://vwf.example.com/aframe/asphere.vwf
|
|
|
+ alltext:
|
|
|
+ extends: http://vwf.example.com/aframe/aentity.vwf
|
|
|
properties:
|
|
|
- position: "0 0 0"
|
|
|
- radius: 1
|
|
|
+ position: [0,-1,0]
|
|
|
+ rotation: [-15,0,0]
|
|
|
children:
|
|
|
- material:
|
|
|
- extends: http://vwf.example.com/aframe/aMaterialComponent.vwf
|
|
|
+ spaceText:
|
|
|
+ extends: http://vwf.example.com/aframe/atext.vwf
|
|
|
properties:
|
|
|
- color: "#e0e014"
|
|
|
- wireframe: true
|
|
|
- box2:
|
|
|
- extends: http://vwf.example.com/aframe/abox.vwf
|
|
|
+ value: "Happy New Year 2019!"
|
|
|
+ color: "#00ffa5"
|
|
|
+ position: [-2,1,0]
|
|
|
+ rotation: "0 0 15"
|
|
|
+ scale: "4 4 4"
|
|
|
+ side: "double"
|
|
|
+ spaceText2:
|
|
|
+ extends: http://vwf.example.com/aframe/atext.vwf
|
|
|
properties:
|
|
|
- position: "0 0.5 0"
|
|
|
- depth: 1
|
|
|
- children:
|
|
|
- material:
|
|
|
- extends: http://vwf.example.com/aframe/aMaterialComponent.vwf
|
|
|
- properties:
|
|
|
- color: "#2167a5"
|
|
|
- interpolation:
|
|
|
- extends: http://vwf.example.com/aframe/interpolation-component.vwf
|
|
|
- properties:
|
|
|
- enabled: true
|
|
|
- methods:
|
|
|
- run:
|
|
|
- body: |
|
|
|
- var time = vwf.now;
|
|
|
- let rot = this.rotation; //AFRAME.utils.coordinates.parse(this.rotation);
|
|
|
- this.rotation = [rot[0], rot[1], Math.sin(time)*100];
|
|
|
- this.future( 0.05 ).run(); // schedule the next step
|
|
|
+ value: "Project by Krestianstvo.org"
|
|
|
+ color: "#98b099"
|
|
|
+ position: [0,0.5,0]
|
|
|
+ scale: "2 2 2"
|
|
|
+ side: "double"
|
|
|
methods:
|
|
|
initialize:
|
|
|
body: |
|
|
|
- let runBox = vwf_view.kernel.find("", "/aranchor/sphere/box2")[0];
|
|
|
- vwf_view.kernel.callMethod(runBox, "run");
|
|
|
+ var runModel = vwf_view.kernel.find("", "/aranchor/model")[0];
|
|
|
+ vwf_view.kernel.callMethod(runModel, "run");
|