Skip to content
This repository has been archived by the owner on May 4, 2020. It is now read-only.

heres the 3d cave code #5

Open
levlups opened this issue Sep 2, 2019 · 1 comment
Open

heres the 3d cave code #5

levlups opened this issue Sep 2, 2019 · 1 comment
Labels
enhancement New feature or request

Comments

@levlups
Copy link

levlups commented Sep 2, 2019

js code ,,,,,,,

case "simplex3d":
		for (var x1 = 0; x1 < data.shape[0]; ++x1) {
			for (var z1 = 0; z1 < data.shape[2]; ++z1) {
				
				for (var y1 = 0; y1 < data.shape[1]; ++y1) {
					var random = this.simplexNoise.noise3D((x1 + x) / 50,(y1 + y) / 50*10, (z1 + z) / 50);
			var random2 = Math.floor(this.simplexNoise.noise2D((x1 + x) / 100, (z1 + z) / 100) * 10);
					
								if ( random<0.1) {
							
												if (y1 + y === random2 + 1) {
										data.set(x1, y1, z1, blockIDs[0]);
									} else if (y1 + y < random2 + 1 && y1 + y > random2 - 5) {
										data.set(x1, y1, z1, blockIDs[1]);
									} else if (y1 + y <= random2 - 5) {
										data.set(x1, y1, z1, blockIDs[2]);
									}	
							
							} 	
					
				}
				
			}
		}
	break;

end of code ,,,,,

@levlups
Copy link
Author

levlups commented Sep 2, 2019

its weird how when we use simplex noise , no more holes no more deffects on the land ...?????

@EliteAsian123 EliteAsian123 added the enhancement New feature or request label Sep 8, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants