Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: Nervous system

  1. #1
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,128
    Rep Power
    732

    Nervous system

    Hi,

    I tried to create symmetrical shape and put it "on head" by default.

    What happens ?

    At least on my PC it starts to rotate counter clock wise.
    Maybe it is somehow related to forgotten mysterious prophecy about random ODE mood ( seek any medieval book for the reference ).

    Does the same occur on your PC too, or system stays at same position forever ?


    Thanks,
    Petr
    Attached Files Attached Files
    Learn 3D graphics with ThinBASIC, learn TBGL!
    Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB

  2. #2

    Re: Nervous system

    Hi Petr,

    what are you doing with ODE? Where is the new TBGL ;D Just kiddin'

    I'll check it tonight. I remember something odd and similar when I was trying to code an entity system
    for the IBP 3D Pack. On my system (Intel) I got a strange behavior and and on Athlons everythign was fine.
    Something math related. What is your CPU?

  3. #3
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,128
    Rep Power
    732

    Re: Nervous system

    Hi Mike,

    Where is the new TBGL ;D
    Good try to make me heartattack I am working on it, I am working on it ( even started to write docs )

    To make situation even more funny, I have AMD Sempron 64bit. So not Intel

    I presume it could be related to fact ODE uses SINGLEs ( at least classic ODE from offical website ).
    Maybe some rounding errors?. How hard is to store integer numbers in SINGLE variable ???


    Thanks,
    Petr
    Learn 3D graphics with ThinBASIC, learn TBGL!
    Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB

  4. #4
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,777
    Rep Power
    10

    Re: Nervous system

    Petr,

    for sources so big, better to add as attach file otherwise forum color syntax parser will take a lot of web server CPU. Thanks

    I tested and it start in perfect balance but after 2 secs start going down on the left (un-clock) and an infinite pendulus left/right starts. At every left/right it seems loosing a little bit. So it is not a 360 round but a 359.9999, 359.9998, 359.9997, ...

    Are you using SINGLE (sorry no time right now to go though source code)? SINGLEs have low precision and if used in math expressions rounding problems are quite sure.

    Eros
    www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
    Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000

  5. #5
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,128
    Rep Power
    732

    Re: Nervous system

    Hi Eros,

    I am sorry, but I like colors
    I removed the code section and attached whole script.

    I am also quite curious why ODE uses SINGLEs by default, I think unprecision is not worth savings in memory ( DOUBLEs are twice as big ), especially in software dedicated to simulations


    Thanks,
    Petr
    Learn 3D graphics with ThinBASIC, learn TBGL!
    Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB

  6. #6
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,777
    Rep Power
    10

    Re: Nervous system

    Petr,

    thanks a lot. For scripts around 100 lines, seems no problem, but for more than 300 lines it seems our server is suffering a bit :-[

    I tried to change all SINGLE to DOUBLE but again same behave. I've not review all the code but just: find(SINGLE) - replace(DOUBLE) rough method.
    On my machine it takes about 2/3 secs before to start moving. Maybe we can calculate how many main loops it takes to move and if all the same in all machines, it is quite sure a rounding problem. I will study the script more this night when back from work.

    Ciao
    Eros
    www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
    Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000

  7. #7
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,128
    Rep Power
    732

    Re: Nervous system

    When you add following code to the script ( after objects are created and jointed, but before loop ):
    type t_xyzpos
    x as dReal
    y as dReal
    z as dReal
    end type

    dim pos1 as t_xyzpos at dBodyGetPosition ( mySphereBody(%SPH_LOWESTRIGHT2) )
    dim pos2 as t_xyzpos at dBodyGetPosition ( mySphereBody(%SPH_LOWESTLEFT2) )

    msgbox 0, STR$(pos1.x)+STR$(pos1.y)+STR$(pos1.z)
    msgbox 0, STR$(pos2.x)+STR$(pos2.y)+STR$(pos2.z)
    ... you will see values are stored without any round off errors !
    It is weird. It must be something in ODE.

    ODE is compiled already to work with SINGLEs, so re-declarataion sadly cannot help.
    If somebody knowing C could recompile ODE.DLL with DOUBLE precision option it would be interesting to see if it makes difference.

    I tried even constant simulation step, and it did the same fall.
    Interesting is that setting too big step makes ODE crazy and it totally destroys the construction


    Thanks,
    Petr
    Learn 3D graphics with ThinBASIC, learn TBGL!
    Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB

  8. #8

    Re: Nervous system

    Everything works like a charm here. ThinBasic 20070909

    By working like I charm I mean, that it stays on top for about 2 seconds and then starts falling down and then swing left/right.

  9. #9
    thinBasic MVPs kryton9's Avatar
    Join Date
    Nov 2006
    Location
    Naples, Florida & Duluth, Georgia
    Age
    67
    Posts
    3,869
    Rep Power
    404

    Re: Nervous system

    First, thanks for the demo... neat to see so much happening, toon shading, shadows, physics, cool mouse interaction with scene!!!

    It stays still for a few seconds and does come down on the left side. Would such a structure be in balance in reality? It seems to act as you would think, at least the way I would think, and it falling to the left is correct with the Earth's rotations effects

    Put a ball on the table and if it moves, with no outside forces, then worry
    Acer Notebook: Win 10 Home 64 Bit, Core i7-4702MQ @ 2.2Ghz, 12 GB RAM, nVidia GTX 760M and Intel HD 4600
    Raspberry Pi 3: Raspbian OS use for Home Samba Server and Test HTTP Server

  10. #10
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,128
    Rep Power
    732

    Re: Nervous system

    Hi guys,

    thanks for the tests.
    Did you know clicking using middle mouse button / mouse wheel click allows you to push objects like with finger ?

    Kent has good point about earth rotation, but as ODE allows to setup gravity, I think it also does not presume Earth conditions for all operations. But good idea!

    I am fool I do not backup my work, because I did similar object, like a grid, which was symmetrical and I think it rotated clockwise.

    I need to do more tests


    Thanks,
    Petr
    Learn 3D graphics with ThinBASIC, learn TBGL!
    Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB

Page 1 of 2 12 LastLast

Similar Threads

  1. Another L-System fun
    By Petr Schreiber in forum TBGL General
    Replies: 14
    Last Post: 11-05-2008, 03:20

Members who have read this thread: 0

There are no members to list at the moment.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •