31-07-2013 17:30:51

Hello, a beginner here.

So, I have a project to do with MOGRE, which includes Augmented Reality.
I have problems with getting input from the webcam, i.e. the real image from the camera to be the background. I found a thread about a webcam plugin, but I can't compile it somehow. And I read that ARTollkitPlus is used as well, but the library is in C++.

Does anyone have any idea what to do, where to look ?Is there any function in MOGRE that allows to have the camera image as background? Any help is appreciated.



31-07-2013 18:13:09

Take a look at this thread:

The webcam demo code is here: ... WebcamDemo


02-08-2013 13:06:56

Hi, thanks for this instruction. I've been trying to put together the demo, but I get some errors... can you take a look at it?


02-08-2013 13:14:44

Hi, thanks for the instructions. I tried to make the Demo work, but I get errors that cant seem to find the solution... Can you take a look at it ?


05-08-2013 10:21:50

Hi mira,

can you post the errors you're getting?


05-08-2013 12:52:31


I get the "namespace cannot be found" , 8 of them, for Mogre,Camera, Roor, SceneManager, Viewport, RenderWindow,FrameEvent, even though I've added Mogre to the references.


05-08-2013 18:59:49

You have to convert the project to .Net 4.0.


06-08-2013 14:18:24

Yep, that did it. THANKS

Troubles continue.
I get a file not found exception when I choose the camera. There are two listed in the console : 1. Sample video and 2. Logitech ... (my webcam). I choose the second by pressing '2', and this exception shows up. What kind of file? if it's for the first one, I never need to use the first one.
Here is a screen shot.


09-08-2013 06:27:00

Are there errors listed in the file ogre.log?
Do you have the needed Ogre depencies in your binary output directory?
Ogre.dll, plugin dll files, both Ogre config files.
Additionally check the content of the config files. (paths, comments)

Did you try to run any other Mogre application?
For example the tutorial stuff?


09-08-2013 12:58:30

Yeah, as for Ogre dll-s everything is fine.
I did, i can run them.


26-10-2013 13:28:30

You can use the useful tool Process Monitor to find out the name of the missing file(s).
Run it and create a filter to see only file not found problems. (Otherwise you will be killed by all logged information).
Then try to build your Mogre application and see, what's needed.


04-04-2014 17:03:51

I ran this example, but I need to modify it to change the background in real time.

In Webcam.cs file I replaced following code

using (MaterialPtr mat = MaterialManager.Singleton.Create("vidmat", ResourceGroupManager.DEFAULT_RESOURCE_GROUP_NAME))
Entity e = this.sceneMgr.CreateEntity("ogrehead", "ogrehead.mesh");

on this code

using (MaterialPtr mat = MaterialManager.Singleton.Create("Background", ResourceGroupManager.DEFAULT_RESOURCE_GROUP_NAME))
mat.GetTechnique(0).GetPass(0).DepthCheckEnabled = false;
mat.GetTechnique(0).GetPass(0).DepthWriteEnabled = false;
mat.GetTechnique(0).GetPass(0).LightingEnabled = false;

// Create background rectangle covering the whole screen
Rectangle2D rect = new Rectangle2D(true);
rect.SetCorners(0.0f, 0.0f, 0.0f, 0.0f);

// Render the background before everything else
rect.RenderQueueGroup = (byte)RenderQueueGroupID.RENDER_QUEUE_BACKGROUND;

// Use infinite AAB to always stay visible
AxisAlignedBox aab = new AxisAlignedBox();
rect.BoundingBox = aab;


It doesn't work. Background still white. Please tell me what is wrong.