AR with MOGRE
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.
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?
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 ?
can you post the errors you're getting?
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.
You have to convert the project to .Net 4.0.
Yep, that did it. THANKS
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.
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?
Yeah, as for Ogre dll-s everything is fine.
I did, i can run them.
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.
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.