MCPcopy Index your code
hub / github.com/stemkoski/stemkoski.github.com / prepare

Function prepare

MathBox/mathbox-bundle.js:32957–32970  ·  view source on GitHub ↗
( vector )

Source from the content-addressed store, hash-verified

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.

Callers 2

mathbox-bundle.jsFile · 0.70
subdivideFunction · 0.70

Calls 2

azimuthFunction · 0.70
inclinationFunction · 0.70

Tested by

no test coverage detected