12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394 |
- # A-Frame & VWF simple scene
- # Copyright 2017 Krestianstvo.org project
- ---
- extends: http://vwf.example.com/aframe/ascene.vwf
- properties:
- fog: "type: linear; color: #ECECEC; far: 9; near: 0"
- children:
- 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]
- color: "#3c7249"
- depth: 2
- height: 1
- width: 1
- clickable: true
- events:
- clickEvent:
- methods:
- clickEventMethod:
- body: |
- if (this.clickable) {
- let genColor = this.generateColor();
- this.color = genColor
- }
- generateColor:
- body: |
- var letters = '0123456789ABCDEF';
- var color = '#';
- for (var i = 0; i < 6; i++) {
- color += letters[Math.floor(this.random() * 16)];
- } return color
- scripts:
- - |
- this.clickEvent = function(){
- this.clickEventMethod();
- }
- sphere:
- extends: http://vwf.example.com/aframe/asphere.vwf
- properties:
- position: [1, 1.25, -4]
- color: "#e0e014"
- radius: 1
- wireframe: true
- children:
- box2:
- extends: http://vwf.example.com/aframe/abox.vwf
- properties:
- position: [2, -1.25, 0]
- color: "#2167a5"
- depth: 1
- interpolation: "50ms"
- methods:
- run:
- body: |
- var time = vwf.now;
- this.position = [this.position[0], this.position[1], Math.sin(time)]
- this.future( 0.01 ).run(); // schedule the next step
- sky:
- extends: http://vwf.example.com/aframe/asky.vwf
- properties:
- color: "#ECECEC"
- camentity:
- extends: http://vwf.example.com/aframe/aentity.vwf
- properties:
- position: [0, 0, 0]
- children:
- camera:
- extends: http://vwf.example.com/aframe/acamera.vwf
- properties:
- look-controls-enabled: true
- forAvatar: true
- children:
- cursor:
- extends: http://vwf.example.com/aframe/acursor.vwf
- methods:
- initialize:
- body: |
- var runBox = vwf_view.kernel.find("", "/sphere/box2")[0];
- console.log(runBox);
- vwf_view.kernel.callMethod(runBox, "run");
|