11 Sphere(float3 centre
, float r
, float hue
) :
24 void setCentre(const float3
& centre
)
26 this->centre
= centre
;
37 void setHueInitial(float hue
)
39 this->hueInitial
= hue
;
43 float hCarre(float2 xySol
)
45 float a
= (centre
.x
- xySol
.x
);
46 float b
= (centre
.y
- xySol
.y
);
51 bool isEnDessous(float hCarre
)
53 return hCarre
< rCarre
;
57 float dz(float hCarre
)
59 return sqrtf(rCarre
- hCarre
);
63 float brightness(float dz
)
69 float distance(float dz
)
77 return this->hueInitial
;
81 float hue(float t
) // usefull for animation
83 return 0.5 + 0.5 * sin(t
+ T
+ 3 * PI
/ 2);
92 float T
; // Utilisé pour l'animation.