Try Pangolin(1)

来源:互联网 发布:九城软件电话 编辑:程序博客网 时间:2024/06/08 01:35

Tried to modify parameters in given examples on https://github.com/stevenlovegrove/Pangolin/tree/master/examples.


Reference: http://docs.ros.org/fuerte/api/pangolin_wrapper/html/index.html.


(1) HelloPangolin.cpp

Original Result: (With pangolin::ProjectionMatrix(1680,1480,420,420,320,240,0.2, 100))


After commenting out "glEnable(GL_DEPTH_TEST);", I got:


 According to https://www.khronos.org/opengles/sdk/docs/man/xhtml/glEnable.xml, GL_DEPTH_TEST, if enabled, do depth comparisons and update the depth buffer.

3D handler syntax:

  
    pangolin::Handler3D shandler(s_cam);    pangolin::View& d_cam = pangolin::CreateDisplay()        .SetBounds(0.0, 1.0, 0.0, 1.0, -640.0f/480.0f)        .SetHandler(&shandler);


//Here "handler" and "s_cam" are just names made by the user.

About .SetBounds and .SetHandler:


Modified some parameters:

With pangolin::ProjectionMatrix(1680,1480,420,420,320,240,0.2, 100), I got:

With pangolin::ProjectionMatrix(1680,1480,420,220,320,240,0.2, 100), I got:

With pangolin::ProjectionMatrix(680,480,420,420,620,240,0.2, 100), I got:


With pangolin::ModelViewLookAt(2,2,-2,0,0,0, pangolin::AxisY), I got the cube flipped horizontally as below:


With pangolin::ModelViewLookAt(2,-2,2,0,0,0, pangolin::AxisY), I got the cube flipped both horizontally and vertically as below:


According to: https://www.opengl.org/sdk/docs/man2/xhtml/glClear.xml, glClear sets the bitplane area of the window to values previously selected by glClearColor, glClearIndex, glClearDepth, glClearStencil, and glClearAccum.


Without glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT), I got:


Because the bitplane area of the window is not cleaned.

 And without d_cam.Activate(s_cam), the result would be:





0 0
原创粉丝点击