victorrijo Posted March 11, 2016 Share Posted March 11, 2016 (edited) Hi everyone, I'm trying to make something similar to this using VEX. For some reason my cube its "jumping" every time it changes direction. (see attached video) Here's the code I wrote so far: f@random = random(@Time); @random = fit01(@random, 0, 3); //moves in X if (@random < 0.5){ @P[0] += (@Frame / 15); } //moves in Y else if (@random > 0.5 & @random < 1.5){ @P[1] += (@Frame / 15); } //moves in Z else{ @P[2] += (@Frame / 15); } I tried doing the same using VOP (see attachment) but I'm getting the same results. randomXYZ.mov Edited March 11, 2016 by victorrijo Quote Link to comment Share on other sites More sharing options...
woodenduck Posted March 12, 2016 Share Posted March 12, 2016 (edited) Because each position calculation is done from scratch each frame. Take your wrangle node and paste it inside a Solver Sop connected to 'previous frame'. I think that will be what you are after. Cheers, WD solverSopBox.hip Edited March 12, 2016 by woodenduck Quote Link to comment Share on other sites More sharing options...
victorrijo Posted March 12, 2016 Author Share Posted March 12, 2016 Thanks, the solver sop worked great. I changed the vex code as well. f@random = random(@Frame); @random = rint(fit01(@random, 0, 6)); if (@random == 0){ @P[0] += 0.1; } else if (@random == 1){ @P[1] += 0.1; } else if (@random == 2){ @P[2] += 0.1; } else if (@random == 3){ @P[0] -= 0.1; } else if (@random == 4){ @P[1] -= 0.1; } else { @P[2] -= 0.1; } randomxyz.mov 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.