3.large TIN viewer using modern OpenGL

modern OpenGLによる大規模点群データの可視化特性

modern OpenGLによる大規模TINの可視化特性 (庄内川流域)

スクリーンショット 2013-08-06 19.34.51

定義:参考文献(OpenGL Insights, Patrick Cozzi & Christophe Riccio)

対象:庄内川流域(点群数,流域面積)

TIN – tinlib

→Fast triangulation of unordered point clouds

project on XCODE

FPS – frames per seconds

The first metric useful in performance analysis is the frame rate. The frame rate measures the number of frames per second your application displays. Unlike most performance metrics, the frame rate is a discrete measurement. You cannot, for instance, have a frame rate of 12.5 frames per second (FPS).

glutGet – 

References

Step

multi dimensional arrays to single arrays – base code

1. 3 dimensional arrays programming (3次元配列)

glBufferData

fread – fopen – malloc ref

1.VTK-Paraview

2.PCL-vtk POD fie format

3.VBO-OpenGL-OBJ

glGenBuffers : generate buffers

glBindBuffer :

glVertexPointer :

glDrawArrays(GL_POINTS,

glDrawElements :

mode: GL_POINTSGL_LINE_STRIPGL_LINE_LOOPGL_LINESGL_LINE_STRIP_ADJACENCY,GL_LINES_ADJACENCYGL_TRIANGLE_STRIPGL_TRIANGLE_FANGL_TRIANGLESGL_TRIANGLE_STRIP_ADJACENCYGL_TRIANGLES_ADJACENCY andGL_PATCHES

type: Must be one of GL_UNSIGNED_BYTE, GL_UNSIGNED_SHORT, GL_UNSIGNED INT

glMapBuffer, glMapBufferRange

*Tips

glutMouseFunc

glutMotionFunc

 

////////////////////////////////////////////////////////////////////////////////

//! Create VBO from simpleGL.cu

////////////////////////////////////////////////////////////////////////////////

void createVBO(GLuint *vbo, struct cudaGraphicsResource **vbo_res,

unsigned int vbo_res_flags)

{

assert(vbo);

// create buffer object

glGenBuffers(1, vbo);

glBindBuffer(GL_ARRAY_BUFFER, *vbo);

// initialize buffer object

unsigned int size = mesh_width * mesh_height * 4 * sizeof(float);

glBufferData(GL_ARRAY_BUFFER, size, 0, GL_DYNAMIC_DRAW);

glBindBuffer(GL_ARRAY_BUFFER, 0);

// register this buffer object with CUDA

checkCudaErrors(cudaGraphicsGLRegisterBuffer(vbo_res, *vbo, vbo_res_flags));

SDK_CHECK_ERROR_GL();

}