Jump to content

  • Log In with Google      Sign In   
  • Create Account

Awesome job so far everyone! Please give us your feedback on how our article efforts are going. We still need more finished articles for our May contest theme: Remake the Classics

#ActualMacD

Posted 30 October 2012 - 07:30 PM

Thank you for looking it over. Thank you even more for the reply!

I knew I was doing something bad by replacing the static loopxy0 with a variable absxy, but it was the only thing which led to a resulting terrain. Looking at your explanation, am I correct that loopxy0 will always be 0 (if you take the noise from the range 0 to (tilewidth*NoOfTiles)?

Then I could define loopx/y/0/1 and dx and dy outside of the whole loop, and then define mapx and mapy per tile, instead of per pixel, but I would have to do the second s and t calculations (which I had commented out)?

I'm just trying to get this to work, so for now all I'm trying is to get a tiling from 0 to (tilewidth*NumberOfTiles) ... wouldn't that also mean that in
p=p*(ranges.mapx1-ranges.mapx0)/(ranges.loopx1-ranges.loopx0);
q=q*(ranges.mapy1-ranges.mapy0)/(ranges.loopy1-ranges.loopy0);
the loop1-loop0 is always constant, and map1-map0 (call this: dxmap) is also always a tilewidth or a tileheight (because for each tile, mapx0 AND mapx1 shift a tile's width?

Hmm, I think I'm starting to get it: and I think I understand now why using absx/y DID give me a terrain where loopxy0 didn't! I'll give it a shot right now!

PS: sorry about the code; it looked fine in preview Posted Image I added a couple of carriage returns in one code block and now it seems to display ... ok. When I post the page looks ok too, but when I reload the page, everything is back to one-liners!

#3MacD

Posted 30 October 2012 - 06:53 PM

Thank you for looking it over. Thank you even more for the reply!

I knew I was doing something bad by replacing the static loopxy0 with a variable absxy, but it was the only thing which led to a resulting terrain. Looking at your explanation, am I correct that loopxy0 will always be 0 (if you take the noise from the range 0 to (tilewidth*NoOfTiles)?

Then I could define loopx/y/0/1 and dx and dy outside of the whole loop, and then define mapx and mapy per tile, instead of per pixel, but I would have to do the second s and t calculations (which I had commented out)?

I'm just trying to get this to work, so for now all I'm trying is to get a tiling from 0 to (tilewidth*NumberOfTiles) ... wouldn't that also mean that in
p=p*(ranges.mapx1-ranges.mapx0)/(ranges.loopx1-ranges.loopx0);
q=q*(ranges.mapy1-ranges.mapy0)/(ranges.loopy1-ranges.loopy0);
the loop1-loop0 is always constant, and map1-map0 (call this: dxmap) is also always a tilewidth or a tileheight (because for each tile, mapx0 AND mapx1 shift a tile's width?

Which (in this case of dx=loopx1-loopx0=(tilewidth*numberoftiles)-0) would also mean that p would always result in p=x/(loopx1)?
(as p=p*(dxmap/dx)=(x/tilewidth)*(tilewidth/dx)=x/dx, where x is the local x pixel position in the tile )

Hmm, I think I'm starting to get it: and I think I understand now why using absx/y DID give me a terrain where loopxy0 didn't! I'll give it a shot right now!

One more thing as regards to the nx/ny/nz/nw: I've regarded the nx/ny to be a "circle pair"  which relate to nz/nw which describe the circle in ""noise space". I've seen a number of ways of calculating them (sometimes with nx and ny using a cosine for example), and here I see you have:

nx=ranges.loopx0 + cos(p*pi2) * dx/pi2;
						    ny=ranges.loopx0 + sin(p*pi2) * dx/pi2;
						    nz=ranges.loopy0 + cos(q*pi2) * dy/pi2;
						    nw=ranges.loopy0 + sin(q*pi2) * dy/pi2;

Which I don't really get. Wouldn't ny have to use ranges.loopy0, q and dy whilst nz used loopx0, p and dx? Or am I confused about which pairs describe a circle?

PS: sorry about the code; it looked fine in preview Posted Image I added a couple of carriage returns in one code block and now it seems to display ... ok. When I post the page looks ok too, but when I reload the page, everything is back to one-liners!

#2MacD

Posted 30 October 2012 - 06:03 PM

Thank you for looking it over. Thank you even more for the reply!

I knew I was doing something bad by replacing the static loopxy0 with a variable absxy, but it was the only thing which led to a resulting terrain. Looking at your explanation, am I correct that loopxy0 will always be 0 (if you take the noise from the range 0 to (tilewidth*NoOfTiles)?

Then I could define loopx/y/0/1 and dx and dy outside of the whole loop, and then define mapx and mapy per tile, instead of per pixel, but I would have to do the second s and t calculations (which I had commented out)?

I'm just trying to get this to work, so for now all I'm trying is to get a tiling from 0 to (tilewidth*NumberOfTiles) ... wouldn't that also mean that in
p=p*(ranges.mapx1-ranges.mapx0)/(ranges.loopx1-ranges.loopx0);
q=q*(ranges.mapy1-ranges.mapy0)/(ranges.loopy1-ranges.loopy0);
the loop1-loop0 is always constant, and map1-map0 is also always a tilewidth or a tileheight (because for each tile, mapx0 AND mapx1 shift a tile's width?


Heh, I think I get it: and I think I understand now why using absx/y DID give me a terrain where loopxy0 didn't! I'll give it a shot right now!

PS: sorry about the code; it looked fine in preview Posted Image I added a couple of carriage returns in one code block and now it seems to display ... ok. Dunno what that is about ...

#1MacD

Posted 30 October 2012 - 05:28 PM

Thank you for looking it over. Thank you even more for the reply!

I knew I was doing something bad by replacing the static loopxy0 with a variable absxy, but it was the only thing which led to a resulting terrain. Looking at your explanation, am I correct that loopxy0 will always be 0 (if you take the noise from the range 0 to (tilewidth*NoOfTiles)?

Then I could define loopx/y/0/1 and dx and dy outside of the whole loop, and then define mapx and mapy per tile, instead of per pixel, but I would have to do the second s and t calculations (which I had commented out)?

Heh, I think I get it: and I think I understand now why using absx/y DID give me a terrain where loopxy0 didn't! I'll give it a shot right now!

PS: sorry about the code; it looked fine in preview :( I added a couple of carriage returns in one code block and now it seems to display ... ok. Dunno what that is about ...

PARTNERS