I am a new comer and learning irrlicht engine now.
I want to build a 2d navigation map throught a 3d scene!
------------------------------------------------------------------------------------
I MEAN,first load a 3d scene then generate a 2d navigation map(Bird Eye View Map) ,automatically.
------------------------------------------------------------------------------------
How to do that?
Thank you very much!
Create a 2d navigation map
Create a 2d navigation map
Last edited by ansonbx on Wed Dec 09, 2009 3:37 pm, edited 1 time in total.
-
- Competition winner
- Posts: 167
- Joined: Sun Jul 19, 2009 11:27 am
- Location: the Netherlands
- Contact:
Maybe you can take a look at this.
http://irrlicht.sourceforge.net/phpBB2/ ... ght=compas
http://irrlicht.sourceforge.net/phpBB2/ ... ght=compas
Thanks all the same!Although,it is not the wanted answer!Escen wrote:Maybe you can take a look at this.
http://irrlicht.sourceforge.net/phpBB2/ ... ght=compas
-
- Competition winner
- Posts: 167
- Joined: Sun Jul 19, 2009 11:27 am
- Location: the Netherlands
- Contact:
first option:I MEAN,first load a 3d scene then generate a 2d navigation map(Bird Eye View Map) ,automatically.
If you want realtime camera view you can use a SplitScreen.
The image is rendered for every viewport seperately. That means, that you'll loose performance.
Take a look at the SplitScreen example and replace this code part:
Code: Select all
driver->beginScene(true,true,SColor(255,100,100,100));
smgr->drawAll();
//If SplitScreen is used
if (SplitScreen)
{
driver->clearZBuffer();
//Activate camera1
smgr->setActiveCamera(camera[1]);
//Set viewpoint to the first quarter (left top)
driver->setViewPort(rect<s32>(0,0,ResX/2,ResY/2));
//Draw scene
smgr->drawAll();
//return viewport fullscreen
driver->setViewPort(rect<s32>(0,0,ResX,ResY));
}
driver->endScene();
second option:
If a more static overview is desired you can render a 2d map on screen, render single time.
define a texture:
Code: Select all
video::ITexture* rt = 0;
rt = driver->addRenderTargetTexture(core::dimension2d<u32>(256,256), "RTT1");
In this code we only create the texture ones by turning off SplitScreen after the first render, just to keep example code simple.
Code: Select all
driver->beginScene(true,true,SColor(255,100,100,100));
smgr->setActiveCamera(camera[3]);
//Draw scene
smgr->drawAll();
//If SplitScreen is used
if (SplitScreen)
{
//Activate camera1
smgr->setActiveCamera(camera[1]);
driver->setRenderTarget(rt, true, true, video::SColor(0,0,0,255));
smgr->drawAll();
driver->setRenderTarget(0, true, true, 0);
SplitScreen=false;
}
driver->draw2DImage(rt,vector2di(0,0),rect<s32> (0,0, 256, 256), 0);
driver->endScene();
-
- Posts: 26
- Joined: Mon Jan 04, 2010 8:02 pm
is this not just an issue of rotating the camera (which btw should have an absolute function just for things like this! and yes I am writing one)
once absolute camera rotation is achieved then it should be very easy because you would just rotate looking at y at 90degrees
once absolute camera rotation is achieved then it should be very easy because you would just rotate looking at y at 90degrees
Remember all information is contextual and if I do not understand the context I cannot gras the information