MCPcopy Create free account
hub / github.com/Code-Bullet/Jump-King / _ellipsoid

Function _ellipsoid

libraries/p5.js:34792–34807  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

34790
34791 if(!this._renderer.geometryInHash(gId)){
34792 var _ellipsoid = function(){
34793 var u,v,p;
34794 for (var i = 0; i <= this.detailY; i++){
34795 v = i / this.detailY;
34796 for (var j = 0; j <= this.detailX; j++){
34797 u = j / this.detailX;
34798 var theta = 2 * Math.PI * u;
34799 var phi = Math.PI * v - Math.PI / 2;
34800 p = new p5.Vector(radiusX * Math.cos(phi) * Math.sin(theta),
34801 radiusY * Math.sin(phi),
34802 radiusZ * Math.cos(phi) * Math.cos(theta));
34803 this.vertices.push(p);
34804 this.uvs.push([u,v]);
34805 }
34806 }
34807 };
34808 var ellipsoidGeom = new p5.Geometry(detailX, detailY,_ellipsoid);
34809 ellipsoidGeom
34810 .computeFaces()

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected