Ninja.Bob
20th June 2004 10:19 UTC
Spherical mapping
Im fairly new at using AVS and im having trouble mapping a rectangular image to a sphere Im not sure which trans effect to use for this effect. The preset involves a texered starfield which means it re-renders each frame so a gradual movement to the sphere is no help. It tried using trans/movement and even though im sure I had the maths right the screen just flashed a solid colour. Any help on this would be appreciated.
[Ishan]
20th June 2004 10:57 UTC
uh....you want a sphere movement?
Warrior of the Light
20th June 2004 13:28 UTC
Perhaps you could add the preset so that we can take a look at it and see what we're talking about and help you with the code?
[Ishan]
20th June 2004 15:13 UTC
well if you want sphere movement then just search the forums once.
Jaak
28th June 2004 10:34 UTC
Use dm and think raytracing.
As for pherical mapping you can use:
x=atan2(pz,px);
y=asin(py);
Ninja.Bob
30th June 2004 12:24 UTC
Um basically this is what i have at the moment. The stuff after the buffer save transforms it from the flat to the sphere but i want to correct it so that a) it doesn't have the lines from the movement and b) the back of the sphere is not just the inverse of the front.
I did search for sphere but could not find what i wanted.
Also is there anyway to get AVS to render at a high res but display at a lower one?
dirkdeftly
2nd July 2004 21:26 UTC
is this what you're looking for?
trans/movement (rectangular coordinates, wrap, bilinear filtering):
d=sqr(x)+sqr(y); z=if(below(d,1),sqrt(1-d),1);
x=x/z; y=y/z;