Search the Community
Showing results for tags 'center'.
-
Thought I'd share a little primitive center rotation snippet, any comments welcome. Note: Requires connectivity node upstream set to primitive and attrib "class". //Rotate primitive around center and defined axis int points[] = primpoints(0, @primnum); vector axis = set(0,1,0); //define user axis //vector axis = normalize(@N); //if normal axis is required float angle = ch('angle'); matrix3 rotm = ident(); rotate(rotm, radians(angle), axis); //get center (requires connectivity node, set primitime and sttrib "class") string grp = '\@class='+itoa(i@class); vector CenterPivot = getbbox_center(0,grp); vector pos; // move points to origin, rotate, move back foreach(int pt; points) { pos = point(0,"P",pt); pos -= CenterPivot; pos *= rotm; pos += CenterPivot; setpointattrib(0,"P",pt,pos, "set"); }
-
How can I prevent particles from emitting from packed primitives center ?
-
- packed primitives
- packed
-
(and 2 more)
Tagged with:
-
This is probably not as hard as I think but I'm trying to find a way to draw a line down the center of an animated object using vex. I have a tube that is a cache and it is deforming. The points and polys don't change. I want to create a curve that goes directly down the center of the tube. I was successful by manually deleting some poly loops, and using a divide node with remove shared edges and then packing the shared faces then using an add to connect the center points, this is a quick and DIRTY way that worked. But I would like a more robust procedural way of doing this, if I had a lot of objects this way would be a pain. I have attached a .hip for if someone would like to help me out with this it would be much appreciated thanks in advance. Rob FindthecenterTest.hip
-
Hey guys, Hopefully this is a quick one. I was wondering how I could find the average position of a group of particles (and store the position as an attribute on the particles in that group)? Say I have two groups, A and B, and I want to find the average position of the particles in group A and create a force on the particles in group B to go towards that point (center of A), and at the same time have all the particles in group A move towards center of B. POP Group A -> Center of POP Group B POP Group B -> Center of POP Group A Thanks