index.vwf.yaml 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  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. sphere:
  76. extends: http://vwf.example.com/aframe/asphere.vwf
  77. properties:
  78. position: [1, 1.25, -4]
  79. color: "#e0e014"
  80. radius: 1
  81. wireframe: true
  82. children:
  83. box2:
  84. extends: http://vwf.example.com/aframe/abox.vwf
  85. properties:
  86. src: "#bg"
  87. position: [2, -0.75, 0]
  88. color: "#2167a5"
  89. depth: 1
  90. children:
  91. interpolation:
  92. extends: http://vwf.example.com/aframe/interpolation-component.vwf
  93. properties:
  94. enabled: true
  95. duration: 50
  96. deltaPos: 0.1
  97. deltaRot: 1
  98. methods:
  99. run:
  100. body: |
  101. var time = vwf.now;
  102. this.position = [this.position[0], this.position[1], Math.sin(time)]
  103. this.future( 0.01 ).run(); // schedule the next step
  104. sky:
  105. extends: http://vwf.example.com/aframe/asky.vwf
  106. properties:
  107. color: "#ECECEC"
  108. src: "#sky"
  109. fog: false
  110. groundPlane:
  111. extends: http://vwf.example.com/aframe/aplane.vwf
  112. properties:
  113. height: 50
  114. width: 50
  115. repeat: "10 10"
  116. rotation: [-90, 0, 0]
  117. color: "white"
  118. wireframe: false
  119. src: "#bg2"
  120. methods:
  121. initialize:
  122. body: |
  123. var runBox = vwf_view.kernel.find("", "/sphere/box2")[0];
  124. console.log(runBox);
  125. vwf_view.kernel.callMethod(runBox, "run");