Jump to content
• Advertisement

# Average point on a surface

This topic is 4268 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

## Recommended Posts

Hello, First post on GD forum so patience please... I would like to know if anyone has come across any solutions for this problem, in which case please show me where, or if anyone might be able to explain how I can solve the following problem. In the normal scheme of things a mean value from a set of data can be found by simply adding up the recorded values and dividing through by the number of records: mean[x] = (x[0] + x[1] + ... x[n]) / n mean[y] = (y[0] + y[1] + ... y[n]) / n mean[z] = (z[0] + z[1] + ... z[n]) / n The location of mean[xyz] may, and in fact probably, will not lie on the original surface. This is the problem - it must lie on the surface to be a part of the surface. Indeed "mean" may not be an entirely apropriate term for this average, maybe mid-point would convey the notion better. For an enclosed surface and particularly symetrical ones, eg a sphere, the problem seems virtually unsolveable because the likelyhood is equal and there is no mid-point on the surface itself. However, for un-enclosed surfaces a mid-point should exist and this is what I want to know how to find. To bring the conundrum to life a little - imagine a human nose, where is the mid-point of the upper-surface? (one could consider the surface rolled out flat). One thought I had was to reduce the number if dimensions in question from 3 to 2, and then 2 to 1 (a line) from where a mid point amy easily be found; then reverse the process to put this mid-point on the surface. Any more detail of how to do it than that I'm not sure of though. Please do ask me to elaborate on anything if something appears unclear. Thanks in advance for the help. Will-O [Edited by - Will-O on November 9, 2006 8:59:30 AM]

#### Share this post

##### Share on other sites
Advertisement
I don't understand, but the closest I can think of is finding center of mass/moments using multiple integrals. Just a stab in the dark at what you mean. Or maybe you mean something more advanced.

#### Share this post

##### Share on other sites
Im not sure if there is a general solution to this. It realy depends on the context of your problem. For instance your sphere example. Yes you are right there is no solution to finding a mean value / mid point (All points on the surface could be considerd such a point). However, if you restrict your domain/range in some way then there should be sufficient parameters to support finding a mean value / mid point. Using your nose example for instance. Using this open surface you could find its region in the xy plane. Then treat this region as a lamina of uniform densitiy. Then find the moments to find the center of mass. Once you find the centers plug back into f(x,y) to find the mid point on the surface.

I am also just taking a stab in the dark with this...

#### Share this post

##### Share on other sites
There is certainly no general solution to this problem, as the problem is not defined! You need to be precise in what your definition of 'mid point' is.

For example, take a simple 2D planar disc, cut a hole in it. Where is the 'mid-point' of that disc with a hole?

#### Share this post

##### Share on other sites
Are you interested in centre of mass, or bounding spheres, or something else?

#### Share this post

##### Share on other sites
DaBookShah:
Erm yes thought may not have been totally clear.

Hope this helps...

I've tried to think of an example but it's hard when I can't add in an image. A quick sketch of the following should show what I'm trying to say:

p0(1,0,5), p1(4,0,4), p2(5,0,0), p3(0,5,6), p4(5,3,5), p5(6,5,0), p6(0,8,3), p7(2,8,2), p8(3,8,0);

Doesn't look too pretty in numerical form (ahh the beauty of visualization). Anyway the shape is a surface patch consisting of 8 triangles.

If the positions of each vertex were added up and divided then this would give the arithmetic mean which would not lie on the surface. I am looking for some sort of average value that lies on the surface.

smc:
In the cases I am dealing with there is a clearly defined sub-region of the overall geometry, which is always going to be a small patch of about 3 - 15 vertices.
From what you have said, do I suppose that you suggest projecting the isolated points onto a plane and then finding a 2D mid-point?
Please clarify "lamina of uniform density". Been a while since the classroom!
Both your comment and the previous one refered to finding the centre of mass - why would this be useful here?

Mastaba:
I think, judging by the disc comment you do understand despite my slightly sketchy explanation. I admit: I hadn't thought of instances where the mesh is incomplete. if it were a perfect circle and the hole where in the middle - then yes the desired mid-point would exist where I don't want it to: in thin air!

