okay here's take two. I was going to post this right after that last one but I got side tracked by taking a shower.
Lets rotate the standard vis. For this we'll need an image that is large enough to cover the vis that is totally transparent. And we'll need to declare a vis object below our layer_fx layer.
I guess I forgot to mention in that last post that x and y are -1..1. But in this case We'll use the pseudopoloar coords, r and d. r is is radians, and seems to be unlimited, or rolls over nicely for you. and d should go from 0..sqrt(2) but I haven't tested that.
To rotate an object you merely return r+rotation_angle_in_radians. (just in case, there are 2Pi radians in 360 degrees, to convert degrees to radians, multiply by Pi/180, radians to degrees, the inverse of that.) So our code will look like this:
SuperVis.fx_onGetPixelR(double r, double d, double x, double y)
return r+(3.14159/4)+r1; //45 degree rotation.
But wait, whats that r1 term in there? Well since what were calculating doesn't change, layer_fx gives us a blank image. so we need to rotate just a little bit, to get it to display the image all the time. so we also need this.
Global double r1;
r1 = 0;
r1 += 0.000001;
if(r1 == 0.000002)
r1 = 0;
this changing value of r1 is enough to display the image but not give any noticable rotation to it.
We to include
in addition to the settings from above. This tell the layer_fx to use what is below our layer, not the layer itself. Be sure to remove
the setRect(1) or else you'll still be using rectangular mode.
If you see a ghost of the unrotated vis. I suspect that it is caused by the layer_fx, and the vis updating being outof synch. Once the vis fps is a config attribute this should be fixable, but for now we just have to live with it.
Yes these are basic things, but it should get everyone started. Personally I haven't moved to far beyond these myself, mostly since I haven't been working on it all that much. If anyone finds a better way to rotate a vis, without that horrid hack, let me know.