wakimsan Posted July 27, 2019 Share Posted July 27, 2019 Hi guys, I'm trying to learn a bit more about geometry creation and manipulation in vex. I've been attempting to create a simple grid with lines moving along in one direction. Once the line reach the end of the grid, it moves back to the other end. Like a treadmill. I've been able to create some stuff with addvertex and addprim in a for loop, but nothing nice and procedural. Anyone have an elegant solution to this? Thanks Quote Link to comment Share on other sites More sharing options...
Librarian Posted July 27, 2019 Share Posted July 27, 2019 here you gonna find interesting examples Quote Link to comment Share on other sites More sharing options...
wakimsan Posted July 27, 2019 Author Share Posted July 27, 2019 (edited) Thanks srletak! Lots of nice inspiration there! Closest thing I could find was this(though I'm only after a simple 2d solution): The idea was to then convert each prim to a cube with some spacing. Not a very specific question I'm asking unfortunately... I'll post an update if I make any progress. Thanks Edited August 3, 2019 by wakimsan gif too darn big Quote Link to comment Share on other sites More sharing options...
wakimsan Posted August 3, 2019 Author Share Posted August 3, 2019 So, I managed to create a hacky version of my grid. Copied some cubes to it and added some rotation. Here the grid is static and my rotation is working fine. However my animated grid is not nice. The everchanging ptnums is an issue: It yields this result: So...new technique; creating points from scratch in vex, some simple animation and make sure pointcount stays consistent. Though that leaves me with a different issue and leads me to my question(finally). Is there any way to use the pcfind function to operate on a specific axis/vector? Here I'm currently using it with the distance function to calculate the scale of the points before copying cubes to them: int nearpt = pcfind(0,"P",@P,chf("rad"),chi("maxpt"))[1]; i@nearpt = nearpt; f@dist = distance(@P,point(0,"P",nearpt)); v@scale = @dist/2*chf("scale_mult"); It only really calculates a single closest point, though I need a separate calculation for X and Z and jam that into the scale vector. I'm trying to keep a consistent gap between all sides of the cubes. Thanks. 1 Quote Link to comment Share on other sites More sharing options...
wakimsan Posted August 10, 2019 Author Share Posted August 10, 2019 (edited) I managed to find a solution to my issue. The grid animation works quite well for the intended purpose, though a bit heavy. The rotation is a bit hacky. I can't be bothered to do it better atm. It may not be elegant, but it might be a good starting point for someone in the future. rotating_grid_v001.hipnc Edited August 10, 2019 by wakimsan gif 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.