Polar 3D Point Structure from Cartesian Point Structure and back again conversion patches.

Sometimes it's much easier to animate point data by modulating it's distance from a point (say origin point for simplicity).

When dealing with a large set of points and using Javascript to convert ["X","Y","Z"] to ["d","theata1","theata2"] is pretty CPU intensive. It takes enough CPU just to adjust the values of the points you want that it would make sense to do the arbitrary co-ord system conversion inside two custom plugins.

I guess OpenCL lends itself to this but I'm a) on Leopard and b) like the idea of a simple plugin to do this c) will find OpenCL daunting when I do get to it! d) hear OpenCL is unstaaaable at this point.

One patch to convert point structure objects from [x, y, z] to [d, Θ1, Θ2]. Mess with d value on some of the points (or Θ1/Θ2 values if that's your thing). Another patch to convert from [d, Θ1, Θ2] back to [x, y, z] to be feed to Kineme Point Structure patch.

I know it's not a good time to request new Kineme patches but I figured in a way it's quite a simple build (if you can do that sort of thing which I obviously can't) and it might interest somebody as an exercise. Conceptually at least it sounds easy!

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

smokris's picture
Re: Polar 3D Point Structure from Cartesian Point Structure ...

Specifically how large is your set of points?

We're working on a set of patches to perform data transformations like this in a fairly generic way. Hopefully we should be ready for an initial beta release within the next couple of weeks.

Also it's never a bad time to request new Kineme patches :^]

usefuldesign.au's picture
Re: Polar 3D Point Structure from Cartesian Point Structure ...

A few hundred points. Lots of colour, size modulation and more going on in comp though, so any place I can shave a few ms...

'Generic way' sounds even more interesting — I'm curious. May be able to use structure range patch to sub-set point structure followed 'generic changes' and by-pass javascript patch all together. Would need some way of assigning an expression to a value within the structure, not sure if that's in your thinking, it's already in another GL Tool patch I guess.

I've been wondering are the new faster struct types available to QC plugins are QC4 / SL only or do they work in QC 3 / 10.5?

toneburst's picture
Re: Polar 3D Point Structure from Cartesian Point Structure ...

Hey, now that DOES sound interesting! Have you found out how to use C-backed arrays in a custom patch? Are these the 'spreads tools' we've been talking about for ages?

Cool stuff!

a|x

usefuldesign.au's picture
Re: Polar 3D Point Structure from Cartesian Point Structure ...

Probably should have said 'Object' type or 'Class' not 'Struct', I think it's a Cocoa thing (as opposed to C) but I can't remember where I read about them. I think cwright mentioned they used them in the latest version of GL Tools or some other Kineme plug-in. Still, any plugin process using a programming language would probably whip runtime interpreted JS patch, no?

volkerk's picture
Re: Polar 3D Point Structure from Cartesian Point Structure ...

this would be a very useful feature, particular if there is a fast method to import and stream arrays into qc. I was dealing with largish point clouds in qc in the past (~5000 points[x,y,z,r,g,b]). Used xml to import and GL point structure to visualise. But this is quite slow.