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

heres the 3d cave code  #5

@levlups

Description

@levlups

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 ,,,,,

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions