Hi Kassen, Strange this has never been implemented, as it's been in the c++ level for years. I just added it to git:
(define p (build-particles 100)) (display (with-primitive p (primitive-type-name)))(newline) cheers, dave On Sat, 2011-01-08 at 23:14 +0100, Kassen wrote: > Dear list, > > > Is there any way to poll a scene-graph id for it's type? What I mean > is that when I know that the scene-graph contains a primitive foo that > might be either a model loaded from a .obj file or a "particles", I'd > like to do something like; > > > (type foo) -> "particles" > > > or > > > (particles? foo) -> #t > > > If not are there other who would see this as useful or should I keep > track of it myself? If so, would such use be in balance to how hard a > implementation would be to do? Right now it seems to me that Racket > structures all and inherently have functions like "(string? bar)" and > "(number? baz)" yet our scene-graph lacks those. > > > In fact, in the above examples (number? foo) returns #t, which is > fair, as it *is* a number, literally speaking, but this does seem > counter-intuitive in the context of the scene-graph where we'd like to > treat it as a a "particles" (or a poly, or a ribbon, or a locator > or....). Then again, if I dig that deep I might be causing more > trouble than it's worth, and while new features could be imagined we'd > lose the ability to iterate over the scene-graph, unless that too > would become accessible as a list. There might be > more unforeseen consequences. > > > Yours, > Kas.
