( vector )
| 32955 | // Project vector onto sphere's surface |
| 32956 | |
| 32957 | function prepare( vector ) { |
| 32958 | |
| 32959 | var vertex = vector.normalize().clone(); |
| 32960 | vertex.index = that.vertices.push( vertex ) - 1; |
| 32961 | |
| 32962 | // Texture coords are equivalent to map coords, calculate angle and convert to fraction of a circle. |
| 32963 | |
| 32964 | var u = azimuth( vector ) / 2 / Math.PI + 0.5; |
| 32965 | var v = inclination( vector ) / Math.PI + 0.5; |
| 32966 | vertex.uv = new THREE.Vector2( u, 1 - v ); |
| 32967 | |
| 32968 | return vertex; |
| 32969 | |
| 32970 | } |
| 32971 | |
| 32972 | |
| 32973 | // Approximate a curved face with recursively sub-divided triangles. |
no test coverage detected