Jump to content

vex point wrangle question


xs2222

Recommended Posts

Hi folks,
 
i have a vex question ,
basically i am colouring all points which have a value greater than .005 , and delete ones which does not have the colour , but the ones which have colour should not die at all , even when it reaches a velocity below .005 ?
 
any ideas ?
 
in a point wrangle 
 
 
int @idval ;
int @newVal;
if(length(@v) > .005)
{
@idval = @id;
@Cd = {0,1,0};
@dead = 1;
if((@idval == 0) && (length(@v) == 0))
{
@newVal = @idval;
}
}

 

thanks,

:)

Link to comment
Share on other sites

Would something like this work?

 

if (length(v@v) > .005) {
    // Above threshold, set color.
    @Cd = set(0,1,0);
} else {
    // Below threshold, check for color.
    if (@Cd != {0,1,0}) {
        i@dead = 1;
    } else {
        // Was once good, don't kill.
    }
}
Remember, all points will have color (@Cd) even if it is black. {0,0,0} Edited by Atom
Link to comment
Share on other sites

Hi Atom,

 

thanks for the reply , another tip from Pavel , and did this  before sim 

and works like a charm ;)

 

post solve in wrangle node added these ...

 

i@keepAlive = 0; 
 
if(length(v@v)>.005){ //above threshold 
 
v@Cd = {0,1,0};
i@keepAlive = 1;
}
 // Below threshold, check for color.
else {
        if (@Cd != {0,1,0}) {
        i@dead = 1;
    } else {
        i@keepAlive = 1;
    }
    }
Edited by xs2222
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...