Semantic Pointing for Object Picking in Complex 3D Environments
by Christian Kössler and Felix Kreuzer
 All Classes Files Functions Variables Macros Pages
Functions
utility.hpp File Reference
#include <fstream>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <glm/gtx/transform.hpp>
#include <assimp.hpp>
#include <aiScene.h>
#include <aiPostProcess.h>
#include "common.hpp"

Go to the source code of this file.

Functions

bool initFbo (GLuint &fboId, GLuint &imgId, int width, int height)
 Initializes the FBO, which is used as PickBuffer (render objectIds for object picking). More...
 
int * readPixels (unsigned int xFrom, unsigned int yFrom, unsigned int width, unsigned int height, GLuint fboId, GLuint imgId)
 Reads pixels from the GPU in a rectangular form. More...
 

Function Documentation

bool initFbo ( GLuint &  fboId,
GLuint &  imgId,
int  width,
int  height 
)

Initializes the FBO, which is used as PickBuffer (render objectIds for object picking).

Parameters
fboIdis used to store the handle the FBO has got
imgIdis used to store the texture handle
widthdetermines the width of the FBO
heightdetermines the height of the FBO
Returns
if the FBO could be created successful
int* readPixels ( unsigned int  xFrom,
unsigned int  yFrom,
unsigned int  width,
unsigned int  height,
GLuint  fboId,
GLuint  imgId 
)

Reads pixels from the GPU in a rectangular form.

Parameters
xFromLeft start value of the rectangle
yFromBottom start value of the rectangle
widthWidth of the rectangle
heightHeight of the rectangle
fboIdis used to identify the FBO
imgIdis used to identify the texture
Returns
the read values as integer array