Intranet Catprocess
  1. news...
  2. about Blackvoxel
  3. download
  4. manual
  5. videos
  6. about us
  1. Random Color Voxel Wall Display

    // RANDOM COLOR VOXEL WALL DISPLAY

    Init<-0;

    // Init display makes a voxel display wall using special display voxels.

    function Init_Display(Size)
    {
    local x,y;

    // Clear Zone

    for (x=0;x<32;x++)
    for (y=0;y<64;y++) UNF_PlaceVoxel3D(x+1,y,0,0);

    // Setup the screen

    for (x=0;x<Size;x++)
    for (y=0;y<Size;y++) UNF_PlaceVoxel3D(x+1,y,0,223);
    }

    // This function is called repeatedly for each step of the robot.

    function Voxel_Step()
    {
    local x,y,i;

    // Startup code, build the environnment. Executes only once.

    if (Init==0)
    {
    Init_Display(8); // Init the display wall.
    UNF_PlaceVoxel3D(-1,0,0,215); // Add a button to start and stop display
    Init=1;
    }

    // Display random colors to the display wall. Executes at each loop.

    for(y=0;y<8;y++)
    for(x=0;x<8;x++)
    {
    i = GetRnd(16);
    if (!Voxel_GetInfo(-1,0,0,1)) i = 0;
    Voxel_SetInfo(1+x,0+y,0,1,i);
    }
    }
     
  2. Google+