iMalc:
Something else I think. See above - you posted after I wrote most of this.

#### Share this post

##### Share on other sites
As an idea, and this may or may not be what you want:

1. Calculate the normal for the surface by averaging the normal of every point on the surface. In the event of a closed surface, this correctly should be 0.

2. Project the object on the plane perpendicular to it's normal.

3. Find the 2D midpoint on the projection

4. Project the 2D midpoint on to the surface

There's likely a more intuitive and easier way to do it, or at least streamline the above, but I haven't given it too much thought. Maybe after lunch :)

#### Share this post

##### Share on other sites
Quote:
 Original post by Will-Osmc:In the cases I am dealing with there is a clearly defined sub-region of the overall geometry, which is always going to be a small patch of about 3 - 15 vertices.From what you have said, do I suppose that you suggest projecting the isolated points onto a plane and then finding a 2D mid-point?Please clarify "lamina of uniform density". Been a while since the classroom!Both your comment and the previous one refered to finding the centre of mass - why would this be useful here?

I was thinking it may be possible to use the region of the surface to find the 'ballancing point' of the 2d projected surface, or region if you will. I should not have use the phrase 'A lamina of uniform density'. Simply stated this is just a very thin sheet of some material. The material is spread about the sheet uniformly.

To see what I was thinking, take a look at this link. Scroll down to the section titled 'Locating the center of mass of an arbitrary 2D physical shape'.

Thinking about it further, I am not sure this is even correct for continuous surfaces. I am sure someone on this board will have good solution.

Edit:
I was thinking you could use the centroid to find this. Once you found the centroid of the surfaces region, you could use these coordinates as the inputs to the surfaces function. Again my shot in the dark.

#### Share this post

##### Share on other sites
by erissian
Quote:
 As an idea, and this may or may not be what you want:1. Calculate the normal for the surface by averaging the normal of every point on the surface. In the event of a closed surface, this correctly should be 0.2. Project the object on the plane perpendicular to it's normal.3. Find the 2D midpoint on the projection4. Project the 2D midpoint on to the surface:)

by smc
Quote:
 I was thinking you could use the centroid to find this. Once you found the centroid of the surfaces region, you could use these coordinates as the inputs to the surfaces function. In you case I guess you could cast a ray in the direction of the z axis. Again my shot in the dark

I think I may try to mix both of these...

1. Get the centroid for the whole patch.

2. Calculate the mean normal for the whole patch.

3. Cast a ray from the centroid along the mean normal in a (positive and negative) to see which triangle this passes through, thus where it lies on the original surface.

Does that sound plausable?

Can anyone think of instances where
(a) this might not work?
(b) or how to speed this up?
(c) other problem might occur?
-----------------------------------------------------------------------------
And now for something completely different...
Can someone direct me to where info for the forum is and how to do stuff like upload imgs, which html tags work and stuff like that.

#### Share this post

##### Share on other sites
Projecting the 3D surface into 2D to find the mean, and then reverse projecting the mean back into 3D, is the first thought that came to my mind as well. But then I realized that there are a number of surfaces where invertible projection isn't possible. For instance, take a tessellated sphere surface, and cut out a piece of it that is less than a full hemisphere. This would be something like a bowl, only where the top part still "overhangs" the bottom. Here's a gorgeous ASCII side-profile:
      /      \          /        \        |          |        \        /          \      /           ------

There's no way you can project this onto any plane without overlaps. You might have to perform a similar process that's done often in texture skinning, where you literally unroll the surface onto a plane using texture coordinates. You'd probably have to assign the texture coordinates manually though, I'm not sure of the exact process.

#### Share this post

##### Share on other sites

• Advertisement
• Advertisement

• ### Popular Contributors

1. 1
Rutin
25
2. 2
3. 3
4. 4
JoeJ
18
5. 5
• Advertisement

• 14
• 14
• 11
• 11
• 9
• ### Forum Statistics

• Total Topics
631758
• Total Posts
3002137
×

## Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!