Jump to content

Coloring points from arrays


pillsNmilk

Recommended Posts

 

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;   

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...