Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Custom Query (296 matches)

Filters
 
Or
 
  
 
Columns

Show under each result:


Results (13 - 15 of 296)

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
Ticket Resolution Summary Owner Reporter
#15 fixed Implementing GrpahicsEngine class bensch patrick
Description

this class should become a little primitive GraphicsEngine that manages things like:

  • concrete use:
    • setting up all SDL attributes
    • setting up all lights, materials
    • able to reinig SDL if the graphics mode/resolution should ever change during game
    • determines wether the drawable objects should be drawed or not (depends also from mode, like debug mode draws everything)
    • manages to display images, films, menu, console etc.
    • should be able to calculate the computer/graphics speed to set the optimal resolution settings (future)
  • requirements:
    • see concrete use
  • implementation:
    • class that is loaded at startup in the init section of orxonox.cc
    • class is a singleton
    • class works in different modes: menu-mode, film-mode, image-mode, game-mode (more?)
    • manages light sources, shadows, effects.
    • state of the graphics engine must be displayable (debug function)
#16 invalid Height Map Terrain nobody bensch
Description

A HeightMapTerrain is a class, that reads in a grey-scale image. Black is low terrain, White is high. Like this it should be very easy possible, to create good looking landscapes.
The process is called displacement and can also be applied to other bodies than flat surfaces. ⇒ Ideas?

  • The class must be able to
    • read in a texture as an SDL_surface.
      bool Material::loadImage(char* imageName, GLuint* texture)
      {
        char* imgNameWithPath = searchTextureInPaths(imageName);
        if (imgNameWithPath)
          {
            SDL_Surface* map;
            Image* pImage = new Image;
            map=IMG_Load(imgNameWithPath);
            if(!map)
      	{
      	  PRINTF(1)("IMG_Load: %s\n", IMG_GetError());
      	  return false;
      	}
            pImage->height = map->h;
            pImage->width  = map->w;
            pImage->data   = (GLubyte*)map->pixels;
            if( !IMG_isPNG(SDL_RWFromFile(imgNameWithPath, "rb")) && !IMG_isJPG(SDL_RWFromFile(imgNameWithPath, "rb")))
      	for (int i=0;i<map->h * map->w *3;i+=3)
      	  { 
      	    GLuint temp = pImage->data[i];
      	    pImage->data[i] = pImage->data[i+2];
      	    pImage->data[i+2] = temp;
      	  }
            this->applyItToAHitghtMap (pImage, texture);
          }
        else
          {
            PRINTF(1)("Image not Found: %s\n", imgNameWithPath);
            return false;
          }
      }
      
    • then it should apply what it learnt to the heightMap (use the struct given below to pass info)
        struct Image
        {
          int rowSpan;    //!< The count of the rows this Image has.
          GLuint width;   //!< The width of the Image.
          GLuint height;  //!< The height of the Image.
          GLuint bpp;     //!< BitsPerPixel
          GLuint type;    //!< Type of the Image.
          GLubyte *data;  //!< The Image Data comes here! DANGER: uncompressed data. Delete it!
        };
      
    • Then Transform the mesh, pack it into (multipe) display lists, and give it back to orxonox.
  • Look out!
    • Loading will heappen at levelstart, so it can use some time.
    • During the Game-runtime there may be no delay.
    Look, that your algorithm covers this.
#17 fixed Height Map Terrain bottac bensch
Description

A HeightMapTerrain is a class, that reads in a grey-scale image. Black is low terrain, White is high. Like this it should be very easy possible, to create good looking landscapes.
The process is called displacement and can also be applied to other bodies than flat surfaces. ⇒ Ideas?

  • The class must be able to
    • read in a texture as an SDL_surface.
      bool Material::loadImage(char* imageName, GLuint* texture)
      {
        char* imgNameWithPath = searchTextureInPaths(imageName);
        if (imgNameWithPath)
          {
            SDL_Surface* map;
            Image* pImage = new Image;
            map=IMG_Load(imgNameWithPath);
            if(!map)
      	{
      	  PRINTF(1)("IMG_Load: %s\n", IMG_GetError());
      	  return false;
      	}
            pImage->height = map->h;
            pImage->width  = map->w;
            pImage->data   = (GLubyte*)map->pixels;
            if( !IMG_isPNG(SDL_RWFromFile(imgNameWithPath, "rb")) && !IMG_isJPG(SDL_RWFromFile(imgNameWithPath, "rb")))
      	for (int i=0;i<map->h * map->w *3;i+=3)
      	  { 
      	    GLuint temp = pImage->data[i];
      	    pImage->data[i] = pImage->data[i+2];
      	    pImage->data[i+2] = temp;
      	  }
            this->applyItToAHitghtMap (pImage, texture);
          }
        else
          {
            PRINTF(1)("Image not Found: %s\n", imgNameWithPath);
            return false;
          }
      }
      
    • then it should apply what it learnt to the heightMap (use the struct given below to pass info)
        struct Image
        {
          int rowSpan;    //!< The count of the rows this Image has.
          GLuint width;   //!< The width of the Image.
          GLuint height;  //!< The height of the Image.
          GLuint bpp;     //!< BitsPerPixel
          GLuint type;    //!< Type of the Image.
          GLubyte *data;  //!< The Image Data comes here! DANGER: uncompressed data. Delete it!
        };
      
    • Then Transform the mesh, pack it into (multipe) display lists, and give it back to orxonox.
  • Look out!
    • Loading will heappen at levelstart, so it can use some time.
    • During the Game-runtime there may be no delay.
    Look, that your algorithm covers this.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
Note: See TracQuery for help on using queries.