566b4ab78ea8df10b24a99976f4fa8160e5a57db
5 #include "cudaType_CPU.h"
13 Sphere(float3 centre
, float r
, float hue
) :
26 void setCentre(float3 centre
)
28 this->centre
= centre
;
39 void setHueInitial(float hue
)
41 this->hueInitial
= hue
;
45 float hCarre(float2 xySol
)
47 float a
= (centre
.x
- xySol
.x
);
48 float b
= (centre
.y
- xySol
.y
);
53 bool isEnDessous(float hCarre
)
55 return hCarre
< rCarre
;
59 float dz(float hCarre
)
61 return sqrtf(rCarre
- hCarre
);
65 float brightness(float dz
)
71 float distance(float dz
)
79 return this->hueInitial
;
83 float hue(float t
) // usefull for animation
85 return 0.5 + 0.5 * sin(t
+ T
+ 3 * PI
/ 2);
94 float T
; // Utilisé pour l'animation.