nr1.jpg nr2.jpg nr5a.jpg nr4.jpg 12c.jpg nr3.jpg workshop_celani_orciuoli.jpg

ODE DYNAMICS ENGINE QUICK OVERVIEW

Posted: April 15th, 2010 | Author: Rabindranath Andujar Moreno | Filed under: Variado | Comments Off After seeing my own simulator running there is a whole lot of things that I wish it had.
All this stuff is more or less complicated to achieve, but from my previous research I have found some Open Source engines from which I can learn a lot.

The best documented one so far is ODE (www.ode.org), and also the one I intend to merge with Blender.
So, I present a very quick and thorough overview on how this works, in order to have some scope.

The first thing to disentangle is how it gets working. For that, just looking at the user's manual one gets the following algorithm:

1.-Create a Dynamics world
  • This basically means to make an instance of the dxWorld struct.
2.-Create the bodies
  • Attach the bodies to the world (this means adding data to the dxBody* array of the dynamics world).
  • Set their properties (position and orientation of point of reference, its linear and angular velocities, the mass of the bodies and some other stuff of the like).
3.-Create the joints
  • Attach the joints to the world (by adding data to the dxJoints* array of the dynamics world)
  • Set their properties (depending of the selected type of joint, one has to provide different details).
4.-Manage collisions
  • Create a new collision world (just by making an instance to the dxSpace struct).
  • Create a joint group where collisions will be stored temporarily for every frame step.
5.-Loop
  • Apply forces to bodies.
  • Adjust joint parameters.
  • Call collision detection.
  • Create a contact joint for every detected collision point and add it to the collision joint group.
  • Take a simulation step.
  • Clear the collision joint group.
6.-Destroy the dynamics and the collision worlds (wow, that sounds evil...hehehe).

All of this seems fairly easy to do but then one has to get to know where and how things have been implemented. This is when things become a bit harder.
I am sure the file structure and the class definitions make perfect sense for the programmers of this engine.
Fortunately, they have been careful enough so as to comment everything in an understandable way, for which I feel deeply grateful.
After some digging, I have managed to restructure the ode/src folder into the following topics:
  • Accessories
    • Memory management
    • Math
    • Matrix handling
    • External applications
  • Collision
  • Core
  • Joints
  • Primitives
  • Solver
Which means one can tackle the engine in an ordered manner and find things when needed.

