hi Kassen,

I thought I'd next change the cube to look like one of those kids toys with
a different colour on every face (like a die for some game). For this I
thought I'd grab the cube, iterate over it's faces using "for-each-face" and
set the colour. In my most successful attempts so far all I got was a cube
changing colour.
(hint-vertcols) can help with this.

something like this should work:
(clear)

(with-primitive (build-cube)
    (hint-vertcols)
    (pdata-index-map!
        (lambda (i c)
            (hsv->rgb (vector (/ (floor (/ i 4)) 6) .5 .5)))
        "c"))


Am I misunderstanding exactly what colour is applied to? Is this a property
colour is applied to the whole primitive, unless you use (hint-vertcols), when you can change the colour of the vertices.

best,
gabor

Reply via email to