logo logo
Home arrow Forums...
Friday, 05 December 2008
 
 
English English  Español Español  
Upcoming Events
10.Jun. 2009

IWANN 2009
Salamanca, Spain
International Work-Conference on Artificial Neural Networks
11.Jun. 2009

Toward a Science of Consciousness
Hong Kong, China
15.Jun. 2009

International Workshop on Machine Consciousness
Hong Kong, China
15.Jun. 2009

The 8th IEEE International Conference on Cognitive Informatics
Hong Kong, China
22.Jun. 2009

IWINAC 2009
Santiago de Compostela, Spain
Work-Conference in the Interplay between Natural and Artificial Computation
Tag Cloud
Architectures Artificial Associations Books Conferences Conscious Consciousness Developer Documentación Documentation Español Machine Machine Consciousness Machines Neuroscience Publications Research Researchers Reviews Robotics Robots Spanish Studio VPL
Spotlight
Syndicate
 Conscious Robots RSS FeedConscious Robots RSS Feed
Conscious-Robots.com Forum  


Raúl
Moderator

Moderator
Posts: 434
graph
Karma: 6  
Re:Creación de laberinto - 2008/03/12 22:09 Hola,

Puedes echar un vistazo al código del servicio Maze Simulator para ver como crea las paredes a partir de un bmp. El método que añade los muros es este:

Code:

         // Adds a simple cube at a specified location in the maze grid         void AddWall(int rowint colfloat heightBasicColor color)         {             // TT Oct-2006 - Add an option to use a sphere instead of a cube             if (_UseSphere[(byte)color])             {                 SphereShapeProperties cSphereShape null;                 SingleShapeEntity sphere null;                 float radius;                 radius _state.SphereScale *  height 2.0f;                 // create simple entity, with a single shape                 cSphereShape = new SphereShapeProperties(                     // TT -- Change to infinite mass so that the walls                     // do not "blow apart" if you bump them!                     // TT Oct 2006 -- Allow user to specify this                         _WallMasses[(byte)color], // mass in kilograms.                         new Pose(),     // relative pose                         radius);    // radius                 cSphereShape.Material = new MaterialProperties("gsphere"1.0f0.01f0.01f);                 // Set the color of the sphere according to the bitmap image                 // or the specified color if no bitmap                 if (_WallTextures[(byte)color] == "")                 {                     // TT - Changed for October CTP because DiffuseColor                     // is a Vector4, but my WallColors are Vector3                     //cBoxShape.DiffuseColor = _WallColors[(byte)color];                     cSphereShape.DiffuseColor.= (float)(_WallColors[(byte)color].255.0);                     cSphereShape.DiffuseColor.= (float)(_WallColors[(byte)color].255.0);                     cSphereShape.DiffuseColor.= (float)(_WallColors[(byte)color].255.0);                     cSphereShape.DiffuseColor.1.0f;                 }                 else                     cSphereShape.TextureFileName _WallTextures[(byte)color];                 sphere = new SingleShapeEntity(new SphereShape(cSphereShape),                     new Vector3((col * -_state.GridSpacing),                             radius,                             -(row _state.GridSpacing)));                 // Name the entity. All entities must have unique names                 sphere.State.Name "ball_" row "_" col;                 // Insert entity in simulation.                   _simEnginePort.Insert(sphere);             }             else             {                 // Dimensions are in meters                 Vector3 dimensions =                     new Vector3(_state.WallBoxSize _state.GridSpacing,                             height _state.HeightScale,                             _state.WallBoxSize _state.GridSpacing);                 BoxShapeProperties cBoxShape null;                 SingleShapeEntity box null;                 // create simple immovable entity, with a single shape                 cBoxShape = new BoxShapeProperties(                     // TT -- Change to infinite mass so that the walls                     // do not "blow apart" if you bump them!                     // TT Oct 2006 -- Allow user to specify this                         _WallMasses[(byte)color], // mass in kilograms.                         new Pose(),     // relative pose                         dimensions);    // dimensions                 cBoxShape.Material = new MaterialProperties("gbox"1.0f0.4f0.5f);                 // Set the color of the box according to the bitmap image                 // or the specified color if no bitmap                 if (_WallTextures[(byte)color] == "")                 {                     // TT - Changed for October CTP because DiffuseColor                     // is a Vector4, but my WallColors are Vector3                     //cBoxShape.DiffuseColor = _WallColors[(byte)color];                     cBoxShape.DiffuseColor.= (float)(_WallColors[(byte)color].255.0);                     cBoxShape.DiffuseColor.= (float)(_WallColors[(byte)color].255.0);                     cBoxShape.DiffuseColor.= (float)(_WallColors[(byte)color].255.0);                     cBoxShape.DiffuseColor.0.5f;                 }                 else                     cBoxShape.TextureFileName _WallTextures[(byte)color];                 box = new SingleShapeEntity(new BoxShape(cBoxShape),                     new Vector3(col * -_state.GridSpacing,                             height _state.HeightScale 2,                             -(row _state.GridSpacing)));                 // Name the entity. All entities must have unique names                 box.State.Name "wall_" row "_" col;                 // Insert entity in simulation.                   _simEnginePort.Insert(box);             }             BlockCounter++;         }



Como ves usa la entidad box para crear las pareces. Una esquina se forma por dos 'boxes' pegados.

También puedes coger un entorno ya creado y editarlo directamente usando el modo de edición del simulador.

Echa un vistazo a este mensaje:

-> Crear una simulación
Raúl Arrabales Moreno. conscious-robots.com/raul
  The administrator has disabled public write access. Please, register to participate in the forum.

      Topics Author Date
    thread link
Creación de laberinto
avionf18 2008/03/12 12:39
    emo
thread linkthread link Re:Creación de laberinto
Raúl 2008/03/12 22:09
    emo
thread linkthread linkthread link Re:Creación de laberinto
Raúl 2008/04/11 12:29





Lost Password?
No account yet? Register
Last Posts in Forum
 
Top!
Advertising links: Debt Consolidation - Cheap Gas - Loan - Loans
Top!