index.vwf.yaml 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  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: 30; near: 0"
  7. assets: "assets.json"
  8. children:
  9. myLight:
  10. extends: http://vwf.example.com/aframe/alight.vwf
  11. properties:
  12. type: "point"
  13. color: "white"
  14. position: "0 10 5"
  15. rotation: "0 0 0"
  16. model:
  17. extends: http://vwf.example.com/aframe/acolladamodel.vwf
  18. properties:
  19. src: "#plane"
  20. position: "-1.0 1.7 -3"
  21. rotation: "0 -45 0"
  22. scale: "10 10 10"
  23. spaceText:
  24. extends: http://vwf.example.com/aframe/atext.vwf
  25. properties:
  26. value: "Virtual World Framework & A-Frame"
  27. color: "#ddd"
  28. position: "-2 2.5 -2"
  29. spaceText2:
  30. extends: http://vwf.example.com/aframe/atext.vwf
  31. properties:
  32. value: "Project by Krestianstvo.org"
  33. color: "#aaa"
  34. position: "1 3 -4"
  35. boxAnim:
  36. extends: http://vwf.example.com/aframe/abox.vwf
  37. properties:
  38. position: "0 0 -3"
  39. rotation: "0 0 0"
  40. color: "#3c7249"
  41. depth: 2
  42. height: 1
  43. width: 1
  44. box:
  45. extends: http://vwf.example.com/aframe/abox.vwf
  46. properties:
  47. position: "-1 0.5 -3"
  48. rotation: "0 -30 0"
  49. color: "#3c7249"
  50. depth: 2
  51. height: 1
  52. width: 1
  53. clickable: true
  54. events:
  55. clickEvent:
  56. methods:
  57. clickEventMethod:
  58. body: |
  59. if (this.clickable) {
  60. let genColor = this.generateColor();
  61. this.color = genColor
  62. }
  63. generateColor:
  64. body: |
  65. var letters = '0123456789ABCDEF';
  66. var color = '#';
  67. for (var i = 0; i < 6; i++) {
  68. color += letters[Math.floor(this.random() * 16)];
  69. } return color
  70. scripts:
  71. - |
  72. this.clickEvent = function(){
  73. this.clickEventMethod();
  74. }
  75. controller:
  76. extends: http://vwf.example.com/aframe/aentity.vwf
  77. properties:
  78. position: "0 0 -1"
  79. color: "green"
  80. depth: 1
  81. children:
  82. gearvr-controls:
  83. extends: http://vwf.example.com/aframe/gearvr-controlsComponent.vwf
  84. sphere:
  85. extends: http://vwf.example.com/aframe/asphere.vwf
  86. properties:
  87. position: "1 1.25 -4"
  88. color: "#e0e014"
  89. radius: 1
  90. wireframe: true
  91. children:
  92. box2:
  93. extends: http://vwf.example.com/aframe/abox.vwf
  94. properties:
  95. src: "#bg"
  96. position: "2 -0.75 0"
  97. color: "#2167a5"
  98. depth: 1
  99. children:
  100. interpolation:
  101. extends: http://vwf.example.com/aframe/interpolation-component.vwf
  102. properties:
  103. enabled: true
  104. duration: 50
  105. deltaPos: 0.1
  106. deltaRot: 1
  107. methods:
  108. run:
  109. body: |
  110. var time = vwf.now;
  111. let pos = AFRAME.utils.coordinates.parse(this.position);
  112. this.position = [pos.x, pos.y, Math.sin(time)]
  113. this.future( 0.01 ).run(); // schedule the next step
  114. sky:
  115. extends: http://vwf.example.com/aframe/asky.vwf
  116. properties:
  117. color: "#ECECEC"
  118. src: "#sky"
  119. fog: false
  120. groundPlane:
  121. extends: http://vwf.example.com/aframe/aplane.vwf
  122. properties:
  123. height: 50
  124. width: 50
  125. repeat: "10 10"
  126. rotation: "-90 0 0"
  127. color: "white"
  128. wireframe: false
  129. src: "#bg2"
  130. methods:
  131. initialize:
  132. body: |
  133. var runBox = vwf_view.kernel.find("", "/sphere/box2")[0];
  134. console.log(runBox);
  135. vwf_view.kernel.callMethod(runBox, "run");