Changeset 963


Ignore:
Timestamp:
06/26/20 21:10:08 (4 years ago)
Author:
Maciej Komosinski
Message:

Initial random rotation and location

Location:
js/human_3d_alignment/src/visualization
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • js/human_3d_alignment/src/visualization/framstick.js

    r911 r963  
    4848
    4949    this.viewer.scene.add(this.mesh);
    50 
     50    this.mesh.rotation.set(Math.random()*Math.PI*2, Math.random()*Math.PI*2, Math.random()*Math.PI*2, this.mesh.rotation.order );
    5151  }
    5252
  • js/human_3d_alignment/src/visualization/sviewer.js

    r911 r963  
    159159            this.parts.push(this.framstick2.parts[i]);
    160160        }
    161 
    162         this.framstick1.mesh.position.set( 0, -2, 0 );
    163         this.framstick2.mesh.position.set( 0, 2, 0 );
     161       
     162        let dist = 2;
     163        let angle = Math.random()*Math.PI*2;
     164        let x = Math.cos(angle)*dist;
     165        let y = Math.sin(angle)*dist;
     166
     167        this.framstick1.mesh.position.set( x, y, 0 );
     168        this.framstick2.mesh.position.set( -x, -y, 0 );
    164169
    165170        this.framstick1.setPositions();
Note: See TracChangeset for help on using the changeset viewer.