bullet physics for DS 1, 2, 3, 4 PC/Win ... teaser

mCasualmCasual Posts: 4,607
edited October 2013 in Freebies

it will probably work like this

you place primitive objects ( spheres cubes cylinders ) in a Daz Studio Scene

there will be a "mass" parameter added to each object ... using a script

if the mass of the object is 0 it will be considered static ( ground/floor objects for example )

then the script will outsource the physics simulation job to an executable/program ( PC-Win only )

a few seconds later the script will apply the physics simulation results to the objects in the scene by keyframing/animating them

---

here is the output of my Bullet physics server for the Y position of a sphere falling on the ground ... apparently there's no bounciness ... for now

physics.jpg
884 x 426 - 38K
Post edited by mCasual on
«13456711

Comments

  • DorseylandDorseyland Posts: 724
    edited December 1969

    You lost me at "Bullet", and I don't mean politically. It's an animation script for what???

    If this is what you do when you're Casual, what do you come up with when you're Intense?

  • mCasualmCasual Posts: 4,607
    edited October 2013

    You lost me at "Bullet", and I don't mean politically. It's an animation script for what???

    If this is what you do when you're Casual, what do you come up with when you're Intense?



    example : in a daz scene, you place a soccer ball 4 ft above ground

    you let the script/program figure what should happen next

    and the ball falls to the ground and possibly bounces

    --

    in the image below the Jupiter2 ship makes a hard landing

    ---

    there used to be a plugin for Daz Studio 3 to do this http://www.youtube.com/watch?v=jTTekEgxzJk

    ---

    my script+program will probably be less practical than this but for simple effects it should do the trick

    misskorea2.gif
    600 x 337 - 240K
    yoweiyo.jpg
    1920 x 1080 - 381K
    misskorea.gif
    480 x 270 - 723K
    Post edited by mCasual on
  • mCasualmCasual Posts: 4,607
    edited October 2013

    3 objects !

    next time i'll take rotations into consideration, so the cubes should tumble

    -------

    figure 2 -- well the rotations are inverted because DS's Z axis in the opposite of the Physics engine but it tumbles !!

    misskorea4.gif
    480 x 480 - 427K
    misskorea3.gif
    600 x 337 - 211K
    Post edited by mCasual on
  • mCasualmCasual Posts: 4,607
    edited October 2013

    tada ! i inverted the quaternion's Z component and it did the trick :)

    ( there's still an inverted rotation axis dang it )

    misskorea6.gif
    800 x 600 - 875K
    misskorea5.gif
    480 x 480 - 428K
    Post edited by mCasual on
  • MattymanxMattymanx Posts: 6,902
    edited December 1969

    while I dont do animation this will still be a good way to get a dispertion of objects for scenes where destruction or a mess is required.

  • WandWWandW Posts: 2,817
    edited December 1969

    You lost me at "Bullet", and I don't mean politically. It's an animation script for what???

    I

    Bullet Physics is the physics simulation system that's used in Cararra and Poser...

  • mCasualmCasual Posts: 4,607
    edited December 1969

    Mattymanx said:
    while I dont do animation this will still be a good way to get a dispertion of objects for scenes where destruction or a mess is required.

    for more credible wrecking , pre-fractured cinder blocks would be needed

    more complicated effects like that would be done in Blender,

    but my script+exe kit should be okay for heaping unbroken stuff

    96cinderblocks.jpg
    1280 x 720 - 220K
  • ghastlycomicghastlycomic Posts: 2,531
    edited December 1969

    Is there a thread that explains what scripts are and how they are used? All this script stuff posted here looks very interesting but I don't know what exactly it is or how easy it is to use. Does it require a lot of programming to use it? The last programming I did was in 6507 machine code for the Atari 2600.

  • mCasualmCasual Posts: 4,607
    edited October 2013

    Is there a thread that explains what scripts are and how they are used? All this script stuff posted here looks very interesting but I don't know what exactly it is or how easy it is to use. Does it require a lot of programming to use it? The last programming I did was in 6507 machine code for the Atari 2600.

    you don't need to program to use the scripts
    a daz script is like a program that runs inside daz studio
    the daz scripts files have names like dothis.dsa and dothis.dsb
    the .dsa scripts can be edited using a text editor or the Daz Studio Scripting IDE
    the scripting language is extremely similar to javascript
    on my site there's dozens of scripts
    if we take a simple one https://sites.google.com/site/mcasualsdazscripts2/mcjlookatthecamera
    i distribute it as a zip file
    if you unzip this in a daz studio content folder, you'll be able to activate/run the script using Daz Studio's content tab
    for example, if i download and unzip mcjlookatthecamera.zip in
    C:\Users\MYUSERNAME\Documents\DAZ 3D\Studio\My Library
    i will find the script in the content tab under
    Daz Studio Formats / My Library / Scripts / mcasual
    ( see image attached )
    now according to the instructions, i select Aiko's head
    then in the content folder i double-left-click on the mcjlookatthecamera thumbdail/icon
    and the script will turn Aiko's face toward the camera ( your point of view )

    lookhere.jpg
    812 x 492 - 49K
    Post edited by mCasual on
  • mCasualmCasual Posts: 4,607
    edited October 2013

    hammertime soon? we wont make promises :)

    hammertimetake2.jpg
    1280 x 720 - 215K
    hammertime.jpg
    1280 x 720 - 158K
    Post edited by mCasual on
  • Richard HaseltineRichard Haseltine Posts: 100,607
    edited December 1969

    .dsa (or .dsb) presets for materials and so on are scripts, too.

  • mCasualmCasual Posts: 4,607
    edited October 2013

    here you see a Daz Studio scene with 3 physics objects

    the ground-cube is a "static" body

    one cube is a "kinetic" body which i animated, it can influence dynamic objects but is not influenced by them

    and one cube is a "dynamic" body, it gets pushed off the flat planet

    ---

    note that this whole physics kit will not have all the functionalities available in Blender's port of Bullet Physics
    so, down the road, i may write a script that helps you send a Daz studio scene over to Blender for physics simulations

    kinetic.gif
    480 x 270 - 535K
    Post edited by mCasual on
  • bighbigh Posts: 8,147
    edited December 1969

    you going to have rag doll ?

  • mCasualmCasual Posts: 4,607
    edited October 2013

    bigh said:
    you going to have rag doll ?

    i plan to include bullet-physic's 5 types of constraints

    one of them is said to be suited for ragdolls

    this would probably make it possible to build a doll out of cylinders then throw it around

    connecting this doll to a figure like Aiko or Genesis ... will come later

    according to the documentation there's also a vehicle/car rig

    note that i don't want to go too far in this project because i have a lot of script updates on the back-burner

    so, the moment i get the constraints working, i'll post this script+ program , and jump back to unfinished projects

    reminder : this is a PC-Win system

    but but but someday i may write a Mac compatible system that brings Blender3D's physics simulation services to Daz Studio

    constraint.jpg
    900 x 900 - 105K
    Post edited by mCasual on
  • Takeo.KenseiTakeo.Kensei Posts: 1,303
    edited December 1969

    Very cool Casual. I was planning to play with Bullet Physic to see what I can get out of it but didn't do anything yet

  • mCasualmCasual Posts: 4,607
    edited December 1969

    possibly fixed the inverted rotations issue

    dockofthebay.gif
    480 x 270 - 479K
  • mCasualmCasual Posts: 4,607
    edited December 1969

    Very cool Casual. I was planning to play with Bullet Physic to see what I can get out of it but didn't do anything yet

    in the meantime you can do all this and more in Blender3d

    when my script will be ready , it will have the advantage that it's easier to build a scene and animate it in Daz Studio, and the renders can be fast

    and maybe maybe i'll add softbodies/cloth physics later

    though with constraints and solid bodies we can do ropes and chains ... maybe some pseudo-dynamic hair/tresses too

    https://www.youtube.com/watch?v=U93qc4ZJYEk

  • mCasualmCasual Posts: 4,607
    edited October 2013

    Fig. 2 the test scene for further work on rotations

    so far the daz scene objects were not rotated at all before being sent to the physics engine


    Fig. 1 - typical data file passed to the physics engine server ( mcjBulletServer001.exe ) by the daz script mcjBulletClient.dsa

    typ.png
    886 x 384 - 22K
    catapult.jpg
    1280 x 720 - 379K
    Post edited by mCasual on
  • Takeo.KenseiTakeo.Kensei Posts: 1,303
    edited December 1969

    Casual said:
    Very cool Casual. I was planning to play with Bullet Physic to see what I can get out of it but didn't do anything yet

    in the meantime you can do all this and more in Blender3d

    when my script will be ready , it will have the advantage that it's easier to build a scene and animate it in Daz Studio, and the renders can be fast

    and maybe maybe i'll add softbodies/cloth physics later

    though with constraints and solid bodies we can do ropes and chains ... maybe some pseudo-dynamic hair/tresses too

    https://www.youtube.com/watch?v=U93qc4ZJYEk

    I know I can do that and more in blender. That would just be for the fun of coding. I'm rather coding RSL shaders but I lastly setup eclipse for python coding inside blender to update some plugins that were broken because of blender update; I just thought that I could also set it up for something else.

  • mCasualmCasual Posts: 4,607
    edited October 2013

    Amy decided to stay on the sidelines ( or sidewalls) for this one because she's not suicidal )

    ( my script can now pass rotated bodies to the physics engine )

    well the rotation issue is not really correct, the springnoard ....the way it falls through the edge of the ground-cube

    to do to do to do ... sunday :)

    oh and while we're at it, see in fig 2 the test i did before the one of fig 1.

    there's very very fluffy mattresses not shown nobody was injured

    schpingin.gif
    600 x 450 - 199K
    knievel.gif
    480 x 360 - 805K
    Post edited by mCasual on
  • patience55patience55 Posts: 7,006
    edited December 1969

    Casual said:
    possibly fixed the inverted rotations issue

    Clever! :-)

  • mCasualmCasual Posts: 4,607
    edited December 1969

    Casual said:
    possibly fixed the inverted rotations issue

    Clever! :-)

    thanks ! ( i still have to do more test to make sure i was clever enough: )

    ---

    shown here - same test scene with greater precision

    since this is not happening in real-time we can wait the 1 or 2 second it takes

    hiprecision.gif
    400 x 300 - 446K
  • mCasualmCasual Posts: 4,607
    edited December 1969

    Amy's finger tip is a "kinetic" body, the sledgehammer is a dynamic body and the floor-cube is a static body

    rimber.gif
    400 x 225 - 457K
  • patience55patience55 Posts: 7,006
    edited December 1969

    Casual said:
    Amy's finger tip is a "kinetic" body, the sledgehammer is a dynamic body and the floor-cube is a static body

    Technically, could one then turn the dynamic body to a kinetic one, to in turn move a third item ... a domino effect?

  • mCasualmCasual Posts: 4,607
    edited October 2013

    Casual said:
    Amy's finger tip is a "kinetic" body, the sledgehammer is a dynamic body and the floor-cube is a static body

    Technically, could one then turn the dynamic body to a kinetic one, to in turn move a third item ... a domino effect?

    you can make all the dominos "dynamic"
    and they'll fall like dominos :)
    the animated/kinetic object ( Amy's finger ) can push the first domino

    in my next text i'll throw the ball in the blocks-wall and blocks as you'll will react to one-another

    sidepush.gif
    480 x 270 - 687K
    Post edited by mCasual on
  • ghastlycomicghastlycomic Posts: 2,531
    edited December 1969

    This is really fascinating.

  • mCasualmCasual Posts: 4,607
    edited October 2013

    first wall bustin' simulation

    i have to read more about ways to prevent the blocks from sinking in the ground

    awwwh i think i know ... it's because i did not yet fix the rotations issue

    quaternions have to be handled with care i cant just wing it :)

    walbust.gif
    480 x 270 - 576K
    Post edited by mCasual on
  • ghastlycomicghastlycomic Posts: 2,531
    edited December 1969

    I love that the one block sees the ball coming and says "Screw this, I'm out of here".

  • patience55patience55 Posts: 7,006
    edited December 1969

    I love that the one block sees the ball coming and says "Screw this, I'm out of here".

    Yeah! lol ...

  • mCasualmCasual Posts: 4,607
    edited December 1969

    now correctly computing the dimensions of rotated objects

    and ... a first simulation involving a sphere

    pretty neat simulation results

    ugo.gif
    480 x 360 - 851K
Sign In or Register to comment.