123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201 |
- ---
- extends: http://vwf.example.com/node3.vwf
- implements:
- - http://vwf.example.com/spin-on-move.vwf
- methods:
- createGeometry:
- deleteGeometry:
- properties:
- spin-axis: [ 0, 0, 1 ]
- spin-rate: 100
- spin-inputDim: "xy"
- scripts:
- - |
- this.initialize = function() {
- //console.info( "initialize rotationZ.vwf" );
- }
- //this.pointerDown = this.events.add( function( pointerInfo, pickInfo ){
- this.pointerDown = function( pointerInfo, pickInfo ){
- console.info( 'pointerDown rotationZ' );
- this.parent.editMode='rotate';
- this.parent.axis=[0,0,1];
- return false;
- }
- // } )
- this.createGeometry = function() {
- if ( this.parent.ttPoints ) {
- var pos = [];
- var faces;
- pos.push( this.parent.ttPositions[12][0] );
- pos.push( this.parent.ttPositions[12][1] ); // 0
- pos.push( this.parent.ttPositions[12][2] );
- pos.push( this.parent.ttPositions[13][0] );
- pos.push( this.parent.ttPositions[13][1] ); // 1
- pos.push( this.parent.ttPositions[13][2] );
-
- pos.push( this.parent.ttPositions[16][0] );
- pos.push( this.parent.ttPositions[16][1] ); // 2
- pos.push( this.parent.ttPositions[16][2] );
-
- pos.push( this.parent.ttPositions[15][0] );
- pos.push( this.parent.ttPositions[15][1] ); // 3
- pos.push( this.parent.ttPositions[15][2] );
-
- faces = [ 0, 3, 1, 1, 3, 2 ];
-
- pos.push( this.parent.ttPositions[10][0] );
- pos.push( this.parent.ttPositions[10][1] ); // 4
- pos.push( this.parent.ttPositions[10][2] );
- pos.push( this.parent.ttPositions[9][0] );
- pos.push( this.parent.ttPositions[9][1] ); // 5
- pos.push( this.parent.ttPositions[9][2] );
-
- pos.push( this.parent.ttPositions[18][0] );
- pos.push( this.parent.ttPositions[18][1] ); // 6
- pos.push( this.parent.ttPositions[18][2] );
-
- pos.push( this.parent.ttPositions[19][0] );
- pos.push( this.parent.ttPositions[19][1] ); // 7
- pos.push( this.parent.ttPositions[19][2] );
- faces.push( 4, 7, 5, 5, 7, 6 );
-
- pos.push( this.parent.ttPositions[24][0] );
- pos.push( this.parent.ttPositions[24][1] ); // 8
- pos.push( this.parent.ttPositions[24][2] );
- pos.push( this.parent.ttPositions[25][0] );
- pos.push( this.parent.ttPositions[25][1] ); // 9
- pos.push( this.parent.ttPositions[25][2] );
-
- pos.push( this.parent.ttPositions[28][0] );
- pos.push( this.parent.ttPositions[28][1] ); // 10
- pos.push( this.parent.ttPositions[28][2] );
-
- pos.push( this.parent.ttPositions[27][0] );
- pos.push( this.parent.ttPositions[27][1] ); // 11
- pos.push( this.parent.ttPositions[27][2] );
- faces.push( 8, 11, 9, 9, 11, 10 );
- pos.push( this.parent.ttPositions[22][0] );
- pos.push( this.parent.ttPositions[22][1] ); // 12
- pos.push( this.parent.ttPositions[22][2] );
- pos.push( this.parent.ttPositions[21][0] );
- pos.push( this.parent.ttPositions[21][1] ); // 13
- pos.push( this.parent.ttPositions[21][2] );
-
- pos.push( this.parent.ttPositions[30][0] );
- pos.push( this.parent.ttPositions[30][1] ); // 14
- pos.push( this.parent.ttPositions[30][2] );
-
- pos.push( this.parent.ttPositions[31][0] );
- pos.push( this.parent.ttPositions[31][1] ); // 15
- pos.push( this.parent.ttPositions[31][2] );
- faces.push( 12, 15, 13, 13, 15, 14 );
- pos.push( this.parent.ttPositions[16][0] );
- pos.push( this.parent.ttPositions[16][1] ); // 16
- pos.push( this.parent.ttPositions[16][2] );
- pos.push( this.parent.ttPositions[48][0] );
- pos.push( this.parent.ttPositions[48][1] ); // 17
- pos.push( this.parent.ttPositions[48][2] );
-
- pos.push( this.parent.ttPositions[49][0] );
- pos.push( this.parent.ttPositions[49][1] ); // 18
- pos.push( this.parent.ttPositions[49][2] );
-
- pos.push( this.parent.ttPositions[13][0] );
- pos.push( this.parent.ttPositions[13][1] ); // 19
- pos.push( this.parent.ttPositions[13][2] );
- faces.push( 16, 19, 17, 17, 19, 18 );
- pos.push( this.parent.ttPositions[28][0] );
- pos.push( this.parent.ttPositions[28][1] ); // 20
- pos.push( this.parent.ttPositions[28][2] );
- pos.push( this.parent.ttPositions[51][0] );
- pos.push( this.parent.ttPositions[51][1] ); // 21
- pos.push( this.parent.ttPositions[51][2] );
-
- pos.push( this.parent.ttPositions[50][0] );
- pos.push( this.parent.ttPositions[50][1] ); // 22
- pos.push( this.parent.ttPositions[50][2] );
-
- pos.push( this.parent.ttPositions[25][0] );
- pos.push( this.parent.ttPositions[25][1] ); // 23
- pos.push( this.parent.ttPositions[25][2] );
- faces.push( 20, 23, 21, 21, 23, 22 );
- pos.push( this.parent.ttPositions[52][0] );
- pos.push( this.parent.ttPositions[52][1] ); // 24
- pos.push( this.parent.ttPositions[52][2] );
- pos.push( this.parent.ttPositions[19][0] );
- pos.push( this.parent.ttPositions[19][1] ); // 25
- pos.push( this.parent.ttPositions[19][2] );
-
- pos.push( this.parent.ttPositions[10][0] );
- pos.push( this.parent.ttPositions[10][1] ); // 26
- pos.push( this.parent.ttPositions[10][2] );
-
- pos.push( this.parent.ttPositions[53][0] );
- pos.push( this.parent.ttPositions[53][1] ); // 27
- pos.push( this.parent.ttPositions[53][2] );
- faces.push( 24, 27, 25, 25, 27, 26 );
- pos.push( this.parent.ttPositions[22][0] );
- pos.push( this.parent.ttPositions[22][1] ); // 28
- pos.push( this.parent.ttPositions[22][2] );
- pos.push( this.parent.ttPositions[54][0] );
- pos.push( this.parent.ttPositions[54][1] ); // 29
- pos.push( this.parent.ttPositions[54][2] );
-
- pos.push( this.parent.ttPositions[55][0] );
- pos.push( this.parent.ttPositions[55][1] ); // 30
- pos.push( this.parent.ttPositions[55][2] );
-
- pos.push( this.parent.ttPositions[31][0] );
- pos.push( this.parent.ttPositions[31][1] ); // 31
- pos.push( this.parent.ttPositions[31][2] );
- faces.push( 28, 31, 29, 29, 31, 30 );
-
- var surface = {
- "extends": "http://vwf.example.com/node3.vwf",
- "type": "mesh/definition",
- "properties": {
- "meshDefinition": { "positions": pos, "faces": faces, "color": [ 255, 0, 0 ], },
- },
- };
-
- this.children.create( "rotateZ", surface );
- }
- }
- this.deleteGeometry = function() {
- if ( this.rotateZ ) {
- this.children.delete( this.rotateZ );
- }
- } //@ sourceURL=rotationZ.vwf
|