3D point structure

Help! javascript generated structure: too many members/array to the queue

jacopoB's picture

I've never worked with javascript but i've managed to create a structure, the problem is that i dont know how to dequeue the values. (I want to keep only the newest values 20-40 per points {x,y,z})

Anyone can help?

_Queue = []

function (__structure Queue) main (__number inputNumber[12]) { var result = new Object(); _Queue.push([inputNumber[0],inputNumber[1],inputNumber[2]]) _Queue.push([inputNumber[3],inputNumber[4],inputNumber[5]]) _Queue.push([inputNumber[6],inputNumber[7],inputNumber[8]]) _Queue.push([inputNumber[9],inputNumber[10],inputNumber[11]]) result.Queue = _Queue; return result; }

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!