index.vwf.yaml 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  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. methods:
  66. run:
  67. body: |
  68. var time = vwf.now;
  69. this.position = [this.position[0], this.position[1], Math.sin(time)]
  70. this.future( 0.05 ).run(); // schedule the next step
  71. sky:
  72. extends: http://vwf.example.com/aframe/asky.vwf
  73. properties:
  74. color: "#ECECEC"
  75. camentity:
  76. extends: http://vwf.example.com/aframe/aentity.vwf
  77. properties:
  78. position: [0, 0, 0]
  79. children:
  80. camera:
  81. extends: http://vwf.example.com/aframe/acamera.vwf
  82. properties:
  83. look-controls-enabled: true
  84. forAvatar: true
  85. children:
  86. cursor:
  87. extends: http://vwf.example.com/aframe/acursor.vwf
  88. methods:
  89. initialize:
  90. body: |
  91. var runBox = vwf_view.kernel.find("", "/sphere/box2")[0];
  92. console.log(runBox);
  93. vwf_view.kernel.callMethod(runBox, "run");