Jump to content

GMVC - General Mean Value Coordinates


sibarrick

Recommended Posts

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.

post-509-1239260326_thumb.jpg

GMVC.hipnc

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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. :blink:

Link to comment
Share on other sites

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:)

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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)

Link to comment
Share on other sites

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 by sibarrick
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

  • 1 month later...

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

post-509-1242484875_thumb.png

Link to comment
Share on other sites

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.

post-509-1242555514_thumb.png

GMVC.hipnc

Edited by sibarrick
Link to comment
Share on other sites

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

Link to comment
Share on other sites

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 by sibarrick
Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...