GallenWolf Posted June 3, 2008 Share Posted June 3, 2008 Hey Houdniks! I'm looking for a way to extract transforms from two objects to use in DOPs. Basically: I have object A, teapot sitting at the origin. I have object B, an animated teapot flying around. This is brought in through a file sop i.e. baked. Both objects have the exact same topology, point count. How would you extract the transforms so that Object A is able to be transformed exactly into the motion path of object B? Been trying out stuff in CHOPs but I can't really figure out a good way. Thanks for any ideas! Alvin Quote Link to comment Share on other sites More sharing options...
ihab Posted June 3, 2008 Share Posted June 3, 2008 Hi Alvin, Rivet Object. Check the attached file. Cheers alvin_teapot.zip Quote Link to comment Share on other sites More sharing options...
GallenWolf Posted June 5, 2008 Author Share Posted June 5, 2008 Hey man! Thanks! This is exactly what I'm using atm, but we will always need to adjust the static object to get it's first frame alignment properly. I want to avoid that in order to streamline things as well as get the exact accurate transforms. Cheers! Alvin Quote Link to comment Share on other sites More sharing options...
edward Posted June 5, 2008 Share Posted June 5, 2008 An idea would be to pick three non-collinear points from the teapot and use that to form a frame of reference. Now for each frame, you create a rotation matrix out of the frame of references created from object A and object B. Now you explode this matrix and use its euler rotation angles for the transform. Then run it through a default Transform CHOP to ensure that there's no subframe flipping. For translations, use the delta from the origin of the frame of references. Hmm ... well, you might need to translate the origin point to 0,0,0 first. Quote Link to comment Share on other sites More sharing options...
GallenWolf Posted June 5, 2008 Author Share Posted June 5, 2008 Sounds good Ed! Gotta find some time to play with that. Thanks!!!! Alvin Quote Link to comment Share on other sites More sharing options...
Jason Posted June 5, 2008 Share Posted June 5, 2008 What you're talking about here is a very common tool at all the bigger houses... kind of a Rivet Object but in SOPs; and group-aware. It's such a common need that I'd think that there might be enough reason to consider asking that SESI should consider providing such an animal in the Houdini tool-set. An idea would be to pick three non-collinear points from the teapot and use that to form a frame of reference. Now for each frame, you create a rotation matrix out of the frame of references created from object A and object B. Now you explode this matrix and use its euler rotation angles for the transform. Then run it through a default Transform CHOP to ensure that there's no subframe flipping. For translations, use the delta from the origin of the frame of references. Hmm ... well, you might need to translate the origin point to 0,0,0 first. Quote Link to comment Share on other sites More sharing options...
edward Posted June 5, 2008 Share Posted June 5, 2008 Sorry, I don't see how this is a "Rivet" kind of operation? Quote Link to comment Share on other sites More sharing options...
Netvudu Posted June 5, 2008 Share Posted June 5, 2008 (edited) would it be possible to use the sopcreateedit command from the textport for something like this? AFAIK it creates an Edit SOP with the transform... Edited June 5, 2008 by Netvudu Quote Link to comment Share on other sites More sharing options...
Jason Posted June 5, 2008 Share Posted June 5, 2008 Sorry, I don't see how this is a "Rivet" kind of operation? I mean in the sense that the Rivet seems to manufacture a transform from points or polygons. Quote Link to comment Share on other sites More sharing options...
stevenong Posted June 5, 2008 Share Posted June 5, 2008 What you're talking about here is a very common tool at all the bigger houses... kind of a Rivet Object but in SOPs; and group-aware. It's such a common need that I'd think that there might be enough reason to consider asking that SESI should consider providing such an animal in the Houdini tool-set. I second this & I put this down in my post to the Houdini 10 thread. It will be nice to have a Move to Origin SOP but it will retain all the transformations plus attributes with options to compute the inverse direction etc. After making the changes, you can append a Move to Original SOP which will put the geometry back where it came from. Or any particle system or geometry that's created relative to the geometry & the SOP will transform them there. It will be great to see this in Houdini 10. Cheers! steven Quote Link to comment Share on other sites More sharing options...
edward Posted June 6, 2008 Share Posted June 6, 2008 Just to be clear on this, I don't see how this can't be done as an HDA. Quote Link to comment Share on other sites More sharing options...
Jason Posted June 6, 2008 Share Posted June 6, 2008 Just to be clear on this, I don't see how this can't be done as an HDA. Spoken like a true programmer, Ed! Well, of course; you can build almost anything in HDAs, with VEX, Python, etc. You can use that argument about most of Houdini. But there are advantages to making an HDK version out of it.. firstly, the speed and lower memory footprint - which can be significant if you're aligning thousands of objects. Secondly it just provides another useful tool to the artist and facilitates and suggest an alternate way of doing something. Many people might not have the idea that a tool like this would be useful, and even if they found out about this type of technique might not be able to build it themselves... people we like to call "artists". Quote Link to comment Share on other sites More sharing options...
GallenWolf Posted June 6, 2008 Author Share Posted June 6, 2008 (edited) I got some time to play with this yesterday, but was only able to extract the positions, not the rotations. This was with the Object Chop. All I need now is something like an Orient constraint of sorts. Any hints guys? Alvin Edited June 6, 2008 by GallenWolf Quote Link to comment Share on other sites More sharing options...
symek Posted June 6, 2008 Share Posted June 6, 2008 (edited) I got some time to play with this yesterday, but was only able to extract the positions, not the rotations. This was with the Object Chop. All I need now is something like an Orient constraint of sorts.Any hints guys? Alvin I don't know guys, but if these two teapots are topologically identical I would try use PointSOP for that purpose Anyways... 1. http://forums.odforce.net/index.php?showtopic=7075&hl= 2. http://forums.odforce.net/index.php?showtopic=6993&st=12 3. http://forums.odforce.net/index.php?showtopic=6924&hl= (my example is wrong since it's based on one vactor transformation instead of two. Look on Simon's post explaining quaternions). Edited June 6, 2008 by SYmek Quote Link to comment Share on other sites More sharing options...
edward Posted June 6, 2008 Share Posted June 6, 2008 Spoken like a true programmer, Ed! Actually, that was my TD side speaking. Since I assume GallenWolf is in production, it's most appropriate to note that it can already be done today. Quote Link to comment Share on other sites More sharing options...
Jason Posted June 6, 2008 Share Posted June 6, 2008 Actually, that was my TD side speaking. Since I assume GallenWolf is in production, it's most appropriate to note that it can already be done today. Alright, I'll let you off on what I'll call a technicality this time However, the spirit of what I was saying I find important. Quote Link to comment Share on other sites More sharing options...
GallenWolf Posted June 12, 2008 Author Share Posted June 12, 2008 Hey guys! Sorry was away for a few days (long weekend here) - SY - I'll be looking into those links. I've seen the teapot constraint b4, but I want this for dops. I'll figure it out. One day. GW Quote Link to comment Share on other sites More sharing options...
GallenWolf Posted October 23, 2014 Author Share Posted October 23, 2014 It has been a long while And today I had need of this, and decided to try again. I think I got it working! It's barebones and not tested extensively (it's waay past bedtime!), would love to hear if there is something I missed! I got the solution from: http://www.flipcode.com/documents/matrfaq.html#Q40 Q40. How do I use matrices to convert one coordinate system to another? extractTransformMatrix_v001.hipnc 2 Quote Link to comment Share on other sites More sharing options...
michael Posted October 23, 2014 Share Posted October 23, 2014 hahaha... 4 YEARS later Quote Link to comment Share on other sites More sharing options...
edward Posted October 23, 2014 Share Posted October 23, 2014 Can we use Extract Transform these days? 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.