|
![](/i/fill.gif) |
Hi All:
Sorry for the misleading subject... I couldn't resist. ;)
Finally I got the cylinders working on Koppi's Bullet Physics
Playground... in fact, they were working, but the OpenGL preview had the
cylinders oriented on the wrong axis. I also fixed the "never-ending
motion" issue, which was as simple as turning off automatic
deactivation. There was also a problem with mass and inertia, which I
think I corrected too. I still have segfaults which don't allow to
create complex scenes, but well... I still have plenty of room to
experiment with the simple ones.
So, for this scene, I setup a LUA script to make 5 piles of different
coins, and then sent a ball on their way... the final frame was exported
to POV SDL, then edited with SciTE to replace the cylinder definitions
with calls to my own coin() macro. Now, I just have to make better
heightfields for the coins... the current ones using webdings.ttf are
not very convincing.
Regards,
--
Jaime
Post a reply to this message
Attachments:
Download 'coins-10.jpg' (154 KB)
Preview of image 'coins-10.jpg'
![coins-10.jpg](/povray.binaries.images/attachment/%3C5069452b%40news.povray.org%3E/coins-10.jpg?ttop=443866&toff=1750&preview=1)
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
Jaime Vives Piqueres <jai### [at] ignorancia org> wrote:
> Ok, the last ones... I've things to do, and this "physics addiction" is
> starting to get over the top. Fortunately, Koppi's playground is giving
> me a segfault when using more than some thousand objects, preventing
> some really interesting and complex scenes. As the author is
> unreachable, sailing until December, I think I'm safe for now... ;)
>
> --
> Jaime
Just missing the coins of two colors. Paper money of five hundred should be more
difficult to generate, due the absence of a model.
Good picture, I hope someday you have time to explain this technique in your
site.
B. Gimeno
Post a reply to this message
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
On 08/10/12 09:19, B. Gimeno wrote:
> Just missing the coins of two colors.
Yes, I purposely omitted it... I'm way too lazy. But it would not be
difficult, given the way the coins are done: I just have to create two
concentric heightfields for each coin side, instead of just one.
> Paper money of five hundred should be more difficult to generate,
> due the absence of a model.
>
I my self never seen one... :( ...but there are plenty of pictures on
the web, I'm sure. The problem is that I'm still far away from starting
with soft-body physics.
> Good picture, I hope someday you have time to explain this technique
> in your site.
Thanks... You mean the physics part, or just the coin modeling/texturing?
--
Jaime
Post a reply to this message
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
On 08/10/12 10:36, B. Gimeno wrote:
> Physics...Even with the risk of being caught by the law of gravity.
> :-)
Yes, it's a real risk... there is something fascinating in looking at
things falling and colliding on slow motion.
My technique is easy because I use a scripting tool which exports to
POV-Ray SDL, so I only have to customize the exported code and then
render. The nice thing about Koppi's playground, is that it allows to
construct scenes the way you will do on POV-Ray, with loops, and if's,
and lots of random values here and there...
The tool consists on a LUA interpreter, which is the "interface" to
the Bullet Physics Library. There are some bindings in place which allow
to create simple collision objects, and to add them to the physics
simulation. Then you run the simulation, and the whole thing is rendered
in openGL on real time. You can export each frame to POV-Ray format too,
and that's the actual good thing about it.
Here is how a simple LUA script looks like:
----------------------------------------
plane = Plane(0,1,0)
plane.pos = btVector3(0, 0, 0)
plane.col = "#999999"
v:add(plane)
function explosion(N,H)
for i = 1,N do
local d = Cube()
d.pos =
btVector3(-.5+math.random(0,10)*.1,H-.5+math.random(0,10)*.1,-.5+math.random(0,10)*.1)
d.col = "#ff9900"
d.friction = .5
d.restitution = .9
v:add(d)
end
end
explosion(260,25)
----------------------------------------
This would export a POV file for each frame, with a plane{} and 260
box{} objects with the matrix transformations required:
-----------------------------------------
plane { <0, 1, 0>, 0
pigment { rgb <0.0666667, 0.0666667, 0.0666667> }
}
box { <-0.5, -0.5, -0.5>, <0.5, 0.5, 0.5>
pigment { rgb <1, 0, 0> }
matrix <0.00928936,0.999722,-0.0216712,
0.835221,-0.0196738,-0.549562,
-0.549835,-0.0129952,-0.835172,
-10.6849,0.479277,-109.289>
}
// ...and 259 more
-----------------------------------------
The, I do some automated search&replace to put there my own objects,
with the same or similar shape and dimensions, leaving the matrix in
Unfortunately, the program is in very-alpha state, although it is
really promising. The version on github has some flaws that I already
corrected on my local copy, but the main problem is that it segfaults
with more than 200-250 objects, and debugging that is beyond my
abilities (though I did try and failed as expected, BTW).
Regards,
--
Jaime
Post a reply to this message
|
![](/i/fill.gif) |