hi Luis,

What I am wondering is if i can know which is the number of a vert
that is for example on the fron of a shape.
it's difficult to tell, since each shape is generated by a different algorithm.

i attached a small script that puts the vertex index next to the vertex.

(clear)

(define f "DejaVuSansMono.ttf")

(define p (build-icosphere 2))

(define (show-vertex-numbers p)
    (with-primitive p
        (hint-wire)
        (poly-convert-to-indexed)
        (for ([i (in-range (pdata-size))])
            (let ([t (build-type f (number->string i))]
                  [pos (pdata-ref "p" i)])
                (with-primitive t
                    (hint-unlit)
                    (hint-ignore-depth)
                    (backfacecull 0)
                    (colour #(1 0 0))
                    (translate pos)
                    (scale .02))))))

(show-vertex-numbers p)

it works fine for indexed polyprimitives. the problem is that faces of ordinary primitives have vertices at the same position, so the index labels are displayed on top of each other. still you might have an idea about the index of a given vertex.

best,
gabor


Reply via email to