krets Posted February 17, 2003 Share Posted February 17, 2003 I am animating a chain in houdini. Thus far I have done some studies with tubes animating in a circle. My results have been good and I can time it with the gear that I am using, but I need to be able to animate the span between 2 gears. My studies have included an offset of the tube center and used a copy SOP to create the repeating pieces of the chain. I have also created the spaning pieces animation using group operations on to lines of tubes to create the animation. I heard that a switch SOP might possibly work. I just need some suggestions. Thank you. Quote Link to comment Share on other sites More sharing options...
krets Posted February 18, 2003 Author Share Posted February 18, 2003 I have been rethinking this, and I am not sure that I have even found the correct direction to head in yet. I thought that I might do the whole chain animation in one sweep using a circular of objects and using a lattice to deform these objects to the shape that I want. This would work great for a tred animation if I was not to worried about the density of my pieces, but to be accurate I must maintain a consistent spread of chain links. This way is not working for me yet. I am using a copy sop, so perhaps I could change the angle of separation for a certain angle range within my copy operation. This would yield a lower density, but it would not be as accurate as I would like. Again I am just looking for suggestions. Thank you. Krets Quote Link to comment Share on other sites More sharing options...
krets Posted February 18, 2003 Author Share Posted February 18, 2003 Okay, this seems to be more of a progress report post for me. I am still quite new to houdini, but I think I have figured out an acceptable way to create my chain. I have been doing many studies in the past few days. Just today I realized I could use a circle to define my copy sop allowing me to then adjust the circle in a way that it keeps the segments between points an equal distance and my geometry does not get closer or further from the surrounding copies. This is necessary to make a chain look reasonable. I used a lattice to deform my circle so that I could resample the curve and not have the deformation change. The resample SOP now defines the number of copies in my copy SOP. The only unfortunate thing is that it will take a good deal of tweaking to my Lattice to create an accurate shape. I am still hoping to find another way. The animation is occuring high up in my tree, directly after the circle SOP. If I can find a way to change this I will be able to create a more accurate curve. Still looking for suggestions. Krets Quote Link to comment Share on other sites More sharing options...
michael Posted February 18, 2003 Share Posted February 18, 2003 looking good... is this chain like a bike chain?...something that I would do in Maya is use a 'spline IK', you might look into Houdini's 'follow curve' option in the bone solvers...you could use the # of points in your curve to determine the # of bones...then you could just animate to points of your curve and the bones would follow....I haven't tried it in Houdini, so I'm not 100% sure...just tossing out a suggestion Quote Link to comment Share on other sites More sharing options...
krets Posted February 20, 2003 Author Share Posted February 20, 2003 Thank you for replying. I have not tried the follow curve thing, that would be ideal. Truthfully I have just looked for it and I don't know where it would even be. I have gotten my setup working better but now my issue is the direction of the normals. I need the point normals to follow curve that I have as well. I need to find a way to get one point aiming its normal at the next point Right now my copies will be aligned with the normal and will not rotate as the go around the curve. eh, a picture can always explain more. I hope I do not get in trouble for posting too many pictures. I have learned to use GIF, they are much smaller with a limited pallete and still look good. Quote Link to comment Share on other sites More sharing options...
anakin78z Posted February 20, 2003 Share Posted February 20, 2003 to get the normals to point to the next point, you can download the Flo sop charles posted here: http://odforce.net/codex/geometry.php or you can use this little trick: plug your chain into a sort sop and shift the point numbers by 1. then, plug the previous sop into a point sops first input, and the sort sop into the 2nd input. Then, add normals and in the felds type: $TX2-$TX $TY2-$TY $TZ2-$TZ and that should do it. Cheers! Quote Link to comment Share on other sites More sharing options...
krets Posted February 24, 2003 Author Share Posted February 24, 2003 Thank you for the information. This has been helpful. I sill have some trouble contolling my objects as they move around the curve. They will spin, aimed correctly at the next point but spinning like a bead around a wire . Quote Link to comment Share on other sites More sharing options...
TheUsualAlex Posted February 24, 2003 Share Posted February 24, 2003 I tried using that same method of $T{XYZ}2-$T{XYZ} a couple of days ago, but unfortunately, when the point is turning on the curve, there is a twist going on on the rotation that's probably due to how the transformation is handled. Although I found a hack for it, but is there any better solution that'd prevent the twist without the use of VEX? Muchas gracias! ALex EDIT: umm... never mind. I'll look at Charles's VOP setup to see if I can get an idea of what's happening. Quote Link to comment Share on other sites More sharing options...
anakin78z Posted February 24, 2003 Share Posted February 24, 2003 I belive that if you add an up vector, you won't have that problem. Use a point sop to add it, and play with it untill everything points the right way. Quote Link to comment Share on other sites More sharing options...
krets Posted February 25, 2003 Author Share Posted February 25, 2003 I decided to diverge from my idea of having the copy sop do all the work. I am going to look into the up vector, though I don't know exactly what you mean. I have however gotten the effect I needed to get with this study through the following method: I have kept my lattice deformed, rotating circle that is resampled and used as the control for my copy sop. I have used a tube as the geometry for the copy sop, these will be my pins on my chain. They will not require much rotation. Today Alex showed me how to use the point() function. I set up a separate tube and a transform. The transform would use point to decide where to translate my object acrose the XY plane. Then using an inverse tangent function in the RZ and referencing the point I have translated to and then next point I set up. I used opdigits (again thank you alex) to decide the point numbers my xform would reference then I copied my transform sop (33 times.) I don't believe my code to be the most efficient but it is effective. here how my rz appears for the first tube_xform0 sop: if (point("../../res1", opdigits("."), "P",0)>=point("../../res1", opdigits(".")+1, "P",0), atan((point("../../res1", opdigits(".")+1, "P",1)-point("../../res1", opdigits("."), "P",1))/(point("../../res1", opdigits(".")+1, "P",0)-point("../../res1", opdigits("."), "P",0)))+180, atan((point("../../res1", opdigits(".")+1, "P",1)-point("../../res1", opdigits("."), "P",1))/(point("../../res1", opdigits(".")+1, "P",0)-point("../../res1", opdigits("."), "P",0)+.00000001))) I add .00000001 to avoid doing atan(0) which produces unwanted results. If you have any coding hints mention it. I did a test animation last night because I was not sure if it was animating smoothly. My computer simply could not handle a true real time animation, even when dropping frames. Unless the up vector thing pans out for me, I think I will start to model my componentes based on this setup. Thank you for all the help. Quote Link to comment Share on other sites More sharing options...
TheUsualAlex Posted February 25, 2003 Share Posted February 25, 2003 Dang! That's the longest expression I've seen to date. Congrat! Quote Link to comment Share on other sites More sharing options...
mike Posted February 26, 2003 Share Posted February 26, 2003 Hi, I still didn't find my original file, but I have made one wich points in a total different direction. Maybe it is helpfull. chain.hip Quote Link to comment Share on other sites More sharing options...
krets Posted February 26, 2003 Author Share Posted February 26, 2003 The shape of the chain and the animation are so much better than what I have done. I like Mike's method there. But the one problem I have with the overall chain model is that the chain links will be doformed as the rotate around. Luckily all that work and that extra long equation I have written is exactly what I need to keep my chain links from deforming. The picture shows my current setup with a better model to show why I can not have my chain links deform. I still have not figured out how to keep an up vector on point normal operation. If I can do this I will be able to automate my chain link placement. I think that I may try Mike's way of forming the chain shape, but I want to now try it with 4 partial circles to make up all of the gears that the chain would have to roll over in a typical derailer/ gearing setup. Thank you Michael! I am very excited about this project now. Quote Link to comment Share on other sites More sharing options...
krets Posted February 27, 2003 Author Share Posted February 27, 2003 With Michael's way of constructing the shape, I feel more confident that I can now move on to having an accurate size for my gears. I have also taken it to the next step with the curve construction and added the derailer gears. I also used my long equation to keep my chain links pointing at eachother. All this work I have put in should set me up well to do a very accurate bicycle gearing system. I am now ready to let this post rest. In a couple of weeks I will probably post my final render and perhaps offer a link to a video. for now here is how my basic chain has worked out. chain_v1.17.hipnc0166.tif Quote Link to comment Share on other sites More sharing options...
krets Posted February 27, 2003 Author Share Posted February 27, 2003 Woops that image was almost bigger than the hip file. The hip file would be better to look at anyhow, so here. Feel free to pick the whole thing apart. linked file 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.