Web Toolbar by Wibiya

Ogre3D + Kinect


A place to ask questions or discuss issues relating to implementing applications with Axiom. If you are unsure of where to post, post here.

User avatar

Team Member
Team Member

Posts: 1591

Joined: Thu Mar 02, 2006 11:29 pm

Location: Boston, MA, USA

Post Tue Dec 14, 2010 5:13 am

Ogre3D + Kinect

For those of you monitoring the OpenKinect/OpenNI internete traffic, this is a very cool video to watch!


http://youtu.be/O6xdopI9su4
Borrillis
The Steward of Axiom

Passer-by

Posts: 4

Joined: Sun Dec 12, 2010 10:51 pm

Post Tue Dec 14, 2010 7:10 pm

Re: Ogre3D + Kinect

Very cool indeed!!

Regular

Posts: 21

Joined: Tue Dec 08, 2009 6:40 am

Post Fri Dec 31, 2010 5:05 am

Re: Ogre3D + Kinect

Hi Everyone,
Anyone attempted to port the example yet?
  Code:
https://github.com/OpenNI/SampleAppSinbad/blob/master/Character/include/SinbadCharacterController.h

void setupAnimations()
   {
      // this is very important due to the nature of the exported animations
      mBodyEnt->getSkeleton()->setBlendMode(ANIMBLEND_CUMULATIVE);   

      String animNames[] =
      {"IdleBase", "IdleTop", "RunBase", "RunTop", "HandsClosed", "HandsRelaxed", "DrawSwords",
      "SliceVertical", "SliceHorizontal", "Dance", "JumpStart", "JumpLoop", "JumpEnd"};

      //set all to manualy controlled
      //Ogre::Bone* handleLeft = mBodyEnt->getSkeleton()->getBone("Hand.L");
      //handleLeft->setManuallyControlled(true);

      //rotate the body
      //mBodyNode->yaw(Degree(0),Node::TransformSpace::TS_WORLD);

      Skeleton* skel = mBodyEnt->getSkeleton();

      Ogre::Skeleton::BoneIterator bi = skel->getBoneIterator();

      // populate our animation list
      for (int i = 0; i < NUM_ANIMS; i++)
      {
         mAnims[i] = mBodyEnt->getAnimationState(animNames[i]);
         mAnims[i]->setLoop(true);
         mFadingIn[i] = false;
         mFadingOut[i] = false;

         // disable animation updates
         Animation* anim = mBodyEnt->getSkeleton()->getAnimation(animNames[i]);

         anim->destroyNodeTrack(mBodyEnt->getSkeleton()->getBone("Ulna.L")->getHandle());
         anim->destroyNodeTrack(mBodyEnt->getSkeleton()->getBone("Ulna.R")->getHandle());
         anim->destroyNodeTrack(mBodyEnt->getSkeleton()->getBone("Humerus.L")->getHandle());
         anim->destroyNodeTrack(mBodyEnt->getSkeleton()->getBone("Humerus.R")->getHandle());
         anim->destroyNodeTrack(mBodyEnt->getSkeleton()->getBone("Stomach")->getHandle());
         anim->destroyNodeTrack(mBodyEnt->getSkeleton()->getBone("Chest")->getHandle());
         anim->destroyNodeTrack(mBodyEnt->getSkeleton()->getBone("Thigh.L")->getHandle());
         anim->destroyNodeTrack(mBodyEnt->getSkeleton()->getBone("Thigh.R")->getHandle());
         anim->destroyNodeTrack(mBodyEnt->getSkeleton()->getBone("Calf.L")->getHandle());
         anim->destroyNodeTrack(mBodyEnt->getSkeleton()->getBone("Calf.R")->getHandle());
         anim->destroyNodeTrack(mBodyEnt->getSkeleton()->getBone("Root")->getHandle());
      }

      // start off in the idle state (top and bottom together)
      setBaseAnimation(ANIM_IDLE_BASE);
      setTopAnimation(ANIM_IDLE_TOP);

      // relax the hands since we're not holding anything
      mAnims[ANIM_HANDS_RELAXED]->setEnabled(true);

      mSwordsDrawn = false;
   }


