ogre-Adding a small navigation window to a three-dimensional window

Source: Internet
Author: User

Reference: http://www.cppblog.com/hitmaen/archive/2007/05/22/24589.html

Reference: http://www.360doc.com/content/13/0906/11/593831_312575920.shtml

Reference: http://blog.csdn.net/windows_nt/article/details/7495387

(Owed by: Spring Night rain Http://blog.csdn.net/chunyexiyu reprint please indicate the source)

To implement adding a navigation window on a ogre-three-dimensional window

There are two ways, one is to use the Ogre multi-viewport implementation, one is to use Windows transparent window implementation

The following uses Ogre 's multi-viewport to achieve

//-------------------------------------------------------------------------------------------------------------

First create a second Camera

// picture-in -Pictures camera

M_pcamerainner =m_pscenemanager,createcamera("Innercam"); // Create a camera named Playercam

M_pcamerainner-setposition(Vector3(0,0,500)); // setting the camera's location

M_pcamerainner-lookAt(Vector3(0,0,0)); // the direction of the camera

M_pcamerainner,setnearclipdistance(5); // Close-up clipping of position units

Then create a second ViewPort, which ViewPort the corner of the window

// picture in the picture viewport

Viewport *vpinner =M_pwindow,addviewport(m_pcamerainner, 1 , 0.75, 0, 0.25, 0.25); // place in top left corner

Vpinner-setbackgroundcolour(colourvalue(0, 0, 1)); // Set Background

Vpinner,setoverlaysenabled(false); // do not enable overlay

M_pcamerainner-setaspectratio(Real(VP-getactualwidth())/ Real (VP-getactualheight())); // Viewport aspect ratio

use Windows 's transparent window for the following now

//-------------------------------------------------------------------------------------------------------------

A. First, create a borderless dialog box,

B. then set the transparent form properties in the OnInitDialog of the dialog box, set the transparency

// set the form to translucent

SetWindowLong (m_hwnd,gwl_exstyle, getwindowlong(m_hwnd,gwl_exstyle) | ws_ex_layered);

setlayeredwindowattributes (0,lwa_alpha);

c. Adjust the position of the form to the upper left corner

D. you can use OpenGL to draw elements in a form

This creates the effect of the PIP, and the effect of this painting is a translucent effect.

(Owed by: Spring Night rain Http://blog.csdn.net/chunyexiyu reprint please indicate the source)

ogre-Adding a small navigation window to a three-dimensional window

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.