sibarrick Posted April 9, 2009 Share Posted April 9, 2009 Ok so as a branch from here PMVC I've started looking at GMVC - General Mean Value Coordinates These coordinates are in 2D for now and I'm hoping to extend them into 3D using the same technique as in the PMVC stuff, why? just cos, and because the one limitation in PMVC is that the control cage needs to be triangles, GMVC takes that limitation away and will still be a positive value coordinate system for convex polys (i.e quad mesh control cages) that should with a bit of luck lead to even smoother deformations, that's the idea anyway. Along the way we also get a useful method for interpolating attributes in 2D too and even for image warping (although I probably won't impliment that here) To read up on GMVC go here - GMVC - It's a heavy read (and I only understand about 1/20th of it) but if you scan down you'll see some great pictures that illustrate pretty clearly the sort of thing you get from GMVC. So this is my first stab at implementing what's in that paper, its a python sop, my new favourite development tool, and the hip file shows the very basics of what it does. It doesn't work properly with more than one polygon yet and it only interpolates colour attributes but its a good start. Here's some pictures from it. What this shows is the difference between this method and the normal barycentric method that the scatter sop uses, in the barycentric method the input is triangulated first (I'm guessing a bit here as only Sesi know precisely what they do but it must be something like this) the triangulation then shows up in the interpolation of the colours, as you can see with GMVC you don't get that artifact. The input in this case is just a circle with red, green and blue points, I then scatter some points onto the circle and either use GMVC to interpolate the colours from the circle or use the built in method of the scatter sop to pick them up. I've also attached the hip file I used to make the picture. GMVC.hipnc Quote Link to comment Share on other sites More sharing options...
Hazoc Posted April 9, 2009 Share Posted April 9, 2009 Damn what a nasty, nasty looking paper. How do start approaching something like this ? Especially if you understand only a portion of it like you said ? I see your python sop and the pseudo code on page 12 have a lot in common. But that's about all I can see at the first glance:) Great project and very educating to watch. Quote Link to comment Share on other sites More sharing options...
sibarrick Posted April 9, 2009 Author Share Posted April 9, 2009 You nailed it really, if I can find a paper with pseudo code that makes my life sooo much easier. Often there are bits missing or unclear in the pseudo code but then I do have a general grasp of these types of coordinates so i know what should be happening even though I may not understand the mathematical proof. This paper is an unusual mix in that it has some very dense maths in it and a nicely summarized "how to" generally I find the dense maths papers don't do that and the simpler papers don't bother with psuedo code. I often think if there isn't a clearly written implementation method or pseudo code chances are its too convoluted a method to bother with. Outside of that read the bits you can follow like the abstract and the summary, and google around for similar papers and presentations they often generalise the techniques thus giving you a better understanding of what the subject is all about. When all else fails just email the guy who wrote it, the couple of times I've needed to do that they have been very helpful, they are flattered that you are actually doing something with their research so that it might get used. I think the people in research when they write these papers really want to make it clear its just they work in a rarified atmosphere and forget how intense this stuff can be when written as pure maths, then again the papers aren't really written for coders they are written as mathematical papers so they need to be rigorous. I think all papers should have a clear implementation section or they shouldn't be accepted..... it would make life easier for people trailing in the wake. Quote Link to comment Share on other sites More sharing options...
Hazoc Posted April 9, 2009 Share Posted April 9, 2009 I think all papers should have a clear implementation section or they shouldn't be accepted..... it would make life easier for people trailing in the wake. I totally agree. Less academic people really are lost with the math and terms, even the simple stuff, but few lines of implementation aspects can offer a whole new way to see and understand the mechanics. This should be in everyone's interest if the goal is to benefit and evolve the entire computer graphics field as an art and science instead of just writing circumlocutionary papers from academia to academia with questionable practical benefits. Sorry about offtopicin:) Quote Link to comment Share on other sites More sharing options...
Jason Posted April 9, 2009 Share Posted April 9, 2009 Great, Simon - I'll be following this thread closely:) I totally agree. Less academic people really are lost with the math and terms, even the simple stuff, but few lines of implementation aspects can offer a whole new way to see and understand the mechanics. This should be in everyone's interest if the goal is to benefit and evolve the entire computer graphics field as an art and science instead of just writing circumlocutionary papers from academia to academia with questionable practical benefits.Sorry about offtopicin:) The worst are those companies that present things at SIGGRAPH with a "we did this using a proprietary technique we can't share", or those that leave out an important section in their paper -- it turns SIGGRAPH into a strictly marketing affair when it's meant to be a conference. Drives me mad. Quote Link to comment Share on other sites More sharing options...
jrgauthier Posted April 10, 2009 Share Posted April 10, 2009 Sweet! I also saw you posted the PMVC on your web site...great! Can't wait to see what comes out of this one! Cheers! Quote Link to comment Share on other sites More sharing options...
edward Posted April 11, 2009 Share Posted April 11, 2009 Simon, I only skimmed this one again quickly and it's been a long time since I last looked at this but I thought the paper by Floater didn't handle 3D polygon cages? I vaguely recall liking Spherical Barycentric Coordinates: http://www.mpi-inf.mpg.de/~langer/publicat.../paperSGP06.pdf http://www.mpi-inf.mpg.de/~langer/publications/report06.pdf (additional details) Quote Link to comment Share on other sites More sharing options...
edward Posted April 11, 2009 Share Posted April 11, 2009 PS. Also see Langer's Thesis: http://www.mpi-inf.mpg.de/~langer/publications/thesis.pdf Quote Link to comment Share on other sites More sharing options...
sibarrick Posted April 11, 2009 Author Share Posted April 11, 2009 (edited) Simon, I only skimmed this one again quickly and it's been a long time since I last looked at this but I thought the paper by Floater didn't handle 3D polygon cages? I vaguely recall liking Spherical Barycentric Coordinates:http://www.mpi-inf.mpg.de/~langer/publicat.../paperSGP06.pdf http://www.mpi-inf.mpg.de/~langer/publications/report06.pdf (additional details) Looks like you skimmed my post too No they don't but I reckon I can use the technique I used in PMVC to extend them into 3D, or at least I'm going to try it and see. I believe the reason the authors of that paper didn't was because they were using the GPU and were limited to RGB space for storing the barycentric coordinates. Also if you search around here or look on my site you'll see I've done Spherical Barycentric Coordinates already.... That thesis looks very interesting, cheers for the link, how do you find this stuff? just google or via siggraph or something else? Edited April 11, 2009 by sibarrick Quote Link to comment Share on other sites More sharing options...
sibarrick Posted April 11, 2009 Author Share Posted April 11, 2009 From Langer's thesis modifiying the barycentric coordinates to higher order looks very interesting, I especially like the fact it is independent of the original calculation, that means I could apply it to all my methods, very cool, I'll have to try that. Quote Link to comment Share on other sites More sharing options...
edward Posted April 11, 2009 Share Posted April 11, 2009 No they don't but I reckon I can use the technique I used in PMVC to extend them into 3D, or at least I'm going to try it and see. Ah, I see now. That thesis looks very interesting, cheers for the link, how do you find this stuff? just google or via siggraph or something else? Whenever I see a paper on an author's website, I always go through the author's publications page as well to see if they've done anything newer in that same area. Quote Link to comment Share on other sites More sharing options...
sibarrick Posted May 16, 2009 Author Share Posted May 16, 2009 Small update, finally had a bit of time to look at this some more. I've fixed a few bugs with my first implementation and now it correctly works for convex and non-convex polys, but i still haven't got multiple polys working, hopefully I can sort that out next. Here's another image and a hip file with the updated node in it GMVC.hipnc Quote Link to comment Share on other sites More sharing options...
sibarrick Posted May 16, 2009 Author Share Posted May 16, 2009 Found the problem, this now works with multiple polys GMVC.hipnc Quote Link to comment Share on other sites More sharing options...
kubabuk Posted May 17, 2009 Share Posted May 17, 2009 Nice one! Thanks for sharing. kuba Quote Link to comment Share on other sites More sharing options...
sibarrick Posted May 17, 2009 Author Share Posted May 17, 2009 (edited) Another small update... I've started changing the code so that you can transfer a list of attributes and store the calculated weights. This still needs work to test for numeric attributes only but basically works. In this example file it transfers Cd and N.... [edit] uploaded the wrong version, which had errors...... try this one. GMVC.hipnc Edited May 17, 2009 by sibarrick Quote Link to comment Share on other sites More sharing options...
sibarrick Posted May 18, 2009 Author Share Posted May 18, 2009 More bug fixes and improvements..... Fixed a bug with the order attributes were looked up from the user parameter, and fixed the auto detect for vectors (like N) so there is no need to pre add vector types. GMVC.hipnc Quote Link to comment Share on other sites More sharing options...
sibarrick Posted May 24, 2009 Author Share Posted May 24, 2009 So I've done my first tests extending this into 3d and it seems to work, at least at the basic level, ie I can capture an object using quads now rather than just triangles, I can't see any reason why this shouldn't work with higher order polys but quads is really what is most useful. Here's an initial implementation. As a python sop its somewhat slower even than the original method but there's an extra level of calculation going on so I guess its too be expected, this will really require vex or hdk to improve the speed. Unfortunately I'm not sure its suitable for vex coding. simple_test.hipnc Quote Link to comment Share on other sites More sharing options...
sibarrick Posted May 25, 2009 Author Share Posted May 25, 2009 I've now updated my original example file from PMVC to this new PGMVC method and it all works as expected which is good. I've attached the hip file here. All that remains now is to write an HDK version that will run somewhat quicker, commercialise it all and upload it to my site. PGMV_1000.hipnc.zip Quote Link to comment Share on other sites More sharing options...
sibarrick Posted May 25, 2009 Author Share Posted May 25, 2009 edit: in that previous version I just noticed I forgot to link up the threshold parameter on the front of the otl. In should link to the PGMVC_captAtt1 Quote Link to comment Share on other sites More sharing options...
sibarrick Posted May 25, 2009 Author Share Posted May 25, 2009 (edited) more bug fixes to the python version.... just some things that shouldn't be an issue in normal usage but for completeness here it is. and I started writing an hdk version but I've hit some weird bug that means it doesn't work quite right at the moment, basically I'm getting the odd weighting value turn up as randomly wrong so the final deformation doesn't work, can't work out why yet. It's so bizarre that on the mac at least if I force the capture node to recook 3 times by bypassing and un-bypassing the node above then it starts working properly, not very user friendly though. Never seen anything like it, its wizard of oz stuff, click your heels 3 times to get home..... crazy. PGMV_1000.hipnc.zip Edited May 25, 2009 by sibarrick 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.