I took the Sinbad Sample from Axiom3D and just modify the SetupAnimation method in it but this end up in a distorted Sinbad figure

This is my first attempt to port Ogre c++ sample to Axiom, so I am not sure if there is something special I need to follow.
Thanks.
  Code:
               //Ogre::Matrix3 mat;
      Ogre::Quaternion q = Quaternion::IDENTITY;
      Quaternion q2,q3;
      Vector3 xAxis,yAxis,zAxis;
      q.FromAngleAxis(Ogre::Degree(90),Vector3(0,0,-1));
      q.ToAxes(xAxis,yAxis,zAxis);
      q2.FromAngleAxis(Ogre::Degree(90),xAxis);
      setupBone("Humerus.L",q*q2);
      q.FromAngleAxis(Ogre::Degree(90),Vector3(0,0,1));
      q.ToAxes(xAxis,yAxis,zAxis);
      q2.FromAngleAxis(Ogre::Degree(90),xAxis);
      setupBone("Humerus.R",q*q2);

      q.FromAngleAxis(Ogre::Degree(90),Vector3(0,0,-1));   
      q2.FromAngleAxis(Ogre::Degree(45),Vector3(0,-1,0));

      setupBone("Ulna.L",q*q2);

      q.FromAngleAxis(Ogre::Degree(90),Vector3(0,0,1));       
      setupBone("Ulna.R",q*q2.Inverse());

      q.FromAngleAxis(Ogre::Degree(180),Vector3(0,1,0));
      setupBone("Chest",q);
      setupBone("Stomach",q);
      q.FromAngleAxis(Ogre::Degree(180),Vector3(1,0,0));       
      q2.FromAngleAxis(Ogre::Degree(180),Vector3(0,1,0));
      setupBone("Thigh.L",q*q2);
      setupBone("Thigh.R",q*q2);
      setupBone("Calf.L",q*q2);
      setupBone("Calf.R",q*q2);
      setupBone("Root",Degree(0),Degree(0),Degree(0));

Regular

Posts: 21

Joined: Tue Dec 08, 2009 6:40 am

Post Fri Dec 31, 2010 5:05 am

Re: Ogre3D + Kinect

Hi Everyone,
Anyone attempted to port the example yet?
  Code:
https://github.com/OpenNI/SampleAppSinbad/blob/master/Character/include/SinbadCharacterController.h

void setupAnimations()
   {
      // this is very important due to the nature of the exported animations
      mBodyEnt->getSkeleton()->setBlendMode(ANIMBLEND_CUMULATIVE);   

      String animNames[] =
      {"IdleBase", "IdleTop", "RunBase", "RunTop", "HandsClosed", "HandsRelaxed", "DrawSwords",
      "SliceVertical", "SliceHorizontal", "Dance", "JumpStart", "JumpLoop", "JumpEnd"};

      //set all to manualy controlled
      //Ogre::Bone* handleLeft = mBodyEnt->getSkeleton()->getBone("Hand.L");
      //handleLeft->setManuallyControlled(true);

      //rotate the body
      //mBodyNode->yaw(Degree(0),Node::TransformSpace::TS_WORLD);

      Skeleton* skel = mBodyEnt->getSkeleton();

      Ogre::Skeleton::BoneIterator bi = skel->getBoneIterator();

      // populate our animation list
      for (int i = 0; i < NUM_ANIMS; i++)
      {
         mAnims[i] = mBodyEnt->getAnimationState(animNames[i]);
         mAnims[i]->setLoop(true);
         mFadingIn[i] = false;
         mFadingOut[i] = false;

         // disable animation updates
         Animation* anim = mBodyEnt->getSkeleton()->getAnimation(animNames[i]);

         anim->destroyNodeTrack(mBodyEnt->getSkeleton()->getBone("Ulna.L")->getHandle());
         anim->destroyNodeTrack(mBodyEnt->getSkeleton()->getBone("Ulna.R")->getHandle());
         anim->destroyNodeTrack(mBodyEnt->getSkeleton()->getBone("Humerus.L")->getHandle());
         anim->destroyNodeTrack(mBodyEnt->getSkeleton()->getBone("Humerus.R")->getHandle());
         anim->destroyNodeTrack(mBodyEnt->getSkeleton()->getBone("Stomach")->getHandle());
         anim->destroyNodeTrack(mBodyEnt->getSkeleton()->getBone("Chest")->getHandle());
         anim->destroyNodeTrack(mBodyEnt->getSkeleton()->getBone("Thigh.L")->getHandle());
         anim->destroyNodeTrack(mBodyEnt->getSkeleton()->getBone("Thigh.R")->getHandle());
         anim->destroyNodeTrack(mBodyEnt->getSkeleton()->getBone("Calf.L")->getHandle());
         anim->destroyNodeTrack(mBodyEnt->getSkeleton()->getBone("Calf.R")->getHandle());
         anim->destroyNodeTrack(mBodyEnt->getSkeleton()->getBone("Root")->getHandle());
      }

      // start off in the idle state (top and bottom together)
      setBaseAnimation(ANIM_IDLE_BASE);
      setTopAnimation(ANIM_IDLE_TOP);

      // relax the hands since we're not holding anything
      mAnims[ANIM_HANDS_RELAXED]->setEnabled(true);

      mSwordsDrawn = false;
   }


