View Full Version : Stick Poly to Poly?
03-22-2006, 06:18 PM
I've got a cylindar and a cube. The polys on the sides of the cylindar are the same sizes as the polys on the cube. I need to 'stick' one of the cylindar's polys to one of the cube's polys.
I've tried to use a Polygon Node in the way one would use the Point Node but I guess I don't fully understand it. I can of course get points to stick to each other but this seems to be a different animal. I've also tried Srek's xp_align2polygon method but from what I can deduce it doesn't let me choose which polys I want to stick to each other.
Does anyone have a suggestion?
A polygon is only defined by it's points. You have to pin the points to one another.
03-22-2006, 09:08 PM
I never thought of that.
Still, in your example, it seems like you are sticking normals together?
I wonder if one could connect the polygon number to the normal and do it that way.
Then again if sticking all the points together works, what's the point :D
03-22-2006, 10:30 PM
I don't know if this differs from COFFEE or C++, but I would think that there are two potentials here. One is pinning the points to one another, which one would think also requires making changes to the affected polygons' vertex indices. The other would just be just to update the polygons' vertex indices and be done with it (plus possibly removing redundant vertices if desired). This is how I 'weld' imported Wavefront OBJ 'groups' back together. No points are harmed in the making of the one object, only the polygon indices are updated (this retains vertex order for things like morphs).
03-23-2006, 01:49 AM
Welp, I'm not having much luck attaching points. I can do it with splines but when I try with the polys they don't go to the points I see in the Structure Manager. I trashed the file and started over and now I see no evidence that the Constants have taken.
In the attached file I have two versions.
1- An Object Version.
This is where I'm trying to connect the polys (look at the Xpresso to see which ones).
2- A Spline Version.
This one works but since the splines deform the effect is a little lost.
I'm trying to stick 1 to 2 at the red circled area shown in the pic below.
I tried this with Bones but got quickly lost.
See my post here:
03-23-2006, 02:46 AM
FusionThing may the what you are looking for;
Example pics from the fusionthing thread;
Link to CGTalk Thread (http://forums.cgsociety.org/showthread.php?t=261317&highlight=fusionthing)
Link to FusionThing Homepage (http://www.lotsofpixels.com/fusionThing/)
03-23-2006, 01:21 PM
Tiziano, you've chosen the right approach but have made a simple error in the first set of nodes. Instead of points 5 and 127, you should have 2 and 143.
Here's a version using the same principle but with fewer nodes.
03-23-2006, 10:19 PM
Thanks Darter, that's what I was after. Interesting way of doing it too. There'll be some learning ahead for me :applause:.
The downside is that, once I had the points/polys stuck, I assumed the objects would be stuck together and then they would move as one :shrug:.
Oh well, I learned a few things.
03-24-2006, 09:52 AM
The chosen points of the Pitman objects are moving based on the positions of the ControlCircle points to which they are attached. None of the other Pitman points are affected, so they stay in the same position.
Of course, if you want the objects to move together you could make the WheelNull objects children of the ControlCircle object. If for some reason you need to maintain the same hierarchy structure, you could e.g. use MatrixMulVector nodes.
In the example scene, vectors representing the positions of the WheelNull objects relative to the ControlCircle are converted to global coordinates. These vectors are then converted to local coordinates relative to the shared parent i.e. the Wheels object. This makes the WheelNull objects move with the ControlCircle, even though they are on the same hierarchy level.
03-24-2006, 04:11 PM
Thanks Darter.If for some reason you need to maintain the same hierarchy structure, you could e.g. use MatrixMulVector nodes.That's been one of my main problems, keeping the hierarchy as set up but affecting objects as if they were in a different hierarchy. Again, much learning ahead.
03-25-2006, 08:11 AM
Thanks Darter.That's been one of my main problems, keeping the hierarchy as set up but affecting objects as if they were in a different hierarchy.
Okay, one last step to achieve this is to use the rotation of the ControlCircle object to drive the rotations of the WheelNull objects. This keeps correct orientation for the WheelNulls when the ControlCircle is rotated (see the updated file).
03-25-2006, 03:35 PM
Okay, one last step to achieve this is to use the rotation of the ControlCircle object to drive the rotations of the WheelNull objects. This keeps correct orientation for the WheelNulls when the ControlCircle is rotated (see the updated file).I'm after something a little different but I think I'm missing a concept. Perhaps it's a Global vs. Local Rotation issue but I believe I've tried every permutation of that.
In the scene attached, select the 'ControlWheel' and Rotate.H it to the left. Notice how, as you rotate more, the Left Wheel turns a little more than the Right. This is good and the opposite happens when you Rotate.H to the right. -Since I've selected 'Tangental' in the 'Align To Spline' tag you can click anywhere in the view and they'll go back to 0º.
My intent here is to animate the 'Align To Spline' tag and have the wheels turn left and right properly as described above. As it is, if you hit 'Play,' you'll notice the wheels going all wonky.
I think the concept is to have the 'Wheel Rig' follow the GlobalRotation.H of the 'ControlWheel.'
Then I thought I set up the 'ControlCircle's' 'Rotation.H' to follow the 'ControlWheel's' 'GlobalRotation.H.'
03-28-2006, 12:33 PM
Sorry for the delay in replying, I've just had time to sit down and look at this.
Firstly, look at the ControlCircle rotation values at which the wheels rotate without passing through its mesh. They range from about -5 to 5 degrees. The ControlWheel Global Rotation values driving the ControlCircle rotation are way outside of this range, making the wheels rotate wildly.
If you remove this part of the expression and target ControlCircle to an offset null, you'll get more reasonable rotation. ControlCircle rotates within a narrower range to point at the target.
This setup uses a Spline node instead of ATS tags and offsets the target with User Data. The lag between the ControlWheel and Wheel Rig positions has been eliminated.
03-28-2006, 04:15 PM
Firstly, look at the ControlCircle rotation values at which the wheels rotate without passing through its mesh. They range from about -5 to 5 degrees. The ControlWheel Global Rotation values driving the ControlCircle rotation are way outside of this range, making the wheels rotate wildly.OK, makes sense.
If you remove this part of the expression and target ControlCircle to an offset null, you'll get more reasonable rotation. ControlCircle rotates within a narrower range to point at the target.I see how that's working, just not sure why? Is it because the null has no geometry (or mesh)?
BTW- by now this whole thing has turned into me (you, for me really :D) reinventing the wheel so to speak :D. Base80, among others, has a wheel setup that incorporates Ackerman steering. I just thought I'd try it visually rather than just through math.
Here's some of my sources:
And a cool Flash based description:
-kind of small to read, use the 'left/right' white bar in the center.
03-28-2006, 08:06 PM
I see how that's working, just not sure why? Is it because the null has no geometry (or mesh)?
Any object can be used. Its purpose is to provide a position vector for the Target expression.
If you adjust the Target Offset value, you'll see the null move along the spline relative to the ControlCircle. The ControlCircle rotates so that its Z axis always points at the null
03-28-2006, 08:25 PM
Thanks Darter, you've been a great help. Now I think I get it.
Between the Guinness I owe Rantin Al and the Fosters I owe you, I better go get an additional job :D
03-28-2006, 08:25 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
vBulletin v3.0.5, Copyright ©2000-2015, Jelsoft Enterprises Ltd.