IrrAR - Irrlicht and Augmented Reality

Announce new projects or updates of Irrlicht Engine related tools, games, and applications.
Also check the Wiki
magichere
Posts: 1
Joined: Sun Dec 28, 2008 1:40 am

Re: IrrAR - Irrlicht and Augmented Reality

Post by magichere »

IParticleSystemSceneNode is disappear in the irrar

This is the sample from irrar , I want to add a IParticleSystemSceneNode to the object . But it`s not show . I don`t know why , can FreakNigh fix it ?
//////***************************************/
scene::IParticleSystemSceneNode* ps = smgr->addParticleSystemSceneNode(
false);
ps->setParticleSize(core::dimension2d<f32>(
/*20.0f, 10.0f*/ 22.5f,12.5f));

scene::IParticleAffector* paf =ps->createFadeOutParticleAffector();
ps->addAffector(paf);
paf->drop();

ps->setMaterialFlag(video::EMF_LIGHTING, false);
ps->setMaterialTexture(0,driver->getTexture("media/fire.jpg"));
ps->setMaterialType(video::EMT_TRANSPARENT_VERTEX_ALPHA);

scene::IParticleEmitter* em = ps->createBoxEmitter(
core::aabbox3d<f32>(-7,0,-7,7,1,7), //box
/*core::vector3df(0.0f,0.03f,0.0f)*/
core::vector3df(0.0f,0.03f,0.0f),//direction
80,//minParticlesPerSecond
100,//maxParticlesPerSecond
video::SColor(0,255,255,255),//minStartColor
video::SColor(0,255,255,255),//maxStartColor
800,//life time min
2000, //life time max
0 //max angle degrees
);

ps->setEmitter(em);
em->drop();

ps->setScale(core::vector3df(
20,
20,
20));


//camera stuff
vector3df camera_pos = vector3df(0,0,0);
vector3df camera_target = vector3df(0,0,1);
ICameraSceneNode* camera = smgr->addCameraSceneNode(0, camera_pos, camera_target);

//AR stuff
IARManager* armgr = new IARManager(device);
//init the camera
armgr->beginCamera("ardata/camera_para.dat","ardata/WDM_camera_flipV.xml");
//node for the lady, attached the the hiro pattern
ISceneNode* hiro_node = armgr->addARSceneNode("ardata/patt.hiro", node);
//node for the fairy, attached the the sample1 pattern
ISceneNode* sample1_node = armgr->addARSceneNode("ardata/patt.sample1", fairy);
//attach a particle to the node more children to our nodes
sample1_node->addChild(ps);
sample1_node->addChild(light_node);
hiro_node->addChild(light_node2);
sample1_node->addChild(light_node3);
hiro_node->addChild(light_node4);
//now fix our camera to display right
armgr->fixCamera(camera);
FreakNigh
Posts: 122
Joined: Thu Oct 19, 2006 7:31 am
Location: Orlando FL, USA
Contact:

Post by FreakNigh »

I dunno it's kind of been awhile, I've been working mostly on my SDL based game refining it for noob to player conversion since I started my advertising campaign.. The second version of my game will be in irrlicht..
Image

CvIrrCamController - 3D head tracking lib to create window effect with webcam
IrrAR - Attach Irrlicht nodes to real life markers
http://www.nighsoft.com/
kane7777
Posts: 1
Joined: Thu Nov 26, 2009 1:46 am

Particles "disappears" in Irrar

Post by kane7777 »

Hi,

I am also having trouble displaying the particles system in Irrar. I think it has something to do with the projection_matrix. Whenever i comment away the "fixcamera" function i could see the particles but the models' position and orientation will go haywire.

Any help please? Any help will be greatly appreciated!!!
afecelis
Admin
Posts: 3075
Joined: Sun Feb 22, 2004 10:44 pm
Location: Colombia
Contact:

Post by afecelis »

Hi everyone, late happy new year! ;)
FreakNigh, I just retook working with your library and I was trying to get it to work with the latest 1.6-SVN, however I got some compile errors because of changes between Irrlicht's 1.4.1 code used for Irrar and the actual version.
Have you or anyone treid updating it?
Also, can a .irr scene be loaded? Is there a way to assign a node to an irr scene to load it? (like the ones you assign to meshes directly). Loading irr scenes would allow mixing several elements at the same time (animators, particles, meshes, etc) and simplify things a lot. ;)

Anyway, I went back to devc++ with the 1.4.1 irrlicht devpak to get things working, but it would be great to update it to the latest version. I'll try to post the error I got before downgrading.

regards,
Alvaro
Image
sprocket
Posts: 9
Joined: Thu Jan 07, 2010 1:07 pm

Post by sprocket »

