iCub-main
rendering.h
Go to the documentation of this file.
1 // -*- mode:C++; tab-width:4; c-basic-offset:4; indent-tabs-mode:nil -*-
2 
3 /*
4 * Copyright (C) 2010 RobotCub Consortium, European Commission FP6 Project IST-004370
5 * Author: Vadim Tikhanoff
6 * email: vadim.tikhanoff@iit.it
7 * website: www.robotcub.org
8 * Permission is granted to copy, distribute, and/or modify this program
9 * under the terms of the GNU General Public License, version 2 or any
10 * later version published by the Free Software Foundation.
11 *
12 * A copy of the license can be found at
13 * http://www.robotcub.org/icub/license/gpl.txt
14 *
15 * This program is distributed in the hope that it will be useful, but
16 * WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
18 * Public License for more details
19 */
20 
30 #include "SDL.h"
31 #include "SDL_opengl.h"
32 #include <ode/ode.h>
33 #include "VideoTexture.h"
34 #include <yarp/os/ResourceFinder.h>
35 #include "xloader.h"
36 #include <iostream>
37 # include <stdio.h>
38 using std::cout;
39 using std::endl;
40 #ifndef __RENDERING_H__
41 #define __RENDERING_H__
42 #define FLOOR 0
43 
44 typedef struct /**** BMP file info structure ****/
45  {
46  unsigned int biSize; /* Size of info header */
47  int biWidth; /* Width of image */
48  int biHeight; /* Height of image */
49  unsigned short biPlanes; /* Number of color planes */
50  unsigned short biBitCount; /* Number of bits per pixel */
51  unsigned int biCompression; /* Type of compression to use */
52  unsigned int biSizeImage; /* Size of image data */
53  int biXPelsPerMeter; /* X pixels per meter */
54  int biYPelsPerMeter; /* Y pixels per meter */
55  unsigned int biClrUsed; /* Number of colors used */
56  unsigned int biClrImportant; /* Number of important colors */
57  char *data;
59 
60 typedef struct vector_s
61 {
62  float x,
63  y,
64  z;
65 } vector_t;
66 
67 typedef struct vertex_s
68 {
69  float x,
70  y,
71  z;
72 } vertex_t;
73 
74 extern unsigned int Texture[200];
75 
76 void setupTexture(char *filename, int whichtexture);
77 bool setup_opengl(yarp::os::ResourceFinder& finder);
79 void DrawGround(bool wireframe);
80 void DrawBox(float length, float height, float width, bool wireframe, bool texture, int whichtexture);
81 void DrawSphere(float radius, bool wireframe, bool texture,int whichtexture);
82 void DrawCylinder(float radius, float length, bool wireframe, bool texture,int whichtexture);
83 void LDEsetM(const dReal *pos,const dReal *R);
84 GLuint LoadTextureRAW( const char * filename, int wrap );
85 void drawSkyDome(float x, float y, float z, float width, float height, float length);
86 void DrawX (dTriMeshX trimesh, int whichtexture);
87 int LoadBitmapTERMINAL(char *filename, int whichtexture);
88 
89 
90 #endif
91 
92 
VideoTexture.h
Header file for the video stream texture.
width
static int width
Definition: iCub_Sim.cpp:53
LDEsetM
void LDEsetM(const dReal *pos, const dReal *R)
Definition: rendering.cpp:400
SIMBITMAPINFOHEADER::biHeight
int biHeight
Definition: rendering.h:48
vector_s::x
float x
Definition: rendering.h:62
vertex_s
Definition: rendering.h:67
SIMBITMAPINFOHEADER::data
char * data
Definition: rendering.h:57
video
static VideoTexture * video
Definition: iCub_Sim.cpp:82
pos
const dReal * pos
Definition: iCub_Sim.cpp:62
xloader.h
Header for the 3D x loader.
z
z
Definition: show_eyes_axes.m:22
SIMBITMAPINFOHEADER::biWidth
int biWidth
Definition: rendering.h:47
SIMBITMAPINFOHEADER::biYPelsPerMeter
int biYPelsPerMeter
Definition: rendering.h:54
vertex_t
struct vertex_s vertex_t
DrawSphere
void DrawSphere(float radius, bool wireframe, bool texture, int whichtexture)
Definition: rendering.cpp:329
LoadBitmapTERMINAL
int LoadBitmapTERMINAL(char *filename, int whichtexture)
Definition: rendering.cpp:509
DrawCylinder
void DrawCylinder(float radius, float length, bool wireframe, bool texture, int whichtexture)
Definition: rendering.cpp:353
Texture
unsigned int Texture[200]
Definition: rendering.cpp:53
vertex_s::z
float z
Definition: rendering.h:71
drawSkyDome
void drawSkyDome(float x, float y, float z, float width, float height, float length)
Definition: rendering.cpp:159
VideoTexture
Definition: VideoTexture.h:71
DrawVideo
void DrawVideo(VideoTexture *video)
Definition: rendering.cpp:456
SIMBITMAPINFOHEADER::biSizeImage
unsigned int biSizeImage
Definition: rendering.h:52
setupTexture
void setupTexture(char *filename, int whichtexture)
Definition: rendering.cpp:504
SIMBITMAPINFOHEADER::biPlanes
unsigned short biPlanes
Definition: rendering.h:49
y
y
Definition: show_eyes_axes.m:21
x
x
Definition: compute_ekf_sym.m:21
SIMBITMAPINFOHEADER::biClrUsed
unsigned int biClrUsed
Definition: rendering.h:55
DrawGround
void DrawGround(bool wireframe)
Definition: rendering.cpp:122
DrawX
void DrawX(dTriMeshX trimesh, int whichtexture)
Definition: rendering.cpp:461
setup_opengl
bool setup_opengl(yarp::os::ResourceFinder &finder)
Definition: rendering.cpp:64
LoadTextureRAW
GLuint LoadTextureRAW(const char *filename, int wrap)
Definition: rendering.cpp:421
SIMBITMAPINFOHEADER::biClrImportant
unsigned int biClrImportant
Definition: rendering.h:56
SIMBITMAPINFOHEADER::biBitCount
unsigned short biBitCount
Definition: rendering.h:50
height
static int height
Definition: iCub_Sim.cpp:54
DrawBox
void DrawBox(float length, float height, float width, bool wireframe, bool texture, int whichtexture)
Definition: rendering.cpp:226
dxTriMeshX
Definition: xloader.h:44
SIMBITMAPINFOHEADER::biXPelsPerMeter
int biXPelsPerMeter
Definition: rendering.h:53
SIMBITMAPINFOHEADER::biCompression
unsigned int biCompression
Definition: rendering.h:51
vertex_s::x
float x
Definition: rendering.h:69
vector_t
struct vector_s vector_t
vector_s::y
float y
Definition: rendering.h:63
vertex_s::y
float y
Definition: rendering.h:70
vector_s::z
float z
Definition: rendering.h:64
SIMBITMAPINFOHEADER::biSize
unsigned int biSize
Definition: rendering.h:46
SIMBITMAPINFOHEADER
Definition: rendering.h:44
vector_s
Definition: rendering.h:60