rotationX.vwf.yaml 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  1. # Copyright 2012 United States Government, as represented by the Secretary of Defense, Under
  2. # Secretary of Defense (Personnel & Readiness).
  3. #
  4. # Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
  5. # in compliance with the License. You may obtain a copy of the License at
  6. #
  7. # http://www.apache.org/licenses/LICENSE-2.0
  8. #
  9. # Unless required by applicable law or agreed to in writing, software distributed under the License
  10. # is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
  11. # or implied. See the License for the specific language governing permissions and limitations under
  12. # the License.
  13. ---
  14. extends: http://vwf.example.com/node3.vwf
  15. implements:
  16. - http://vwf.example.com/spin-on-move.vwf
  17. methods:
  18. createGeometry:
  19. deleteGeometry:
  20. properties:
  21. spin-axis: [ 1, 0, 0 ]
  22. spin-rate: 100
  23. spin-inputDim: "xy"
  24. scripts:
  25. - |
  26. this.initialize = function() {
  27. //console.info( "initialize rotationX.vwf" );
  28. }
  29. this.createGeometry = function() {
  30. if ( this.parent.ttPoints ) {
  31. var pos = [];
  32. var faces;
  33. pos.push( this.parent.ttPositions[34][0] );
  34. pos.push( this.parent.ttPositions[34][1] ); // 0
  35. pos.push( this.parent.ttPositions[34][2] );
  36. pos.push( this.parent.ttPositions[35][0] );
  37. pos.push( this.parent.ttPositions[35][1] ); // 1
  38. pos.push( this.parent.ttPositions[35][2] );
  39. pos.push( this.parent.ttPositions[37][0] );
  40. pos.push( this.parent.ttPositions[37][1] ); // 2
  41. pos.push( this.parent.ttPositions[37][2] );
  42. pos.push( this.parent.ttPositions[36][0] );
  43. pos.push( this.parent.ttPositions[36][1] ); // 3
  44. pos.push( this.parent.ttPositions[36][2] );
  45. faces = [ 0, 3, 1, 1, 3, 2 ];
  46. pos.push( this.parent.ttPositions[33][0] );
  47. pos.push( this.parent.ttPositions[33][1] ); // 4
  48. pos.push( this.parent.ttPositions[33][2] );
  49. pos.push( this.parent.ttPositions[32][0] );
  50. pos.push( this.parent.ttPositions[32][1] ); // 5
  51. pos.push( this.parent.ttPositions[32][2] );
  52. pos.push( this.parent.ttPositions[38][0] );
  53. pos.push( this.parent.ttPositions[38][1] ); // 6
  54. pos.push( this.parent.ttPositions[38][2] );
  55. pos.push( this.parent.ttPositions[39][0] );
  56. pos.push( this.parent.ttPositions[39][1] ); // 7
  57. pos.push( this.parent.ttPositions[39][2] );
  58. faces.push( 4, 7, 5, 5, 7, 6 );
  59. pos.push( this.parent.ttPositions[44][0] );
  60. pos.push( this.parent.ttPositions[44][1] ); // 8
  61. pos.push( this.parent.ttPositions[44][2] );
  62. pos.push( this.parent.ttPositions[45][0] );
  63. pos.push( this.parent.ttPositions[45][1] ); // 9
  64. pos.push( this.parent.ttPositions[45][2] );
  65. pos.push( this.parent.ttPositions[43][0] );
  66. pos.push( this.parent.ttPositions[43][1] ); // 10
  67. pos.push( this.parent.ttPositions[43][2] );
  68. pos.push( this.parent.ttPositions[42][0] );
  69. pos.push( this.parent.ttPositions[42][1] ); // 11
  70. pos.push( this.parent.ttPositions[42][2] );
  71. faces.push( 8, 11, 9, 9, 11, 10 );
  72. pos.push( this.parent.ttPositions[47][0] );
  73. pos.push( this.parent.ttPositions[47][1] ); // 12
  74. pos.push( this.parent.ttPositions[47][2] );
  75. pos.push( this.parent.ttPositions[46][0] );
  76. pos.push( this.parent.ttPositions[46][1] ); // 13
  77. pos.push( this.parent.ttPositions[46][2] );
  78. pos.push( this.parent.ttPositions[40][0] );
  79. pos.push( this.parent.ttPositions[40][1] ); // 14
  80. pos.push( this.parent.ttPositions[40][2] );
  81. pos.push( this.parent.ttPositions[41][0] );
  82. pos.push( this.parent.ttPositions[41][1] ); // 15
  83. pos.push( this.parent.ttPositions[41][2] );
  84. faces.push( 12, 15, 13, 13, 15, 14 );
  85. pos.push( this.parent.ttPositions[39][0] );
  86. pos.push( this.parent.ttPositions[39][1] ); // 16
  87. pos.push( this.parent.ttPositions[39][2] );
  88. pos.push( this.parent.ttPositions[54][0] );
  89. pos.push( this.parent.ttPositions[54][1] ); // 17
  90. pos.push( this.parent.ttPositions[54][2] );
  91. pos.push( this.parent.ttPositions[53][0] );
  92. pos.push( this.parent.ttPositions[53][1] ); // 18
  93. pos.push( this.parent.ttPositions[53][2] );
  94. pos.push( this.parent.ttPositions[33][0] );
  95. pos.push( this.parent.ttPositions[33][1] ); // 19
  96. pos.push( this.parent.ttPositions[33][2] );
  97. faces.push( 16, 19, 17, 17, 19, 18 );
  98. pos.push( this.parent.ttPositions[55][0] );
  99. pos.push( this.parent.ttPositions[55][1] ); // 20
  100. pos.push( this.parent.ttPositions[55][2] );
  101. pos.push( this.parent.ttPositions[47][0] );
  102. pos.push( this.parent.ttPositions[47][1] ); // 21
  103. pos.push( this.parent.ttPositions[47][2] );
  104. pos.push( this.parent.ttPositions[41][0] );
  105. pos.push( this.parent.ttPositions[41][1] ); // 22
  106. pos.push( this.parent.ttPositions[41][2] );
  107. pos.push( this.parent.ttPositions[52][0] );
  108. pos.push( this.parent.ttPositions[52][1] ); // 23
  109. pos.push( this.parent.ttPositions[52][2] );
  110. faces.push( 20, 23, 21, 21, 23, 22 );
  111. pos.push( this.parent.ttPositions[50][0] );
  112. pos.push( this.parent.ttPositions[50][1] ); // 24
  113. pos.push( this.parent.ttPositions[50][2] );
  114. pos.push( this.parent.ttPositions[49][0] );
  115. pos.push( this.parent.ttPositions[49][1] ); // 25
  116. pos.push( this.parent.ttPositions[49][2] );
  117. pos.push( this.parent.ttPositions[35][0] );
  118. pos.push( this.parent.ttPositions[35][1] ); // 26
  119. pos.push( this.parent.ttPositions[35][2] );
  120. pos.push( this.parent.ttPositions[37][0] );
  121. pos.push( this.parent.ttPositions[37][1] ); // 27
  122. pos.push( this.parent.ttPositions[37][2] );
  123. faces.push( 24, 27, 25, 25, 27, 26 );
  124. pos.push( this.parent.ttPositions[43][0] );
  125. pos.push( this.parent.ttPositions[43][1] ); // 28
  126. pos.push( this.parent.ttPositions[43][2] );
  127. pos.push( this.parent.ttPositions[48][0] );
  128. pos.push( this.parent.ttPositions[48][1] ); // 29
  129. pos.push( this.parent.ttPositions[48][2] );
  130. pos.push( this.parent.ttPositions[51][0] );
  131. pos.push( this.parent.ttPositions[51][1] ); // 30
  132. pos.push( this.parent.ttPositions[51][2] );
  133. pos.push( this.parent.ttPositions[45][0] );
  134. pos.push( this.parent.ttPositions[45][1] ); // 31
  135. pos.push( this.parent.ttPositions[45][2] );
  136. faces.push( 28, 31, 29, 29, 31, 30 );
  137. var surface = {
  138. "extends": "http://vwf.example.com/node3.vwf",
  139. "type": "mesh/definition",
  140. "properties": {
  141. "meshDefinition": { "positions": pos, "faces": faces, "color": [ 255, 0, 0 ], },
  142. },
  143. };
  144. this.children.create( "rotateX", surface );
  145. }
  146. }
  147. this.deleteGeometry = function() {
  148. if ( this.rotateX ) {
  149. this.children.delete( this.rotateX );
  150. }
  151. } //@ sourceURL=rotationX.vwf