FreakNigh, I just retook working with your library and I was trying to get it to work with the latest 1.6-SVN, however I got some compile errors because of changes between Irrlicht's 1.4.1 code used for Irrar and the actual version.
Have you or anyone treid updating it?
Irrar compiles and runs with irrlicht 1.7 with some small changes. Should be easy if you follow the errors. I can't remember what changes i did but i can look at this again if you still having trouble with this afecelis.
I am also having trouble displaying the particles system in Irrar. I think it has something to do with the projection_matrix. Whenever i comment away the "fixcamera" function i could see the particles but the models' position and orientation will go haywire.
I think this is actually a problem in rendering billboards in general and yes it is a missing transformation in the projection_matrix.

Adding this code:

Code: Select all

  for(i = 0; i < 4; i++)
      icpara[1][i] = height*icpara[2][i] - icpara[1][i];
after this:

Code: Select all

	if( arParamDecompMat(cparam, icpara, trans) < 0 ) 
	{
		printf("gConvGLcpara: Parameter error!!\n");
		exit(0);
	}
in irrAR.cpp should solve the issue but it will mirror the webcam image in the background.
Replacing this:

Code: Select all

driver->draw2DImage(this->cam_texture, rect<s32>(0,0,scrn_size.Width,scrn_size.Height), rect<s32>(0,0,img_size.Width,img_size.Height));
whit this:

Code: Select all

driver->draw2DImage(this->cam_texture, rect<s32>(0,0,scrn_size.Width,scrn_size.Height), rect<s32>(0,img_size.Height,img_size.Width,0));
should solve this too

FreakNigh is using addTexture for the camera image and lock()/unlock() to update the texture per frame. I think i saw somewhere in irrlicht forums that addRenderTargetTexture should be used in similar occasions because it is modified for multiple locks/unlocks. I tried that but i can not see any performance improvement. I think that this also has to do with the limited fps of my webcam.

Afecelis are you an architect too? If you are, i can see why you are interested in this project ;)
narugohan
Posts: 6
Joined: Sat Feb 06, 2010 6:59 pm

Post by narugohan »

i have a small problem ^^

Code: Select all

Compilateur: Default compiler
Building Makefile: "C:\Users\Narugohan\Documents\C++\irrAR-0.3\Makefile.win"
Exécution de  make...
make.exe -f "C:\Users\Narugohan\Documents\C++\irrAR-0.3\Makefile.win" all
g++.exe irrAR.o test.o  -o "test_irrAR.exe" -L"C:/Dev-Cpp/lib" ARToolKit/lib/libAR.lib ARToolKit/lib/libARMulti.lib ARToolKit/lib/libARvideo.lib irrlicht-1.4.1/irrlicht-1.4.1/lib/Win32-gcc/libIrrlicht.a  

