summaryrefslogtreecommitdiff
path: root/graphics/asymptote/webgl/gl.js
diff options
context:
space:
mode:
Diffstat (limited to 'graphics/asymptote/webgl/gl.js')
-rw-r--r--graphics/asymptote/webgl/gl.js55
1 files changed, 32 insertions, 23 deletions
diff --git a/graphics/asymptote/webgl/gl.js b/graphics/asymptote/webgl/gl.js
index 2cdef3e776..e2053f3161 100644
--- a/graphics/asymptote/webgl/gl.js
+++ b/graphics/asymptote/webgl/gl.js
@@ -2732,36 +2732,45 @@ function Tcorners(T,m,M) {
// (or optionally a hemisphere symmetric about direction dir)
function sphere(center,r,CenterIndex,MaterialIndex,dir)
{
+ let b=0.524670512339254;
+ let c=0.595936986722291;
+ let d=0.954967051233925;
+ let e=0.0820155480083437;
+ let f=0.996685028842544;
+ let g=0.0549670512339254;
+ let h=0.998880711874577;
+ let i=0.0405017186586849;
+
let octant=[[
[1,0,0],
- [1,0,0.370106805057161],
- [0.798938033457256,0,0.6932530716149],
- [0.500083269410627,0,0.866169630634358],
+ [1,0,b],
+ [c,0,d],
+ [e,0,f],
- [1,0.552284749830793,0],
- [1,0.552284749830793,0.370106805057161],
- [0.798938033457256,0.441241291938247,0.6932530716149],
- [0.500083269410627,0.276188363341013,0.866169630634358],
+ [1,a,0],
+ [1,a,b],
+ [c,a*c,d],
+ [e,a*e,f],
- [0.552284749830793,1,0],
- [0.552284749830793,1,0.370106805057161],
- [0.441241291938247,0.798938033457256,0.6932530716149],
- [0.276188363341013,0.500083269410627,0.866169630634358],
+ [a,1,0],
+ [a,1,b],
+ [a*c,c,d],
+ [a*e,e,f],
[0,1,0],
- [0,1,0.370106805057161],
- [0,0.798938033457256,0.6932530716149],
- [0,0.500083269410627,0.866169630634358]
+ [0,1,b],
+ [0,c,d],
+ [0,e,f]
],[
- [0.500083269410627,0,0.866169630634358],
- [0.500083269410627,0.276188363341013,0.866169630634358],
- [0.35297776917154,0,0.951284475617087],
- [0.276188363341013,0.500083269410627,0.866169630634358],
- [0.264153721902467,0.264153721902467,1],
- [0.182177944773632,0,1],
- [0,0.500083269410627,0.866169630634358],
- [0,0.35297776917154,0.951284475617087],
- [0,0.182177944773632,1],
+ [e,0,f],
+ [e,a*e,f],
+ [g,0,h],
+ [a*e,e,f],
+ [i,i,1],
+ [0.05*a,0,1],
+ [0,e,f],
+ [0,g,h],
+ [0,0.05*a,1],
[0,0,1]
]];