I took the Sinbad Sample from Axiom3D and just modify the SetupAnimation method in it but this end up in a distorted Sinbad figure

This is my first attempt to port Ogre c++ sample to Axiom, so I am not sure if there is something special I need to follow.
Thanks.
  Code:
               //Ogre::Matrix3 mat;
      Ogre::Quaternion q = Quaternion::IDENTITY;
      Quaternion q2,q3;
      Vector3 xAxis,yAxis,zAxis;
      q.FromAngleAxis(Ogre::Degree(90),Vector3(0,0,-1));
      q.ToAxes(xAxis,yAxis,zAxis);
      q2.FromAngleAxis(Ogre::Degree(90),xAxis);
      setupBone("Humerus.L",q*q2);
      q.FromAngleAxis(Ogre::Degree(90),Vector3(0,0,1));
      q.ToAxes(xAxis,yAxis,zAxis);
      q2.FromAngleAxis(Ogre::Degree(90),xAxis);
      setupBone("Humerus.R",q*q2);

      q.FromAngleAxis(Ogre::Degree(90),Vector3(0,0,-1));   
      q2.FromAngleAxis(Ogre::Degree(45),Vector3(0,-1,0));

      setupBone("Ulna.L",q*q2);

      q.FromAngleAxis(Ogre::Degree(90),Vector3(0,0,1));       
      setupBone("Ulna.R",q*q2.Inverse());

      q.FromAngleAxis(Ogre::Degree(180),Vector3(0,1,0));
      setupBone("Chest",q);
      setupBone("Stomach",q);
      q.FromAngleAxis(Ogre::Degree(180),Vector3(1,0,0));       
      q2.FromAngleAxis(Ogre::Degree(180),Vector3(0,1,0));
      setupBone("Thigh.L",q*q2);
      setupBone("Thigh.R",q*q2);
      setupBone("Calf.L",q*q2);
      setupBone("Calf.R",q*q2);
      setupBone("Root",Degree(0),Degree(0),Degree(0));
User avatar

Team Member
Team Member

Posts: 1591

Joined: Thu Mar 02, 2006 11:29 pm

Location: Boston, MA, USA

Post Fri Dec 31, 2010 8:41 am

Re: Ogre3D + Kinect

The Sample can't be ported yet due to a lack of bindings. The PrimeSense bindings for their NITE middleware is incomplete. Rumor has it they are planning a better set of bindings for the next release, but there isn't any date for that yet.
Borrillis
The Steward of Axiom

Return to General Q & A

Who is online

Users browsing this forum: Google [Bot] and 1 guest

cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.