index.vwf.yaml 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  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. box:
  36. extends: http://vwf.example.com/aframe/abox.vwf
  37. properties:
  38. position: [-1, 0.5, -3]
  39. rotation: [0, -30, 0]
  40. color: "#3c7249"
  41. depth: 2
  42. height: 1
  43. width: 1
  44. clickable: true
  45. events:
  46. clickEvent:
  47. methods:
  48. clickEventMethod:
  49. body: |
  50. if (this.clickable) {
  51. let genColor = this.generateColor();
  52. this.color = genColor
  53. }
  54. generateColor:
  55. body: |
  56. var letters = '0123456789ABCDEF';
  57. var color = '#';
  58. for (var i = 0; i < 6; i++) {
  59. color += letters[Math.floor(this.random() * 16)];
  60. } return color
  61. scripts:
  62. - |
  63. this.clickEvent = function(){
  64. this.clickEventMethod();
  65. }
  66. sphere:
  67. extends: http://vwf.example.com/aframe/asphere.vwf
  68. properties:
  69. position: [1, 1.25, -4]
  70. color: "#e0e014"
  71. radius: 1
  72. wireframe: true
  73. children:
  74. box2:
  75. extends: http://vwf.example.com/aframe/abox.vwf
  76. properties:
  77. src: "#bg"
  78. position: [2, -0.75, 0]
  79. color: "#2167a5"
  80. depth: 1
  81. methods:
  82. run:
  83. body: |
  84. var time = vwf.now;
  85. this.position = [this.position[0], this.position[1], Math.sin(time)]
  86. this.future( 0.05 ).run(); // schedule the next step
  87. sky:
  88. extends: http://vwf.example.com/aframe/asky.vwf
  89. properties:
  90. color: "#ECECEC"
  91. src: "#sky"
  92. fog: false
  93. groundPlane:
  94. extends: http://vwf.example.com/aframe/aplane.vwf
  95. properties:
  96. height: 50
  97. width: 50
  98. repeat: "10 10"
  99. rotation: [-90, 0, 0]
  100. color: "white"
  101. wireframe: false
  102. src: "#bg2"
  103. camentity:
  104. extends: http://vwf.example.com/aframe/aentity.vwf
  105. properties:
  106. position: [0, 0, 0]
  107. children:
  108. camera:
  109. extends: http://vwf.example.com/aframe/acamera.vwf
  110. properties:
  111. look-controls-enabled: true
  112. forAvatar: true
  113. children:
  114. cursor:
  115. extends: http://vwf.example.com/aframe/acursor.vwf
  116. methods:
  117. initialize:
  118. body: |
  119. var runBox = vwf_view.kernel.find("", "/sphere/box2")[0];
  120. console.log(runBox);
  121. vwf_view.kernel.callMethod(runBox, "run");