123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132 |
- # A-Frame & VWF simple scene
- # Copyright 2017 Krestianstvo.org project
- ---
- extends: http://vwf.example.com/aframe/ascene.vwf
- properties:
- transparent: true
- children:
- fog:
- extends: http://vwf.example.com/aframe/aSceneFogComponent.vwf
- type: "component"
- properties:
- fogType: "linear"
- fogColor: "#ECECEC"
- far: 9
- near: 0
- sky:
- extends: http://vwf.example.com/aframe/asky.vwf
- properties:
- children:
- material:
- extends: http://vwf.example.com/aframe/aMaterialComponent.vwf
- properties:
- color: "#ECECEC"
- side: "back"
- fog: false
- light1:
- extends: http://vwf.example.com/aframe/alight.vwf
- properties:
- type: "ambient"
- color: "#BBB"
- light2:
- extends: http://vwf.example.com/aframe/alight.vwf
- properties:
- type: "directional"
- color: "#FFF"
- intensity: 0.6
- position: "-0.5 1 1"
- spaceText:
- extends: http://vwf.example.com/aframe/atext.vwf
- properties:
- value: "Virtual World Framework & A-Frame"
- color: "#b74217"
- position: "-2 2.5 -2"
- spaceText2:
- extends: http://vwf.example.com/aframe/atext.vwf
- properties:
- value: "Project by Krestianstvo.org"
- color: "#305b32"
- position: "1 3 -4"
- box:
- extends: http://vwf.example.com/aframe/abox.vwf
- properties:
- position: "-1 0.5 -3"
- rotation: "0 -30 0"
- depth: 2
- height: 1
- width: 1
- class: "clickable intersectable"
- children:
- material:
- extends: http://vwf.example.com/aframe/aMaterialComponent.vwf
- properties:
- color: "#3c7249"
- transparent: true
- raycaster-listener:
- extends: http://vwf.example.com/aframe/app-raycaster-listener-component.vwf
- type: "component"
- cursor-listener:
- extends: http://vwf.example.com/aframe/app-cursor-listener-component.vwf
- type: "component"
- events:
- clickEvent:
- intersectEvent:
- clearIntersectEvent:
- methods:
- clickEventMethod:
- body: |
- let genColor = this.generateColor();
- this.material.color = genColor
- intersectEventMethod:
- body: |
- this.material.opacity = 0.7
- clearIntersectEventMethod:
- body: |
- this.material.opacity = 1.0
- generateColor:
- body: |
- var letters = '0123456789ABCDEF';
- var color = '#';
- for (var i = 0; i < 6; i++) {
- color += letters[Math.floor(this.random() * 16)];
- } return color
- sphere:
- extends: http://vwf.example.com/aframe/asphere.vwf
- properties:
- position: "1 1.25 -4"
- radius: 1
- children:
- material:
- extends: http://vwf.example.com/aframe/aMaterialComponent.vwf
- properties:
- color: "#e0e014"
- wireframe: true
- box2:
- extends: http://vwf.example.com/aframe/abox.vwf
- properties:
- position: "2 -0.75 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);
- let pos = this.position; //AFRAME.utils.coordinates.parse(this.position);
- this.position = [pos[0], pos[1], Math.sin(time)];
- this.rotation = [rot[0], rot[1], Math.sin(time)*100];
- this.future( 0.01 ).run();
- methods:
- initialize:
- body: |
- var runBox = vwf.find("", "/sphere/box2")[0];
- console.log(runBox);
- vwf.callMethod(runBox, "run");
|