- Home /
Constraining physics for a buckyball -like simulation.
I would like to take some spheres to represent atoms,
and put 60 of them cosntrained in the boundary radius of a sphere,
and let them push each other around to rearrange themseles like a buckyball..
It could make intersting game objects as you could make the radius of the sphere just a bit stronger than the atomic force so when you interact with it it looks interesting.
here is a flash simulation. http://paulbourke.net/geometry/spherepoints/
What is the best way to do it?
Thanks!
no chance of using unity physics then, alternating frames between rigidbody is on and off and bringing things back to the sphere boundary?
making physical things with constraints is great for game programmers, like that they can make mace weapons on chains of particles, and general bouncy around weapons and dudes on bungee chords and grapple hooks.
I think i asked my question wrong. i want to make a buckyball molecule! see this page: http://paulbourke.net/geometry/spherepoints/
Thanks alot Fattie! there is a small problem for the moment by using an inner and outer collider... the collider is made to stop things bouncing into it, but it doesnt stop things bouncing out of it... you cant put cubes in an ordinary sphere because they will fall out, so i have to figure a way to reverse/ turn inside out the collider of the outer sphere. i didnt find how to do that? thanks!
Answer by Fattie · Sep 27, 2012 at 06:29 AM
Hi Zoom !
Thanks again for this great question.
Sorry I only thought of this now.
have the inner sphere as a point collider (I mean a primitive sphere collider), no problem
have gravity off
now check this out. write a one line script that continually applies force, TOWARDS THE CENTER OF THE SPHERE
attach that script to the small balls.
it's so obvious, sorry I only thought of it now
they will jiggle around in a really interesting way. You will have to very carefully set the distances meters and masses kilograms and force Newtons to realistic levels - I'm sure you're expert at that
the result will be fantastic. I can't wait to see this. I'm gonna do it myself now too!
Also consider, try both physical force as mentioned in 3, and also try it with a script that just basically "restrains it" by hand to the surface (much like the restrain buttons on the rigidbody inspector panel. generally you don't move an obkect which is physical but here you could
note further that you could carefully modify the velocity of the object continuously so it is only on the plane tangent to the surface at any moment
What a great question this is. Thanks!
Another approach ...
I'm gonna mention another approach I would like to try here Zoom. I often try out "offscreen calculation-reality physics".
We could make a flat surface. Add edges to stop the balls rolling out. Put the 60 balls inside this "tray". Use gravity. Let the little bastards bounce around....
All of this happens offscreen, you never see it.
Then .......... map that action to the surface of the sphere. So, all the balls you SEE on ONSCREEN are not real, they are just puppets. Carry over the exact height, spin, velocity etc of the baking tray as the globe tangent.
Of course ... here we'd have to deal with the projection. It could be that some natty projection like a Interrupted sinusoidal does the trick in pratcice. And what to do at the edges. It could be that the "real" tray balls wrap somehow. Another key fact is, you can never, anyway, actually see both sides of the ball at once! So you need only work 40 or so of them at a time, in a way, depending the use.
Bearing that in mind it's possible the "offscreen calculation reality baking tray" could be a terrific solution! :)
Anyway just a reminder that "offscreen working realities" coupled with a completely fake, maquette, on screen reality is often a awesome thing to play with. I love rigs like that. Cheers
Thanks! that's Verry cool! interesting indeed :) thanks for thinking of that! perhaps it's possible to make a gradient on the ConstantForce so that it pulls from outside the radius and it pushes from inside. and zero constant force for ball pos == radius. Great info's there!
i love it and i love your question.
the site has 65,000 questions and only 4 or 5 of this nature. thanks!
here was a good one ...
:) you mean to use the geometric coordinates to make vertices of a mesh, like a baking tray for mesh? i know what you mean about offscreen use of algorythms that have great visual appearence. yes a variety of options indeed.
in this case I just meant .. make a flat surface. so, it's not a globe, it's flat.
(you need sides so the balls don't roll out! that's all I meant by a baking tray.... baking trays have sides, err, well often they do!)
do your simulation you describe, but NOT on a globe, just on a FLAT surface.
then, actually just map the positions of the balls to the globe. so the little balls we are seeing on screen (on the globe) are NOT actually real, they are just puppets following the real actual physics simulation which sits offscreen.
sorry about the baking tray confusion :)
i am thinking of applying it to some future unspecified fungus and material growth simulations.
Your answer
![](https://koobas.hobune.stream/wayback/20220613081522im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
2D 360 degress platformer example needed 0 Answers
"Padded objects" type collision .. any ideas? 2 Answers
Avoid bouncing when ground move down 1 Answer
Imported 3D models collisions 1 Answer