draw-sphere-basic ( color -- )


Vocabulary
rlgl.demo

Inputs
coloran object


Outputs
None

Definition


:: draw-sphere-basic ( color -- )
16 16 :> ( rings slices ) rings 2 + slices 6 * *
rl-check-render-batch-limit drop RL_TRIANGLES rl-begin color
[ r>> ] [ g>> ] [ b>> ] [ a>> ] quad rl-color4ub rings 2 +
[0..b) slices [0..b) [| i j |
270 180 rings 1 + / i * + deg>rad cos j 360 * slices /
deg>rad sin * 270 180 rings 1 + / i * +
deg>rad sin 270 180 rings 1 + / i * +
deg>rad cos j 360 * slices / deg>rad cos * rl-vertex3f
270 180 rings 1 + / i 1 + * + deg>rad cos j 1 + 360 *
slices / deg>rad sin * 270 180 rings 1 + / i 1 + * +
deg>rad sin 270 180 rings 1 + / i 1 + * +
deg>rad cos ~231 more~
] cartesian-each rl-end ;