From a theoretical point of view, this engine presents the following features:
  • A Lagrange multiplier velocity based model from Trinkle and Stewart
  • A friction model from Baraff
  • A Danzig LCP solver

    First Ogre+Verlet+Gauss-Seidel simulation

    Posted: April 13th, 2010 | Author: Rabindranath Andujar Moreno | Filed under: Variado | Comments Off Once the Ogre3D engine is ready to draw what we numerically compute, it was about time to start having some fun.

    I found this excellent article from Thomas Jakobsen: http://www.teknikus.dk/tj/gdc2001.htm where a very neat and simple engine is implemented (thanks Mr. Jakobsen).

    It is very well explained so adapting it to my little lab was not very hard.
    Here I proudly present my very first simulation!




    I am perfectly conscious that it lacks of a lot of things...namely collision detection, a proper stable, precise integrator, an optimized implementation...and a long etcetera...but it's just a baby!

    Here is a zip file with the code (an extension from what I presented in the last post):


    http://www.mnbvlabs.com/Thesis/VerletRelaxation.zip


    Setting Ogre3D as Graphic Environment

    Posted: April 11th, 2010 | Author: Rabindranath Andujar Moreno | Filed under: Variado | Comments Off The last days I have been working on getting a Graphics Environment for my Toy Physics Engine.
    Last December and January I had already fiddled around with excellent engines Ogre (www.ogre3d.org) and Bullet (http://bulletphysics.org/wordpress/), trying to put them to work together.I have a post from february where some simulations on youtube can be seen and some preliminary introductions are made.

    However, now I am starting to understand things, and whenever I have the drive to test them always encounter the problem on how visualize them.

    So, I came across with Blender (www.blender.org), another fantastic tool, and got surprised to find their Google Summer of Code mentorship for 2010 (http://wiki.blender.org/index.php/Dev:Ref/GSoC/2010/Info).
    I have applied for it. Deadline was 9th April, which meant preparing everything in a hurry and some embarrasing trouble with their wiki page (I have already apologised in their bf-commiters mailing list...ooops).
    Here is my proposal for such an important event: (http://wiki.blender.org/index.php/User:Ndujar).
    Hopefully they find it interesting and contact me to complete it!

    In the meantime, I have prepared a short and basic Ogre framework to begin doing some tests.
    It is composed of a few files and classes integrating Ogre.

    I generated it basically copying, cutting and pasting from the very good tutorials available at the Ogre web page (http://www.ogre3d.org/wiki/index.php/Ogre_Tutorials).

    It goes as follows:

    The first step is to intall and cofigure Ogre in your computer. This is the best tutorial I found: http://ubuntuforums.org/archive/index.php/t-1148570.html.

    Then, using whatever IDE of your taste (I am on EasyEclipse), just get the following files to compile.

    The core of the application is the BaseApp object, from which I will later extend further as needed. It is basically in charge of doing everything Ogre requires to be done to put things up in a rendering window.
    BaseApp.h:

    BaseApp.cpp:



    The BaseFrameListener is another very important piece of code that allows one to control the rendering flow.
    In order to manage whatever happens on every rendering step, Ogre provides the FrameListener object.
    With the installed package comes an ExampleFrameListener.h file, which overrides the basic Ogre FrameListener and allows for a fairly good control over the inputting devices such as keyboard and mouse.I have slightly customised it for my purposes.
    It has been a bit tricky however, and has made my computer crash a few times.
    Anyway, here it is, domesticated at last!


    BaseFrameListener.h:



    Once the beast is under control, the rest is a piece of cake...hehehe... 
    You can make as many instances of a FrameListener as you need in an Ogre application.
    I have chosen to create a separate framelistener for managing whatever goes under the physics, to keep things up neat and tidy.
    It is the PhysicsFrameListener class:

    PhysicsFrameListener.h:



    The elementary brick on which everything else will be constructed is likely to be called PhysicsEntity.
    So I have defined my PhysicsEntity Class.
    In this code is still at its very bones, just presenting a couple of functions to make things visible.
    Hopefully in the near future some more flesh will get added on it!

    PhysicsEntity.h:

    PhysicsEntity.cpp:



    Last, but not least, is the main.cpp file, where everything gets blended:

    main.cpp:


    And this is it.Now...Let's get busy!

    CODE NAME: Brachistochrona

    Posted: March 31st, 2010 | Author: Rabindranath Andujar Moreno | Filed under: Variado | Comments Off Today I'm going to reveal a classified archive. Or so it seems...

    Physicians have been keeping this knowledge from us simple mortals for centuries...hehehe...
    While trying to understand the essentials on variational mechanics, I have come into this article: http://jazz.openfun.org/wiki/Brachistochrone.
    The problem of the brachistochrone dates back to Newton (17th century) and appears mentioned frequently as one of the problems that can be solved be means of this refined technique.

    In fact, this problem appears to be the actual trigger for the modern physics (or better stated, its solution), and reveals a completely counterintuitive phenomenon:

    The quickest path is not the straight line

    Amazingly, the solution for a bead on a wire going in the least time from point A to point B:


    Is the cycloid represented in the picture.

    As standard human, one always tends to think that the shortest path would be the quickest one. It is wrong.
    Analogously, when it comes to minimize the action (see previous posts on the subject), it is very hard to imagine that the stationary points would not come at flattening the curve for the action.
    This is what makes so hard to understand the variational principles that rule over Lagrangian, Eulerian and Hamiltonian mechanics.

    If one only had been told...

    I have made a spreadsheet with openoffice (www.openoffice.org) where this can be numerically perceived also.

    The spreadsheet is here.

    I have made it with the help of a paper by Jozef Hanc: The original Euler's calculus-of-variations method: Key to Lagrangian mechanics for beginners.
    I found it extremely appropriate for my case, and also absolutely clarifying. Thanks mr Hanc


    INTERNATIONAL SEED TRAINING: ESPAÑA, PORTUGAL, MÉXICO

    Posted: March 31st, 2010 | Author: R.O.D. | Filed under: Investigación, Noticias | Tags: , , , , , , , , , , , , , , , , , , , | No Comments »

    B1-3PAISESGracias a la red y el equipo que se esta formando dentro de grupo KRFR y por la línea de investigación que SEED | KRFR esta proponiendo, estamos trabajando sobre formación especializada tanto teórica como técnica en programación, diseño paramétrico, creación de algoritmos, vinculación entre softwares, sostenibilidad para constructores, arquitectos y diseñadores en 3 países: España, México y Portugal.
    Las expectativas son que la red crezca hacia otros países así como fortalecer las redes ya existentes y que están naciendo.

    En los tres países en donde actualmente esta SEED, los objetivos de investigación y desarrollo son los mismos, así como el tipo de formación, lógicamente con diferente formador.
    En cada uno de estos países SEED | KRFR esta tratando con diferentes Universidades para impulsar nuestra línea de investigación, uno de los temas principales de esta investigación es el trabajo online para desarrollar software y compartir información relevante sobre los temas sostenibilidad ligados con la programación orientada a objetos. Por el momento, las plataformas que usamos es Rhinoceros, Grasshopper, Blender, Python, Rhinoscript, Ogre. Posteriormente iremos avanzando en otras plataformas. Si quieres unirte a la red, porfavor contáctanos: seed@krfr.org

    SEED en España
    SEED barcelona Rabindranath Andujar (Arquitecto programador especializado en física)
    Garito (Programador)
    Soe Farah Iracheta (Arquitecta especializada en sostenibilidad)
    David Antón (Arquitecto Biodigital)
    JAN (Programador empresario)
    R.O.D. (Arquitecto – Diseñador especializado en sostenibilidad)

    WEB SEED España


    SEED en Portugal:
    SEED portugal
    Adriano Faria (Arquitecto)
    Amilcar Ferreira (Arquitecto)
    Miguel Ribeiro (Arquitecto-Matemático)

    WEB SEED Potugal

    .

    .


    SEED en México
    mex
    Silvia Carbajal (Técnica en Diseño Gráfico)
    Adrian Velázco (Diseñador Industrial)
    Carlos Ruz (Estudiante de Arquitectura)
    Coco Gutierrez (Arquitecta)
    Fabian Marcelo (Arquitecto especializando en sostenibilidad)
    Daniel Zamorano (Arquitecto)

    WEB SEED México

    La foto de SEED México, fue tomada durante el Taller DPOPS en Buscando la Aurora.