Rectangle2D not showing up

Problems building or running the engine, queries about how to use features etc.
Post Reply
Knotanalt
Halfling
Posts: 94
Joined: Sun Jul 01, 2012 2:58 pm

Rectangle2D not showing up

Post by Knotanalt » Wed Jul 11, 2012 11:42 pm

Code: Select all

	Ogre::Rectangle2D* rect = new Ogre::Rectangle2D(true);

	rect->setCorners(0.0f, 0.0f, 1.0f, 1.0f);
	rect->setMaterial("BaseWhite");
 
	// Render the background before everything else
	rect->setRenderQueueGroup(Ogre::RENDER_QUEUE_BACKGROUND);
 
	// Use infinite AAB to always stay visible
	Ogre::AxisAlignedBox aabInf;
	aabInf.setInfinite();
	rect->setBoundingBox(aabInf);
 
	// Attach background to the scene
	Ogre::SceneNode* node =  (Ogre::SceneNode*) sceneManager->getRootSceneNode();
	node->detachAllObjects();
	node->attachObject(rect);
Is setting material like that ok? (rect->setMaterial("BaseWhite");)

I'm modifying basic tutorial 2 to do this. Is that the right way to put the rectangle onto the scene graph?
0 x

Knotanalt
Halfling
Posts: 94
Joined: Sun Jul 01, 2012 2:58 pm

Re: Rectangle2D not showing up

Post by Knotanalt » Thu Jul 12, 2012 12:03 am

Laff, I get it now. I had a minor attack of lysdexia! Those bounds made no sense.
0 x

User avatar
fantasian
Halfling
Posts: 81
Joined: Fri May 29, 2009 8:47 am
Location: Selanic, Greece
Contact:

Re: Rectangle2D not showing up

Post by fantasian » Wed Aug 31, 2016 3:23 pm

Knotanalt wrote:Laff, I get it now. I had a minor attack of lysdexia! Those bounds made no sense.
Maybe you remember what on earth went wrong back then? I just can't get the Rectangle2D to simply render by following the usual tutorial:
http://www.ogre3d.org/tikiwiki/Displayi ... ackgrounds

EDIT : Nah forget it, Rectangle2D is rubbish. Went for Overlay Panel instead. The real question is, would it be possible to render an Overlay UNDER normal 3D stuff..?
0 x

User avatar
syedhs
Silver Sponsor
Silver Sponsor
Posts: 2702
Joined: Mon Aug 29, 2005 3:24 pm
Location: Kuala Lumpur, Malaysia
x 1

Re: Rectangle2D not showing up

Post by syedhs » Thu Sep 01, 2016 5:44 pm

Try setting aabInf to something very large (in leu of infinity - may be there is a bug)
0 x
A willow deeply scarred, somebody's broken heart
And a washed-out dream
They follow the pattern of the wind, ya' see
Cause they got no place to be
That's why I'm starting with me

Post Reply