sounds like what you want is the ability to apply a full matrix based transform to a 3d coordinate, but on the gpu as in tx,ty,tz,rx,ry,rz,sx,sy,sz ?

I’ve attached something I was fiddling around with the other day - may be what you’re looking for.

the actual transform function is quite particular, it looks like this:

[code]vec3 Transform(vec3 p, vec3 t, vec3 r, vec3 s)

{

float px = p.x;

float py = p.y;

float pz = p.z;

```
float tx = t.x;
float ty = t.y;
float tz = t.z;
float rx = r.x;
float ry = r.y;
float rz = r.z;
float sx = s.x;
float sy = s.y;
float sz = s.z;
float crx = cos(rx*PI/180);
float cry = cos(ry*PI/180);
float crz = cos(rz*PI/180);
float srx = sin(rx*PI/180);
float sry = sin(ry*PI/180);
float srz = sin(rz*PI/180);
px *= sx;
py *= sy;
pz *= sz;
vec3 result = vec3(0.);
result.x = (cry * crz) * px + (srx * sry * crz - srz * crx) * py + (crx * sry * crz + srx * srz) * pz + tx;
result.y = (cry * srz) * px + (srz * srx * sry + crx * crz) * py + (crx * sry * srz - srx * crz) * pz + ty;
result.z = -sry * px + (srx * cry) * py + (crx * cry) * pz + tz;
return result;
```

}[/code]

swirlingBalls_GLSL_Transforms.3.toe (2.92 MB)