NxOgre and ARToolkit

zolver

12-12-2010 22:20:34

Dear Betajaen and all of the members in this forum.

I wanna make Augmented Reality application using NxOgre and ARToolkit. Can anyone show me the direction to do it?
Thanks a lot before.

betajaen

13-12-2010 09:19:28

I had to google ARToolkit to find out what it was. So I'm not much any help, but if you need help to any specific questions or problems. I'm willing into answer.

zolver

14-12-2010 08:46:32

I've develop Augmented Reality (AR) application by ARToolkit with OGRE. It's my snippet of code

class SampleListener : public ExampleFrameListener
{
private:

Ogre::SceneNode *mNode;
Ogre::Real mTime;

.................................

public:
SampleListener(RenderWindow* win, Camera* cam, SceneManager* scene)
: ExampleFrameListener(win, cam)
{
............................................



I use it to draw an object in OGRE.

Ogre::Entity *ninja = scene->createEntity("Penguin","cube.1m.mesh");
mNode = scene->getRootSceneNode()->createChildSceneNode("cube");
mNode -> scale ( 10 , 10 , 10 ) ;
mNode->attachObject(ninja);

..................................
}

bool frameStarted(const FrameEvent& evt)
{
.....................................

Ogre::Vector3 position = Ogre::Vector3(patt_trans[0][3], -patt_trans[1][3], -patt_trans[2][3]);

Ogre::Vector3 x = Ogre::Vector3(patt_trans[0][0], -patt_trans[1][0], -patt_trans[2][0]);
Ogre::Vector3 y = Ogre::Vector3(patt_trans[0][1], -patt_trans[1][1], -patt_trans[2][1]);
Ogre::Vector3 z = Ogre::Vector3(patt_trans[0][2], -patt_trans[1][2], -patt_trans[2][2]);
Ogre::Quaternion orientation = Ogre::Quaternion(x.normalisedCopy(), y.normalisedCopy(), z.normalisedCopy());


Then use it to display that object (in OGRE) appear in webcam.


Ogre::Quaternion putar = Ogre::Quaternion(Ogre::Radian(Ogre::Degree(90)), Ogre::Vector3::UNIT_X);

mNode->setOrientation(orientation * putar);
mNode->setPosition(position);
mNode->setVisible(true);

return true;

}
.........................


I interest to display objcet like in NxOgre Tutorials - 111 - Dynamic CCD.
How I can do it?

thanks a lot

deshan

15-12-2010 20:27:38

Hi
Pleas see here
http://www.visual-experiments.com/demos ... or-ogre3d/

A downloadable Working example is available. Once you manage to run the project adding nxogre is nothing different.