Archive: Mirror Tileing


6th January 2005 05:52 UTC

Mirror Tileing
I'm sure someone would have asked this, but i seached the forums, and it couldn't find any matches.
What is the syntax for mirror tiling?
I hope you can help


6th January 2005 06:44 UTC

for movement you mean?

x=abs(x) for right to left
x=-abs(x) for left to right
y=abs(y) for bottom to top
y=-abs(y) for top to bottom


6th January 2005 07:13 UTC

Sorry WOTH. I should have explained better. what I want is for x to go like this
-1 -0.5 0 0.5 1 -0.5 0 0.5 1 normal x
-1 -0.5 0 0.5 1 0.5 0 -0.5 -1 after mirror tile

I've seen It done before, In 3d maze 3 and I could not understand most of it's code properly. it's possible.


6th January 2005 08:28 UTC

still not sure... you mean like this?

if not could you please explain as specific as possible what you want to do with it?


6th January 2005 12:02 UTC

do you perhaps mean something like this left-right problem?


6th January 2005 15:35 UTC

Or perhaps you mean....

I got nothin.


6th January 2005 16:40 UTC

sorry, pak that's wrong. This is JEOPARDY here. You have to ask a question that would fit to PJ's problem.

o.k let's carry on with this: i'll choose "Mysterious Requests 400"


6th January 2005 17:35 UTC

bleh
I think he means tiling a texture on a dm. usually you generate texture coordinates from the raytrace solution (usually something like (x1*k+ox,y1*k+oy,z1*k+oz), to texture a plane with constant z (z=1 for instance) you woult use:

x=x1*k+ox;
y=y1*k+ox;

Hopefully that is familiar. To 'mirror tile' it what is normally done is to use:

x=asin(sin(x1*k+ox));
y=asin(sin(y1*k+ox);

If you want to be perfect then use x=asin(sin((.5*$PI*(x1*k+ox))))*2/$PI; etc... this way you are preserving the whole texture but still mirroring it. Take a look at the example preset attached. The only benefit of using this though is that you can get rid of big ugly edges, in cylinders and other curved 3D DMs, in exchange for much smaller ones and a mirrored texture.


7th January 2005 05:52 UTC

Thanks a lot Jheriko That's what I meant. Dorry I couldn't explain better :igor:


7th January 2005 10:19 UTC

don't worry about that. it always happens now and then, that someone (including me) asks something, that others don't understand at first.


7th January 2005 11:02 UTC

Now that that preset's done...
Is then a way to do it in 21D?

Edit: I mean 2D, sorry for scaring you there /Edit:o


12th January 2005 03:13 UTC

which is simply
x=asin(sin((.5*$PI*(x))))*2/$PI;
y=asin(sin((.5*$PI*(y))))*2/$PI;