In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-26 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
OpenSceneGraph in the form mode is how to run, many novices are not very clear about this, in order to help you solve this problem, the following editor will explain in detail for you, people with this need can come to learn, I hope you can gain something.
1. Use osgViewer::Viewer instead of osgProducer::Viewer 2. Familiarize yourself with design patterns, such as the most commonly used Visitor design pattern. Otherwise, if you don't understand the program, you won't be able to write it. 3. Form mode runs the reference Example osgWindows. In this example, the key point is:
Osg::ref_ptr traits = new osg::GraphicsContext::Traits;traits- > x = 640th traits-> y = 0th traits-> width = 640th traits-> height = 480th traits-> windowDecoration = true;traits- > doubleBuffer = true;traits- > sharedContext = 0tr gc = osg::GraphicsContext::createGraphicsContext (traits.get ()); osg::ref_ptr camera = new osg::Camera;camera- > setGraphicsContext (gc.get ()); camera- > setViewport (0new osg::Viewport 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 matrixviewer.addSlave (camera.get (), osg::Matrixd::translate (- 1.0, 0.0lc0.0), osg::Matrixd ())
In addition, Example osgkeyboardmouse also mentioned another way:
/ / create the window to draw to.osg::ref_ptr traits = new osg::GraphicsContext::Traits;traits- > x = 200 traits-> y = 200 traits-> width = 800 traits-> height = 600 traits-> windowDecoration = true;traits- > doubleBuffer = true;traits- > sharedContext = 0Triton gc = osg::GraphicsContext::createGraphicsContext (traits.get ()); osgViewer::GraphicsWindow* gw = dynamic_cast (gc.get ()); if (! gw) {osg::notify (osg::NOTICE) getEventQueue ()) Viewer.getEventQueue ()-> windowResize (traits- > xmeme traits-> ymemery traits-> width,traits- > height)
TODO: the 1.3DS import plug-in is not perfect enough and needs to be written by yourself. two。 Learn more about the mechanism of OSG.
Is it helpful for you to read the above content? If you want to know more about the relevant knowledge or read more related articles, please follow the industry information channel, thank you for your support.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.