Symbolic Posted June 26, 2010 Share Posted June 26, 2010 Hi, I have a wire animation coming from a wire simulation. I am trying to copy objects on to the points of the wire. I can see the orient attribute on the points, but the geometry that I copy on the wire points does not seem to rotate and follow. any ideas, thanks! Quote Link to comment Share on other sites More sharing options...
Symbolic Posted June 26, 2010 Author Share Posted June 26, 2010 (edited) Actually all of this is related to a wire simulation that I am trying to setup. Sorry for my bad drawings, But it is something like that: So I have a backbone, that will be a wire... And then I have secondary branches that will be wires as well. I could not find a way of setting up multiple wire constrains. So for this reason I decided to split this in two parts. First simulate the backbone. So it looks ok: But then when copy something on that curve, it does not orient properly: Because at this stage I need to run a second sim on the secondary branches which work as well, it is only that orientation problem that messes up things. I tried the Up vector thing, tangents etc. Also, there is an orient attribute on those curves that should be working... Any ideas? Thanks. Edited June 26, 2010 by Symbolic Quote Link to comment Share on other sites More sharing options...
loudsubs Posted June 27, 2010 Share Posted June 27, 2010 Try using the sweep sop instead of the copy, it might be what you're looking for. Quote Link to comment Share on other sites More sharing options...
petz Posted June 27, 2010 Share Posted June 27, 2010 example file attached! petz frenet_frame.hipnc 1 Quote Link to comment Share on other sites More sharing options...
Symbolic Posted June 27, 2010 Author Share Posted June 27, 2010 example file attached! petz Wow petz! Thanks man! I did not understand your CHOPs approach (not very good in chops - need to study your file when I have time) but quickly put a VOPSOP with some cross product stuff in it and a simple way to calcualte tangents. It works. Thanks! And yeah... I am deleting that "orient" attribute, it is crap for some reason and overrides my N and up attributes. Quote Link to comment Share on other sites More sharing options...
Macha Posted June 28, 2010 Share Posted June 28, 2010 Hey Petz, this is interesting. Did I just witness you perform deep dark and magical vector-calculus wizardry in that CHOP? It never occured to me we could use CHOPs like that but now after seeing this it seems such a natural thing to use it for. Quote Link to comment Share on other sites More sharing options...
graham Posted June 28, 2010 Share Posted June 28, 2010 The Vector CHOP is definitely awesome. It was added into Houdini 10.0.473 back at the end of November. It was originally added in what's now Houdini 11, but was put into 10.0 a while later. It kind of just snuck in there so not a lot of people know its there, but it is really useful. Quote Link to comment Share on other sites More sharing options...
Stalkerx777 Posted June 28, 2010 Share Posted June 28, 2010 Yes, very cool trick with CHOPS, long time ago i was making such things with expressions, but now i prefer VOPS for that. But i have a question. In Copy SOP, normal attribute of a template geometry used to calculate orientation of copied geometry right? What if my normal is already "busy", i mean, i cant touch them, but i have my custom vector attr, and i want to use it in copy SOP, instead of N. Is it possible? Thanks. Quote Link to comment Share on other sites More sharing options...
Marc Posted June 28, 2010 Share Posted June 28, 2010 The copy SOP will use the 'orient' attribute if it exists and then fall back on N, up and v if there is no orient attribute. If your N is already spoken for then you'll need to convert your vector into a quaternion and call that 'orient'. Cheers Marc Quote Link to comment Share on other sites More sharing options...
Macha Posted June 28, 2010 Share Posted June 28, 2010 (edited) What if my normal is already "busy", i mean, i cant touch them, but i have my custom vector attr, and i want to use it in copy SOP, instead of N. Is it possible? Thanks. You can use an orient quaternion side by side with the normal. I attached a file. There's a problem with the rotation speed but you can fix it with a simple trig expression, I forgot how though, it's mentioned somewhere on odforce. But I would be tempted to use different attributes if your normal attribute is already used. Or, you could copy or transfer it back to the geometry afterwards. It depends on the setup I guess. Btw, I have a hunch that the CHOP magic above is much deeper, darker and more subtle than you could do in VOPs. Quite beautiful actually, I'm all excited. *cδugh* orient.hipnc Edited June 28, 2010 by Macha Quote Link to comment Share on other sites More sharing options...
Stalkerx777 Posted June 28, 2010 Share Posted June 28, 2010 (edited) Thanks guys, i just simply have not considered, that my orient attr needs to be quaternion instead of just vector3 Now everything works fine.Thx. Edited June 28, 2010 by Stalkerx777 Quote Link to comment Share on other sites More sharing options...
Marc Posted June 28, 2010 Share Posted June 28, 2010 The copy SOP used to use the 'rot' attribute from pops, but at some point they changed it without telling anyone (ok, they may have told people, but I had to learn the hard way). Quote Link to comment Share on other sites More sharing options...
Symbolic Posted June 28, 2010 Author Share Posted June 28, 2010 Thanks to everyone. CopySOP has always been one of the most powerful but still very unpredictable one as well. I still think that something is wrong either with the "orient" coming from the wire simulation or in general, because the copied instances just do not align properly when "orient" is around, only after "orient" is deleted and proper N and Up is introduced. Quote Link to comment Share on other sites More sharing options...
Stalkerx777 Posted June 28, 2010 Share Posted June 28, 2010 Thanks to everyone. CopySOP has always been one of the most powerful but still very unpredictable one as well. I still think that something is wrong either with the "orient" coming from the wire simulation or in general, because the copied instances just do not align properly when "orient" is around, only after "orient" is deleted and proper N and Up is introduced. No, actually everything fine with copy SOP. Your orient attr didn't work because.... well its not that "orient" attr, copy sop expecting for. I think build-in methods of this sop, can automatically handle conversion from simple vector3 attribute, to vector4 quaternion rotations, and by default, this conversion applied automatically to attributes "N" and "rot" (As Marc mentioned before). "up" vector is just vector3. And if you want to feed your "orient" to copy SOP, (thats why i created this topic), you need to calculate this attribute as quaternions in VOPS. Quote Link to comment Share on other sites More sharing options...
petz Posted June 28, 2010 Share Posted June 28, 2010 Hey Petz, this is interesting. Did I just witness you perform deep dark and magical vector-calculus wizardry in that CHOP? oh, nothing magical happens there. for computing a TNB-frame you need to take the first and second derivative of the curve and thats exactly what the slope-chop is doing. the vector-chop is then used to compute the cross product and normalizing the vectors. more or less the same can be done using "primduv" but by reason of some rounding issues with densely resampled curves chops seems to be much better. petz Quote Link to comment Share on other sites More sharing options...
edward Posted June 29, 2010 Share Posted June 29, 2010 Try out also the PolyFrame SOP. Quote Link to comment Share on other sites More sharing options...
Macha Posted June 29, 2010 Share Posted June 29, 2010 oh, nothing magical happens there. for computing a TNB-frame you need to take the first and second derivative of the curve Oh it's magical enough for me. I've already had wild wet dreams of torsion attributes and Ricci flows. Quote Link to comment Share on other sites More sharing options...
Symbolic Posted July 1, 2010 Author Share Posted July 1, 2010 No, actually everything fine with copy SOP. Your orient attr didn't work because.... well its not that "orient" attr, copy sop expecting for. I think build-in methods of this sop, can automatically handle conversion from simple vector3 attribute, to vector4 quaternion rotations, and by default, this conversion applied automatically to attributes "N" and "rot" (As Marc mentioned before). "up" vector is just vector3. And if you want to feed your "orient" to copy SOP, (thats why i created this topic), you need to calculate this attribute as quaternions in VOPS. Well, It is the "orient" coming from DOPs wire simulation, something is broken there for sure, it is quaternion as well. Anyway. I just found my self diving into matrix calculations and rotations etc. I will do it brute-force... calculating everything by my self Thanks for the tips and the examples. 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.