62 glViewport(viewport[0], viewport[1], viewport[2], viewport[3]);
67 fbo.
create(viewport[2]-viewport[0], viewport[3]-viewport[1], 1);
84 glEnable(GL_DEPTH_TEST);
107 Eigen::Vector4f
pick (
const Eigen::Vector2i &pos)
int getHeight(void)
Returns the height of the FBO.
Definition: framebuffer.hpp:893
Picks a 3D position from screen position.
Definition: picking.hpp:36
void getViewMatrix(GLdouble *matrix)
Return the modelview matrix as a GLdouble array.
Definition: camera.hpp:126
void getProjectionMatrix(GLdouble *matrix)
Return the projection matrix as a GLdouble array.
Definition: camera.hpp:142
Definition: bufferobject.hpp:34
void clearAttachments(Eigen::Vector4f clear_color=Eigen::Vector4f::Zero())
Clears all attachments with a given color.
Definition: framebuffer.hpp:448
Eigen::Vector4f readPixel(int attach, Eigen::Vector2i pos)
Reads a pixel from a buffer and returns it as an Eigen vector.
Definition: framebuffer.hpp:588
A Shader object represents one GLSL program.
Definition: shader.hpp:45
virtual void bindRenderBuffer(GLuint attachID)
Bind framebuffer object and set render buffer to given attachment.
Definition: framebuffer.hpp:258
virtual void initialize(void)
Load and initialize shaders.
Definition: picking.hpp:49
Eigen::Vector4f pick(const Eigen::Vector2i &pos)
Returns the world coordinates of point projected on given pixel.
Definition: picking.hpp:107
Picking(void)
Default constructor.
Definition: picking.hpp:44
Tucano::Shader worldcoords_shader
shader to write world coords to projected pixel positions
Definition: picking.hpp:115
Tucano::Framebuffer * getFbo(void)
Returns a pointer to the framebuffer object containg rendered world coords.
Definition: picking.hpp:97
void unbind(void)
Unbinds fbo and all texture units in use.
Definition: framebuffer.hpp:408
void unbind(void)
Disables the shader program.
Definition: shader.hpp:1184
Tucano::Framebuffer fbo
Buffer to store projected coords.
Definition: picking.hpp:118
A wrapper class for creating and using FBOs.
Definition: framebuffer.hpp:44
virtual Shader * loadShader(string shader_name)
Loads a shader by filename, initializes it, and inserts in shaders list.
Definition: effect.hpp:73
void create(int w, int h, int num_attachs=1, int nsamples=1)
Creates the framebuffer with specified parameters.
Definition: framebuffer.hpp:146
virtual void render(void)
Render the mesh triangles. The method binds the buffers, calls the method to render triangles...
Definition: mesh.hpp:756
virtual void render(Tucano::Mesh &mesh, const Tucano::Camera &camera)
Render the mesh given a camera trackball.
Definition: picking.hpp:59
Eigen::Affine3f getModelMatrix(void) const
Returns the model matrix.
Definition: model.hpp:103
int getWidth(void)
Returns the width of the FBO.
Definition: framebuffer.hpp:884
void bind(void)
Enables the shader program for usage.
Definition: shader.hpp:1176
A common Mesh, usually containing triagles or points.
Definition: mesh.hpp:194
Defines an abstract camera with a projection and view matrices.
Definition: camera.hpp:37
void setAttributeLocation(Shader *shader)
Automatically sets the attribute locations for a given Shader.
Definition: mesh.hpp:541
Eigen::Vector4f getViewport(void) const
Returns the viewport coordinates.
Definition: camera.hpp:246
The Effect class is a holder for Shaders. It is completely optional, but is contains a few methods fo...
Definition: effect.hpp:43
void setUniform(GLint location, GLint a, GLint b, GLint c, GLint d)
Sets an uniform integer 4D vector (ivec4) given a location and the vector values. ...
Definition: shader.hpp:1258