sibarrick Posted May 3, 2008 Share Posted May 3, 2008 (edited) For those of you wanting to do more with quaternions here is a nice simple-ish demo of blending both quaternion rotation and quaternion translation, using a method called the dual quaternion. Its just a demo, not a real application, and its written in vex so you can see the code used and put it to your own uses. The sort of thing this can be used for is smooth camera position blending and my personal interest deformation/skinning. The sop in the hip file simply lets you specify a start position and rotation and an end position and rotation. (rota, posa -> rotb, posb) you can then blend between these two states using the bias parameter and what that does under the hood is lerp the dual quaternions that represent the rotations and positions. What you should notice is if you play the animation the cube follows a nice smooth curve, when its at the end (frame 30) try messing around with the rotations and positions and watch how the interpolation re-calculates itself. There are several ways to perform the lerp from the start to the end, a true dual quaternion slerp would preserve the velocity and the distance between frames, the method I'm using is just the quickest and easiest and isn't 100% accurate but it's fast and not far off the "correct" result. DualQuaternionBlending.zip Edited May 3, 2008 by sibarrick Quote Link to comment Share on other sites More sharing options...
sibarrick Posted May 4, 2008 Author Share Posted May 4, 2008 The more astute amongst you will have notice a small mistake in the above. When rota is (0,0,0) the cube is still rotated. This version fixes that... DualQuaternionBlending.zip 1 Quote Link to comment Share on other sites More sharing options...
sibarrick Posted May 4, 2008 Author Share Posted May 4, 2008 (edited) So I've been thinking about this some more and I figured it would be very easy to add this method into the regular bone deform sop, it can use all the regular capture stuff but add on some nice non linear blending at the joints. The only problem I have is I can't remember what the pCapt detail attributes mean. For each bone in the system you seem to get 20 pCapt detail attributes, the point ones seem fairly obvious, bone path plus weight. I think all I need is the point attributes, but I'm just wondering what the heck the detail ones do.... does anyone know? Maya plugin Edited May 4, 2008 by sibarrick Quote Link to comment Share on other sites More sharing options...
Mario Marengo Posted May 5, 2008 Share Posted May 5, 2008 Hey Simon! Many thanks for all this very cool-looking quaternion stuff. I'll try to dig into this as soon as I get a little time -- top of my list. I take it this is using that "algebraic" quaternion stuff you pointed to in your other thread? (the non-imaginary-numbers thing?). Maybe there's a hope that I'll finally understand quaternions! Thanks again for the tip and the samples! Cheers. Quote Link to comment Share on other sites More sharing options...
sibarrick Posted May 5, 2008 Author Share Posted May 5, 2008 Hi Mario, actually I think this is slightly different to that stuff. That stuff is geometric algebra (GA), which is a whole framework for doing 3D, and yes it includes quaternions but this is just a technique for extending quaternions to include translation. Its not a whole frame work and as I understand it (which at the moment isn't all that well) it uses different maths. The GA stuff includes methods for rotation, reflection, scaling the whole bit. Fully implimented its apparently slower than normal matrix math (but simpler to use, apparently, if you understand it!) However I believe the guys at Geomeric have optimised the code so that it runs faster. Stuff that is inherently quicker is sphere intersection tests, as you can imagine that's pretty useful. Cheers for the lecture on Spectral colours, very illuminating! Quote Link to comment Share on other sites More sharing options...
Mario Marengo Posted May 5, 2008 Share Posted May 5, 2008 However I believe the guys at Geomeric have optimised the code so that it runs faster. Stuff that is inherently quicker is sphere intersection tests, as you can imagine that's pretty useful. Huh! So you're saying that GA is somehow at the heart of (or plays an important role in) Geomeric's realtime radiosity? Now I'm itching to learn this stuff! Cheers for the lecture on Spectral colours, very illuminating! Thanks. Quote Link to comment Share on other sites More sharing options...
sibarrick Posted May 5, 2008 Author Share Posted May 5, 2008 Huh! So you're saying that GA is somehow at the heart of (or plays an important role in) Geomeric's realtime radiosity?Now I'm itching to learn this stuff! Thanks. That's my understanding.... 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.