Create a 2D transparent information panel in the 3D scenario of meshlab

Source: Internet
Author: User

The specific method is to switch the projection modeParallel projectionAnd then draw the 2D image, and map it to the two-dimensional screen.

Note: The 2D transparent scene information panel is under the 3D drawing area.PurpleTransparent area

CoreCodeAs follows:

 
Void glarea: displayinfo () {// enter in 2D Screen mode againglmatrixmode (gl_projection); glpushmatrix (); glloadidentity (); glortho (-1, 1,-1,-1 ); glmatrixmode (gl_modelview); glpushmatrix (); glloadidentity (); glpushattrib (scheme); gldisable (gl_lighting); gldisable (scheme); gl_blend ); glblendfunc (gl_one, gl_src_alpha); // set display info pane color glcolor (logareacolor); // barheight is the height of paneglbegin (gl_quads); glvertex2f (-1.f, barheight ); glvertex2f (-1.f,-1.f); glvertex2f (1.f,-1.f); glvertex2f (1.f, barheight); glend ();
// Render text is dismiss // closing 2 dglpopattrib (); glpopmatrix (); // restore modelviewglmatrixmode (gl_projection); glpopmatrix (); glmatrixmode (gl_modelview );}

----------------

Hope to be useful to you! Good luck.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.