Warning: .drectve `/DEFAULTLIB:"LIBCMT" /DEFAULTLIB:"OLDNAMES" ' unrecognized
Warning: .drectve `/DEFAULTLIB:"LIBCMT" /DEFAULTLIB:"OLDNAMES" ' unrecognized
Warning: .drectve `/DEFAULTLIB:"LIBCMT" /DEFAULTLIB:"OLDNAMES" ' unrecognized
Warning: .drectve `/DEFAULTLIB:"LIBCMT" /DEFAULTLIB:"OLDNAMES" ' unrecognized
Warning: .drectve `/DEFAULTLIB:"LIBCMT" /DEFAULTLIB:"OLDNAMES" ' unrecognized
Warning: .drectve `/DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"LIBCMT" /DEFAULTLIB:"OLDNAMES" ' unrecognized
Warning: .drectve `/DEFAULTLIB:"LIBCMT" /DEFAULTLIB:"OLDNAMES" ' unrecognized
Warning: .drectve `/DEFAULTLIB:"LIBCMT" /DEFAULTLIB:"OLDNAMES" ' unrecognized
Warning: .drectve `/DEFAULTLIB:"LIBCMT" /DEFAULTLIB:"OLDNAMES" ' unrecognized
Warning: .drectve `/DEFAULTLIB:"LIBCMT" /DEFAULTLIB:"OLDNAMES" ' unrecognized
Warning: .drectve `/DEFAULTLIB:"LIBCMT" /DEFAULTLIB:"OLDNAMES" ' unrecognized
Warning: .drectve `/DEFAULTLIB:"LIBCMT" /DEFAULTLIB:"OLDNAMES" ' unrecognized
Warning: .drectve `/DEFAULTLIB:"LIBCMT" /DEFAULTLIB:"OLDNAMES" ' unrecognized
Warning: .drectve `/DEFAULTLIB:"LIBCMT" /DEFAULTLIB:"OLDNAMES" ' unrecognized
Warning: .drectve `/DEFAULTLIB:"LIBCMT" /DEFAULTLIB:"OLDNAMES" ' unrecognized
Warning: .drectve `/DEFAULTLIB:"LIBCMT" /DEFAULTLIB:"OLDNAMES" ' unrecognized
Warning: .drectve `/DEFAULTLIB:"LIBCMT" /DEFAULTLIB:"OLDNAMES" ' unrecognized
Warning: .drectve `/DEFAULTLIB:"LIBCMT" /DEFAULTLIB:"OLDNAMES" ' unrecognized
Warning: .drectve `/DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"LIBCMT" /DEFAULTLIB:"OLDNAMES" ' unrecognized
Warning: .drectve `/DEFAULTLIB:"LIBCMT" /DEFAULTLIB:"OLDNAMES" ' unrecognized
Warning: .drectve `/DEFAULTLIB:"LIBCMT" /DEFAULTLIB:"OLDNAMES" ' unrecognized
Warning: .drectve `/DEFAULTLIB:"LIBCMT" /DEFAULTLIB:"OLDNAMES" ' unrecognized
Warning: .drectve `/DEFAULTLIB:"LIBCMT" /DEFAULTLIB:"OLDNAMES" ' unrecognized
Warning: .drectve `/DEFAULTLIB:"LIBCMT" /DEFAULTLIB:"OLDNAMES" ' unrecognized
Warning: .drectve `/DEFAULTLIB:"LIBCMT" /DEFAULTLIB:"OLDNAMES" ' unrecognized
Warning: .drectve `/DEFAULTLIB:"LIBCMT" /DEFAULTLIB:"OLDNAMES" ' unrecognized
Warning: .drectve `/DEFAULTLIB:"LIBCMT" /DEFAULTLIB:"OLDNAMES" ' unrecognized
Warning: .drectve `/DEFAULTLIB:"LIBCMT" /DEFAULTLIB:"OLDNAMES" ' unrecognized
Warning: .drectve `/DEFAULTLIB:"LIBCMT" /DEFAULTLIB:"OLDNAMES" ' unrecognized
ARToolKit/lib/libAR.lib(./Release/arGetCode.obj)(.text[_arGetPatt]+0xff):.\arGetCode.c: undefined reference to `_ftol2'
ARToolKit/lib/libAR.lib(./Release/arGetCode.obj)(.text[_arGetPatt]+0x124):.\arGetCode.c: undefined reference to `_ftol2'
ARToolKit/lib/libAR.lib(./Release/arGetCode.obj)(.text[_arGetPatt]+0x149):.\arGetCode.c: undefined reference to `_ftol2'
ARToolKit/lib/libAR.lib(./Release/arGetCode.obj)(.text[_arGetPatt]+0x16e):.\arGetCode.c: undefined reference to `_ftol2'
ARToolKit/lib/libAR.lib(./Release/arGetCode.obj)(.text[_arGetPatt]+0x367):.\arGetCode.c: undefined reference to `_ftol2'
ARToolKit/lib/libAR.lib(./Release/arGetCode.obj)(.text[_arGetPatt]+0x38d):.\arGetCode.c: more undefined references to `_ftol2' follow
collect2: ld returned 1 exit status

make.exe: *** [test_irrAR.exe] Error 1

Exécution terminée
Can you help me please ??!
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Don't use MSVC makefiles with gcc.
narugohan
Posts: 6
Joined: Sat Feb 06, 2010 6:59 pm

Post by narugohan »

I don't use MSVC, I use Dev-C++, and use g++.
I'm sorry if I make faults, because I'm french :p, but what can i do for my problems ? i would like to use this library^^
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Well, easiest way would be to use MSVC :wink: Otherwise you need to use a different Makfile, or write your own project file.
narugohan
Posts: 6
Joined: Sat Feb 06, 2010 6:59 pm

Post by narugohan »

I can not with MSVC, so can you explain me what can i do for the methods others, please because I don't know to do
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

No sorry, I cannot tell you how to use your IDE. But there are probably tutorials for this on the web. BTW: MSVC is available for free, I guess you could use it...
narugohan
Posts: 6
Joined: Sat Feb 06, 2010 6:59 pm

Post by narugohan »

I managed to compile with MSVC. Everything works, but, when the webcam sees the pattern, she modifies the background, but when she doesn't see, she doesn't modifies.
One idea ?
sprocket
Posts: 9
Joined: Thu Jan 07, 2010 1:07 pm

Post by sprocket »

narugohan wrote:I managed to compile with MSVC. Everything works, but, when the webcam sees the pattern, she modifies the background, but when she doesn't see, she doesn't modifies.
One idea ?
You need to be more specific to get help.
What exactly do you mean by "modifies the background"?
Are you using irrlicht 1.4.1?
Have you made any changes in the IrrAR code?
You use opengl or d3d?
narugohan
Posts: 6
Joined: Sat Feb 06, 2010 6:59 pm

Post by narugohan »

I'm using irrlicht 1.6, OpenGL. I haven't made a change the irrAR code.
I see webcam images change when the program detect a pattern, else, she doesn't change.

PS : i am making a video for that you see

http://www.youtube.com/watch?v=GnNYCSlx ... tube_gdata
sprocket
Posts: 9
Joined: Thu Jan 07, 2010 1:07 pm

Post by sprocket »

Try this one:
Download the Artoolkit devpack for Dev-C++ from here:
http://pegasus.cc.ucf.edu/~mi872775/fil ... 2.1.DevPak
Install the devpack
Use a clean version of IrrAR (with no changes at all)
Open the IrrAR Dev-C++ project file
Change only what is necessary to make the project compile
Post Reply