index.vwf.json 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197
  1. {
  2. "extends": "proxy/aframe/ascene.vwf",
  3. "properties": {
  4. "transparent": true
  5. },
  6. "methods": {
  7. "initialize": {
  8. "body": "var runBox = vwf.find(\"\", \"/sphere/box2\")[0];\n console.log(runBox);\n vwf.callMethod(runBox, \"run\");\n",
  9. "type": "application/javascript"
  10. }
  11. },
  12. "children": {
  13. "fog": {
  14. "extends": "proxy/aframe/aSceneFogComponent.vwf",
  15. "type": "component",
  16. "properties": {
  17. "fogType": "linear",
  18. "fogColor": "#ECECEC",
  19. "far": 9,
  20. "near": 0
  21. }
  22. },
  23. "sky": {
  24. "extends": "proxy/aframe/asky.vwf",
  25. "children": {
  26. "material": {
  27. "extends": "proxy/aframe/aMaterialComponent.vwf",
  28. "properties": {
  29. "color": "#ECECEC",
  30. "side": "back",
  31. "fog": false,
  32. "shader": "flat"
  33. }
  34. }
  35. }
  36. },
  37. "light1": {
  38. "extends": "proxy/aframe/alight.vwf",
  39. "properties": {
  40. "type": "ambient",
  41. "color": "#BBB"
  42. }
  43. },
  44. "light2": {
  45. "extends": "proxy/aframe/alight.vwf",
  46. "properties": {
  47. "type": "directional",
  48. "color": "#FFF",
  49. "intensity": "0.6",
  50. "position": [
  51. -0.5,
  52. 1,
  53. 1
  54. ]
  55. }
  56. },
  57. "spaceText": {
  58. "extends": "proxy/aframe/atext.vwf",
  59. "properties": {
  60. "value": "Virtual World Framework & A-Frame",
  61. "color": "#b74217",
  62. "position": [
  63. -2,
  64. 2.5,
  65. -2
  66. ]
  67. }
  68. },
  69. "spaceText2": {
  70. "extends": "proxy/aframe/atext.vwf",
  71. "properties": {
  72. "value": "Project by Krestianstvo.org",
  73. "color": "#305b32",
  74. "position": [
  75. 1,
  76. 3,
  77. -4
  78. ]
  79. }
  80. },
  81. "box": {
  82. "extends": "proxy/aframe/abox.vwf",
  83. "properties": {
  84. "position": [
  85. -1,
  86. 0.5,
  87. -3
  88. ],
  89. "rotation": [
  90. 0,
  91. -30,
  92. 0
  93. ],
  94. "depth": "2",
  95. "height": "1",
  96. "width": "1",
  97. "class": "clickable intersectable"
  98. },
  99. "methods": {
  100. "clickEventMethod": {
  101. "body": " let genColor = this.generateColor();\n this.material.color = genColor\n",
  102. "type": "application/javascript"
  103. },
  104. "intersectEventMethod": {
  105. "body": " this.material.opacity = 0.7\n",
  106. "type": "application/javascript"
  107. },
  108. "clearIntersectEventMethod": {
  109. "body": " this.material.opacity = 1.0\n",
  110. "type": "application/javascript"
  111. },
  112. "generateColor": {
  113. "body": " var letters = '0123456789ABCDEF';\n var color = '#';\n for (var i = 0; i < 6; i++) {\n color += letters[Math.floor(this.random() * 16)];\n } return color\n",
  114. "type": "application/javascript"
  115. }
  116. },
  117. "events": {
  118. "clickEvent": {},
  119. "intersectEvent": {},
  120. "clearIntersectEvent": {}
  121. },
  122. "children": {
  123. "material": {
  124. "extends": "proxy/aframe/aMaterialComponent.vwf",
  125. "properties": {
  126. "color": "#3c7249",
  127. "transparent": true
  128. }
  129. },
  130. "raycaster-listener": {
  131. "extends": "proxy/aframe/app-raycaster-listener-component.vwf",
  132. "type": "component"
  133. },
  134. "cursor-listener": {
  135. "extends": "proxy/aframe/app-cursor-listener-component.vwf",
  136. "type": "component"
  137. }
  138. }
  139. },
  140. "sphere": {
  141. "extends": "proxy/aframe/asphere.vwf",
  142. "properties": {
  143. "position": [
  144. 1,
  145. 1.25,
  146. -4
  147. ],
  148. "radius": "1"
  149. },
  150. "children": {
  151. "material": {
  152. "extends": "proxy/aframe/aMaterialComponent.vwf",
  153. "properties": {
  154. "color": "#e0e014",
  155. "wireframe": true
  156. }
  157. },
  158. "box2": {
  159. "extends": "proxy/aframe/abox.vwf",
  160. "properties": {
  161. "position": [
  162. 2,
  163. -0.75,
  164. -0.590282678604126
  165. ],
  166. "depth": "1",
  167. "rotation": [
  168. 0,
  169. 0,
  170. -59.02826690673828
  171. ]
  172. },
  173. "methods": {
  174. "run": {
  175. "body": " var time = this.time;\n let rot = this.rotation; //AFRAME.utils.coordinates.parse(this.rotation);\n let pos = this.position; //AFRAME.utils.coordinates.parse(this.position);\n this.position = [pos.x, pos.y, Math.sin(time)];\n this.rotation = [rot.x, rot.y, Math.sin(time)*100];\n this.future( 0.01 ).run();\n",
  176. "type": "application/javascript"
  177. }
  178. },
  179. "children": {
  180. "material": {
  181. "extends": "proxy/aframe/aMaterialComponent.vwf",
  182. "properties": {
  183. "color": "#2167a5"
  184. }
  185. },
  186. "interpolation": {
  187. "extends": "proxy/aframe/interpolation-component.vwf",
  188. "properties": {
  189. "enabled": true
  190. }
  191. }
  192. }
  193. }
  194. }
  195. }
  196. }
  197. }