Openscenegraph note-form mode running

Source: Internet
Author: User
1. Use osgviewer: viewer to replace the original osgproducer: Viewer
2. Familiarize yourself with the design mode, such as the most common visitor design mode. Otherwise you cannot understand Program Not to mention, and cannot write programs.
3. For details about running the form mode, refer to example osgwindows. The focus is: OSG: ref_ptr < OSG: graphicscontext: traits > Traits =   New OSG: graphicscontext: traits;
Traits -> X =   640 ;
Traits -> Y =   0 ;
Traits -> Width =   640 ;
Traits -> Height =   480 ;
Traits -> Windowdecoration =   True ;
Traits -> Doublebuffer =   True ;
Traits -> Sharedcontext =   0 ;

OSG: ref_ptr<OSG: graphicscontext>GC=OSG: graphicscontext: creategraphicscontext (traits.Get());

OSG: ref_ptr < OSG: Camera > Camera =   New OSG: camera;
Camera -> Setgraphicscontext (GC. Get ());
Camera -> Setviewport ( New OSG: viewport ( 0 , 0 , Traits -> Width, traits -> Height ));
Glenum Buffer = Traits -> Doublebuffer ? Gl_back: gl_front;
Camera -> Setdrawbuffer (buffer );
Camera -> Setreadbuffer (buffer );

//Add this slave camra to the viewer, with a shift right of the projection matrix
Viewer. addslave (camera.Get(), OSG: matrixd: translate (-1.0,0.0,0.0), OSG: matrixd ());

Todo:
1.3ds import plug-in is not complete yet. You need to write it yourself.
2. Have a better understanding of the OSG mechanism.

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.