Sign in to follow this  

Interaction between a surface and inner object.

This topic is 3403 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

I'm working with a mass-spring system, so i have a set of nodes (x,y,z) defined as a surface. For simplicity lets say i deal with a spherical surface (of say 5cm radius). Within that i create a smaller sphere defined with much fewer nodes (of say 1cm radius). So essentially i have an object with another defined inside it. The outer sphere is a deformable mass-spring surface like a soft body simulation. The inner sphere can be located anywhere within the larger sphere. On the outer surface i can interact with ONE point, deform it, and generate the appropriate feedback forces at that point,which is a result of the applied force by the mass-spring equations. Now if i consider the smaller inner sphere (whose stiffness is much much higher than that of the surface sphere, almost like a hard lump in tissue), if this lies somewhere underneath there will be a 'stiffer' force feedback experienced at the ONE point interacted with on the outer sphere. For now i am not concerned at how this force is determined, i may post about this later. I am thinking about HOW MUCH of the inner sphere influences this force. This obviously depends on the position of the inner sphere and the the direction vector of the force applied on the surface. For instance if i shoot a ray (as the force vector) through the ONE point on the surface that i interact with, i could completely miss the inner sphere or just clip it, or hit it dead on. 2 Questions: 1) I would like some advice about what area i am researching here (hopelessly lost), because the way i see it is that: the two spheres are defined as two sets of nodes but they NEVER NEVER intersect or meet (like a lump in tissue), so am i looking at collision detection? 2) How would i go about shooting rays or multiple rays (if this is a good idea at all???) to find if i'm 'hitting' the inner sphere from the surface (this doesn't seem like collision detection, because the rays seem like virtual to me)? 2.5)Is this slow? The mass-spring system is written in C++ using OpenGL for visualization, so contains classes for mass, position, spring stiffness etc... The whole interaction and deformation and calculation needs to be in real-time Any help on defining the area i'm researching would be really helpful too :)

Share this post


Link to post
Share on other sites
If I understood right, you mean that the hard inner object is suspended inside the outer soft object? Like a small stone inside jello. (In contrast to a small stone inside a balloon.)

Using a mass-spring system, I would do this by also modeling the actual jello, not just the surface. So you would have the outer surface and a grid of springs and masses inside it. The hard object could then connect to the jello.

Take a look at
http://commons.wikimedia.org/wiki/Image:Finite_element_triangulation.svg
to get an idea of what I mean. If each of the blue lines were a spring and each crossing a small mass, that would behave quite nicely.

Its slower than simulating just the surface, though :).

Share this post


Link to post
Share on other sites
Your correct in that the hard inner object is 'suspended' inside the outer softer object.

After considering a mass-spring setup as you described (nice picture by the way), i realised that it is not possible to interact with a tetrahedrally meshed system in real-time, which is the main goal of what i'm trying to do. Thats the reason i turned to simulating just two surfaces.


At the moment i'm interested in detecting the whats inside the outer surface (the harder inner surface), given that the two don't actually collide. So possibly shooting rays from the surface.

Any more suggestions?



Share this post


Link to post
Share on other sites
I think the problem with that approach is determining and maintaining the position of the inner object. If your outer soft surface can deform but the inner lump should somehow stay connected to it, you need a way to model the connection. You need forces that push and pull the lump towards its correct place. Once you have these forces, they should automatically give you the opposing forces affecting the surface.

If the inner and outer objects are both relatively spherical and the lump is near the center, you could get away with something like:
http://www.astrology.com/images/blank_wheel.gif
where the surface is connected to the lump with simple direct springs.
(Sorry about the image, I am at work and can't upload images anywhere, so I need to rely on Google's best hits :P)

You could also try springs that only push the lump away from the surface, but don't care if it is already far enough. Think of the magnetic repulsion effect. The outer surface repels the lump when it gets too close. To adjust the position of the lump, make some of the surface vertex 'magnets' stronger, depending on the desired distance.

Whatever your solution, I'd suggest keeping the physics simple and logical. Magic trickery and imaginary forces usually bring more trouble than they are worth. But get the forces right, and the rest will follow.

Share this post


Link to post
Share on other sites
Thanks a bunch for your reply Juuso,

The points you raised are actually about determining the force itself which is step 2 of my plan, mentioned in my first post. But i like the repulsion comment and will consider it when i reach that hurdle ;)

One idea, leading from the main problem (of detecting the inner object from the surface) maybe to determine what proportion of the inner object can be felt from the surface and then somehow have this reflected in the response force. But for now detection is definitely the priority. Surely some algorithms or published work can give an insight into the influence of two objects on one another that don't touch, minimum distance?

Share this post


Link to post
Share on other sites
Quote:
Original post by chrome68
For now i am not concerned at how this force is determined...
I am thinking about HOW MUCH of the inner sphere influences this force.

It seems to me that these two problems cannot be separated. If you don't know what causes the force, you can't say how much each part of the inner sphere affects it.

I always try to solve physics simulation problems by digging lower and lower into the underlying logic. Trying to find an abstraction for "roughly spherical deformable surfaces" and "harder lumps inside them" is very difficult, and does not lead to reusable calculations. But if you break it down to the lowest level possible, you often get simple rules that you can use everywhere in your physics engine.

Let's say you have one surface node and one lump node. No springs. What happens when they are close together? How do you define "close"? What determines the optimum distance?

How about a triangle surface with three nodes and three springs and one lump node inside? If the nodes repel the lump, it can still probably escape through the walls. Is it a problem?

Once you have clear solutions to the simplest problems, you can easily build a thousand-node surface with any kind of lump inside it; it will always work.

Share this post


Link to post
Share on other sites

This topic is 3403 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this