4 ms·
Show HN: Skeletal Animation in Your Browser via Dual Quaternion Linear Blending
- eriknstr 10y agoNeat demo. I have a couple of suggestions for camera control: 1. Allow the use of the mouse for camera control. 2. Use up/down arrows for rotation similar to what you do with left/right and have separate keys control zoom.
- chinedufn 10y agoThanks! Ah yes great suggestions. Hastily threw the controls in a couple months ago and they're sure due for an update ( PR's welcome :) )
- Jasper_ 10y agoWhy not use the standard weighted matrix blending? What does the quaternion approach provide?
- corysama 10y agoStandard linear blending suffers from "candy wrapper" pinching. Dual quaternion blending is better at volume preservation. https://a.fsdn.com/con/app/proj/mayadqskinning/screenshots/116563.jpg https://a.fsdn.com/con/app/proj/mayadqskinning/screenshots/1...
- chinedufn 10y agoAh good idea linking to an image. Great illustration of the problem :)
- chinedufn 10y agoSo the problem with blending matrices is that you are not guaranteed to get a rigid transform (you might introduce scaling, for example). You are also not guaranteed to get the shortest path between your start and end matrices. So you'll often end up with weird stretching and other artifacts when you blend your matrices. Dual quaternions are guaranteed to produce rigid transforms when blended. You're also guaranteed to get the shortest path when blending. If you checkout an older commit in the repo such as - fe7cba263cc4f0ecc3ed96fb9288ed17469dd539 and `npm run demo` you'll see an example of the problem with matrix linear blending. You can also read more about this in "Skinning with Dual Quaternions" - https://www.cs.utah.edu/~ladislav/kavan07skinning/kavan07skinning.pdf https://www.cs.utah.edu/~ladislav/kavan07skinning/kavan07ski...
- Jasper_ 10y agoThank you for explaining, and for the reference!
- chinedufn 10y agoSure thing!
- notyourwork 10y agoProbably one of the best responses to that type of question. Explanation, reasoning for your decision along with a commit referenced to investigate further. Good stuff and great demo, thanks for sharing!
- chinedufn 10y agoYou're too kind! Thanks!
- bendbro 10y agoDo those blended matrix artifacts appear similar to artifacts produced when blending quaternions but not scaling the result to the unit circle?
- pzone 10y agoDual quaternion skinning seems to have failed to catch on. Support was removed from Unreal Engine for example. Why is this?
- chinedufn 10y agoAh good question. So I was using linear blend skinning and had those horrid artifacts. Google.com told me that dual quaternion skinning was the solution, so more or less blindly went with that. santaclaus mentioned OCR in another comment, so I'll be reading up on that
- santaclaus 10y agoSuper cool! Any chance that you'll add OCR skinning [1]? It looks really cool, and seems to get the best of both linear blend and dual quaternion skinning! [1] https://www.disneyresearch.com/publication/skinning-with-optimized-cors/ https://www.disneyresearch.com/publication/skinning-with-opt...
- chinedufn 10y agoThanks! So admittedly I only heard of DLB a few weeks ago, and OCR skinning 10 seconds ago :) But this looks pretty damn cool. Thank you so much for the link, I'm definitely going to read this paper and consider it for a standalone skeletal animation library that I've started working on
- deleted 10y ago[deleted]
- IanCal 10y agoI'm just getting an error in chrome > Uncaught TypeError: Cannot read property 'clearColor' of null I'll check back again later though, this sounds cool.
- chinedufn 10y agouh oh :( Well if it still doesn't work, feel totally free to try it locally: ``` git clone https://github.com/chinedufn/collada-dae-parser https://github.com/chinedufn/collada-dae-parser cd collada-dae-parser npm install npm run demo ```
- sazers 10y agoSmooth movement anyway.