index.vwf.yaml 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. # A-Frame & VWF simple scene
  2. # Copyright 2017 Krestianstvo.org project
  3. ---
  4. extends: http://vwf.example.com/aframe/ascene.vwf
  5. properties:
  6. fog: "type: linear; color: #ECECEC; far: 9; near: 0"
  7. children:
  8. spaceText:
  9. extends: http://vwf.example.com/aframe/atext.vwf
  10. properties:
  11. value: "Virtual World Framework & A-Frame"
  12. color: "#b74217"
  13. position: [-2, 2.5, -2]
  14. spaceText2:
  15. extends: http://vwf.example.com/aframe/atext.vwf
  16. properties:
  17. value: "Project by Krestianstvo.org"
  18. color: "#305b32"
  19. position: [1, 3, -4]
  20. box:
  21. extends: http://vwf.example.com/aframe/abox.vwf
  22. properties:
  23. position: [-1, 0.5, -3]
  24. rotation: [0, -30, 0]
  25. color: "#3c7249"
  26. depth: 2
  27. height: 1
  28. width: 1
  29. clickable: true
  30. events:
  31. clickEvent:
  32. methods:
  33. clickEventMethod:
  34. body: |
  35. if (this.clickable) {
  36. let genColor = this.generateColor();
  37. this.color = genColor
  38. }
  39. generateColor:
  40. body: |
  41. var letters = '0123456789ABCDEF';
  42. var color = '#';
  43. for (var i = 0; i < 6; i++) {
  44. color += letters[Math.floor(this.random() * 16)];
  45. } return color
  46. scripts:
  47. - |
  48. this.clickEvent = function(){
  49. this.clickEventMethod();
  50. }
  51. sphere:
  52. extends: http://vwf.example.com/aframe/asphere.vwf
  53. properties:
  54. position: [1, 1.25, -4]
  55. color: "#e0e014"
  56. radius: 1
  57. wireframe: true
  58. children:
  59. box2:
  60. extends: http://vwf.example.com/aframe/abox.vwf
  61. properties:
  62. position: [2, -1.25, 0]
  63. color: "#2167a5"
  64. depth: 1
  65. interpolation: "50ms"
  66. methods:
  67. run:
  68. body: |
  69. var time = vwf.now;
  70. this.position = [this.position[0], this.position[1], Math.sin(time)]
  71. this.future( 0.01 ).run(); // schedule the next step
  72. sky:
  73. extends: http://vwf.example.com/aframe/asky.vwf
  74. properties:
  75. color: "#ECECEC"
  76. camentity:
  77. extends: http://vwf.example.com/aframe/aentity.vwf
  78. properties:
  79. position: [0, 0, 0]
  80. children:
  81. camera:
  82. extends: http://vwf.example.com/aframe/acamera.vwf
  83. properties:
  84. look-controls-enabled: true
  85. forAvatar: true
  86. children:
  87. cursor:
  88. extends: http://vwf.example.com/aframe/acursor.vwf
  89. methods:
  90. initialize:
  91. body: |
  92. var runBox = vwf_view.kernel.find("", "/sphere/box2")[0];
  93. console.log(runBox);
  94. vwf_view.kernel.callMethod(runBox, "run");