logo logo
Inicio arrow Foros...
Thursday, 08 de January de 2009
 
 
English English  Español Español  
Próximos Eventos
10.Jun. 2009

IWANN 2009
Salamanca, Spain
11.Jun. 2009

Toward a Science of Consciousness
Hong Kong, China
14.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
Etiquetas
Análisis Artificial Científicos Conciencia Consciencia Consciencia Artificial Conscientes Consciousness Developer Documentación Documentation Español Howto Investigación Publicaciones Reviews Robotics Robots Robótica Servicios Spanish Studio VPL artificial
Destacados
Conscious-Robots.com Forum  


Raúl
Moderador

Moderador
Mensajes: 444
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
  El administrador ha deshabilitado la escritura de mensajes a los usuarios no registrados.

      Temas Autor Fecha
    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
Titulares RSS
 Conscious Robots RSS FeedFuente RSS de Conscious Robots





¿Recuperar contraseña?
¿Quieres registrarte? Hazlo aquí
Mensajes en el Foro
 
Top!
Advertising links: Credit Cards - Arizona Pools - Loans - Guitar Books
Top!