reading and Coloring points from arrays

   1653   0   0
User Avatar
Member
5 posts
Joined: Nov. 2017
Offline
Hey im relatively new to coding in vex but i am having issues writing out the points to an array then reading them to use them for pretty much anything, for example colors…here is the code in question: My question is how do i assign color to individual points from the array . for example if i wanted to assign (without using relpointbbox()) using the array readout to assign the color red to points above 500 and the color blue to below 500.



int my_array = i@my_array;


vector pos = set(0,0,0);

//for point space and amt of X
int nopointx = chi(“point_amountX”);
float ptspacex = chf(“point_spaceX”);

//for point space and amt of Y
int nopointy = chi(“point_amountY”);
float ptspacey = chf(“point_spaceY”);

//for point space and amt of Z
int nopointz = chi(“point_amountZ”);
float ptspacez = chf(“point_spaceZ”);

for (int z = 0; z < nopointz ; z++)
{

for (int y = 0; y < nopointy ; y++)
{

for (int x = 0; x < nopointx ; x++)
{
pos = set (ptspacex*x, ptspacey*y, ptspacez*z);
int newpt = addpoint(0, pos);
append(my_array, newpt);

}

}

}



for (int z = 0; z < 500 ; z++)
{


@Cd = set(1,0,0);

}


i@my_array = my_array;
  • Quick Links