// Use this for initialization. void Start() { //Creat new VoxelRender with 192x192x64 resolution. voxelRender = new VoxelRender(192, 192, 64); //Fill VoxelRender palette with random colors. voxelRender.GenerateRandomPalette(); }
// Use this for initialization void Start() { VoxelRender voxelRender = GetComponent <VoxelRender>(); scale = voxelRender.scale; max = voxelRender.blockDim; offset = voxelRender.adjustedScale; }
// Use this for initialization. void Start() { //Creat new VoxelRender with 192x192x64 resolution. voxelRender = new VoxelRender(192, 192, 64); //Fill VoxelRender palette with random colors. voxelRender.GenerateRandomPalette(); //We have only dynamic voxels in scene. voxelRender.isDynamicOnly = true; }
// Use this for initialization. void Start() { //Creat new VoxelRender with 192x192x64 resolution. voxelRender = new VoxelRender(192, 192, 64); //Load voxel mesh from file. voxelMesh = new VoxelMesh("Knight"); //Load palette from mesh to VoxelRender. voxelRender.LoadPaletteFromMesh(voxelMesh); }
// Use this for initialization void Start() { //Creat new VoxelRender voxelRender = new VoxelRender(128, 128, 64, 2, 2); //Fill VoxelRender palette with random colors voxelRender.GenerateRandomPalette(); //Create random cubes as level. for (int cube = 0; cube < 128; cube++) { voxelRender.DrawBox(Random.Range(0, 128 * 2), 0, Random.Range(0, 128 * 2), Random.Range(8, 32), Random.Range(4, 24), Random.Range(8, 32), (byte)Random.Range(1, 254), Layer.Static); } }
// Use this for initialization void Start() { //Creat new VoxelRender with 192x192x64 resolution. voxelRender = new VoxelRender(192, 192, 64); //Fill VoxelRender palette with random colors. voxelRender.GenerateRandomPalette(); //Create Ground byte color = 106; for (int x = 0; x < 16; x++) { for (int z = 0; z < 16; z++) { voxelRender.DrawBox(x * 12, 0, z * 12, 12, 4, 12, (byte)(color + 8 * ((x + z) % 2)), Layer.Static); } } }
public void Execute() { var(verts, tris) = VoxelRender.GenerateVoxelMesh(new List <VoxelData>(voxels.ToArray())); triangles.CopyFrom(tris.ToArray()); vertices.CopyFrom(verts.ToArray()); }