OGRE Wiki
Support and community documentation for Ogre3D
Ogre Forums
ogre3d.org
Log in
Username:
Password:
CapsLock is on.
Remember me (for 1 year)
Log in
Home
Tutorials
Tutorials Home
Basic Tutorials
Intermediate Tutorials
Mad Marx Tutorials
In Depth Tutorials
Older Tutorials
External Tutorials
Cookbook
Cookbook Home
CodeBank
Snippets
Experiences
Ogre Articles
Libraries
Libraries Home
Alternative Languages
Assembling A Toolset
Development Tools
OGRE Libraries
List of Libraries
Tools
Tools Home
DCC Tools
DCC Tutorials
DCC Articles
DCC Resources
Assembling a production pipeline
Development
Development Home
Roadmap
Building Ogre
Installing the Ogre SDK
Setting Up An Application
Ogre Wiki Tutorial Framework
Frequently Asked Questions
Google Summer Of Code
Help Requested
Ogre Core Articles
Community
Community Home
Projects Using Ogre
Recommended Reading
Contractors
Wiki
Immediate Wiki Tasklist
Wiki Ideas
Wiki Guidelines
Article Writing Guidelines
Wiki Styles
Wiki Page Tracker
Ogre Wiki Help
Ogre Wiki Help Overview
Help - Basic Syntax
Help - Images
Help - Pages and Structures
Help - Wiki Plugins
Toolbox
Freetags
Categories
List Pages
Structures
Trackers
Statistics
Rankings
List Galleries
Ogre Lexicon
Comments
History: ManualObject 2D
View page
Source of version: 6
(current)
__Note:__ You should use a material that has lighting and depth write turned off for this to behave correctly. See ((Displaying 2D Backgrounds)) for an example how to set up such a material programmatically. {CODE(wrap="1", colors="c++")}// Create a manual object for 2D ManualObject* manual = mSceneMgr->createManualObject("manual"); // Use identity view/projection matrices manual->setUseIdentityProjection(true); manual->setUseIdentityView(true); manual->begin("BaseWhiteNoLighting", RenderOperation::OT_LINE_STRIP); manual->position(-0.2, -0.2, 0.0); manual->position( 0.2, -0.2, 0.0); manual->position( 0.2, 0.2, 0.0); manual->position(-0.2, 0.2, 0.0); manual->index(0); manual->index(1); manual->index(2); manual->index(3); manual->index(0); manual->end(); // Use infinite AAB to always stay visible AxisAlignedBox aabInf; aabInf.setInfinite(); manual->setBoundingBox(aabInf); // Render just before overlays manual->setRenderQueueGroup(RENDER_QUEUE_OVERLAY - 1); // Attach to scene mSceneMgr->getRootSceneNode()->createChildSceneNode()->attachObject(manual);{CODE} Gives an outlined rectangle in the middle of the screen that is always visible. __Note__: If you want to create empty manual object sections first and then later on fill those sections with geometry data, you need to initialise section with all the vertex components you intend to use (position, texture coordinate, normal etc.) If you do not do this, uninitialised vertex components will be discarded later on when you try to update your manual object. {CODE(wrap="1", colors="c++")} // Create a manual object that is filled later on during the runtime manual->begin("UI/Element", Ogre::RenderOperation::OT_TRIANGLE_LIST); manual->position(x2, y2); manual->textureCoord(1, 1); manual->position(x2, y); manual->textureCoord(1, 0); manual->position(x, y); manual->textureCoord(0, 0); manual->end(); // Fill during the runtime normally // Texture coordinates will generated because they were present // in the buffer created by first call to end() manual->beginUpdate(sectionId); manual->position(x2, y2); manual->textureCoord(1, 1); manual->position(x2, y); manual->textureCoord(1, 0); manual->position(x, y); manual->textureCoord(0, 0); manual->end(); {CODE} !!See also * ((ManualObject)) * ((Line 3D)) * ((DynamicLineDrawing)) * ((Circle3D)) --- Alias: (alias(ManualObject_2D))
Search by Tags
Search Wiki by Freetags
Latest Changes
Minimal Ogre Collision
Artifex Terra
OpenMB
Advanced Mogre Framework
MogreSocks
Critter AI
Mogre Add-ons
MOGRE
Mogre MyGUI wrapper
MOGRE Editable Terrain Manager
...more
Search
Find
Advanced
Search Help
Online Users
45 online users