3D getting started - jointed - movement - Kinect

Advanced game related topics
jesperbrannmark
Enthusiast
Enthusiast
Posts: 536
Joined: Mon Feb 16, 2009 10:42 am
Location: sweden
Contact:

3D getting started - jointed - movement - Kinect

Post by jesperbrannmark »

Hi. I worked with 2D graphics etc for 20 years but never plunged into 3D.. I think many people is in a somewhat similar situation as me.
I just got a XTION Pro (same as Microsoft Kinect) and got both the joint positions (X,Y,Z coordinates) and joint angles (leg sticking out 30 degrees forward etc).
I want to take the step and do some 3D games with a basic figure, something like http://www.turbosquid.com/FullPreview/I ... /ID/456757

I guess I have to look for models that are "rigged" - right? (so that means they have joints, so we don't move the entire leg away from the body or the leg becomes like jelly?)

Now is the next step, how will i get this .max format to a suitable PB format?

I have seen several samples with that animated roboguy that walks here but have no clue on how to control the joints (move leg up/out/left etc) - is this a simple task similar to just plugin the coordinates i get from the Xtion/Kinect?
Anyone have any good source samples to start with? Right now it feels like a task where I don't know how to go from here...

J
bmon
User
User
Posts: 54
Joined: Sat May 24, 2008 8:51 pm
Location: U.S.

Re: 3D getting started - jointed - movement - Kinect

Post by bmon »

Hi J ... If you wish to use the regular PureBasic's 3d engine then you need your models converted from an .xml format to a .mesh format using the free OgreXMLConverter.exe from Ogre's website. According to quick Google check, it looks like the .max is a proprietary(?) format used by 3d Max. If you don't own 3d Max then I'm not sure what else you could use to convert to .xml (assuming 3d Max can export to .xml). There are a TON of 3d model formats out there and it gets confusing very quickly. If you can find models in the DirectX format then it does make it a little easier. The DirectX format can contain the model/bones/animation/weighting all in one file. Personally here is my workflow ... Model and Animate in Animation:Master ... Export to DirectX using a plug-in (X not natively supported in Animation:Master) ... Export from Fragmotion as an .XML file ... Use the OgreXMLConverter to then convert to the .mesh format which you can use inside PureBasic.

The robot model, I believe, was created and animated in another program and then converted to work within PureBasic. I'm not sure that PureBasic can natively do something like selective limb/bone rotation. Check out these PB commands "AnimateEntity() and SetEntitiyAnimationTime() to control pre-existing animations that are loaded within the model. So if you are asking if you can load a model and then rotate an arm ? degrees on the Z axis then rotate it ? degrees on the Y axis, I don't believe that can be done natively .. yet. I'm not real familiar with the newest 3d features introduced with the 4.6 version, so perhaps things have changed. It seems that you need to create the animation elsewhere and then save it out within a model format that can then be converted.

Sorry but I know nothing about the Xtion/Kinect situation. If you are trying to create animations with this system and it can save the animation information as a .bvh file format then you can import that into another animation software package and assign that to an armature to replicate. There are SO many 3d file formats out there that it will make your head spin.

I'm NO expert when it comes to PureBasic, so if someone else wants to chime in an point out my misinformation then that would be helpful to me as well ...
Ramihyn_
Enthusiast
Enthusiast
Posts: 314
Joined: Fri Feb 24, 2006 9:40 am

Re: 3D getting started - jointed - movement - Kinect

Post by Ramihyn_ »

jesperbrannmark wrote:I want to take the step and do some 3D games with a basic figure, something like http://www.turbosquid.com/FullPreview/I ... /ID/456757

I guess I have to look for models that are "rigged" - right? (so that means they have joints, so we don't move the entire leg away from the body or the leg becomes like jelly?)

Now is the next step, how will i get this .max format to a suitable PB format?
Personally i use Ultimate Unwrap3D if i have to convert/edit different 3D formats. UU3D can read and write Ogre XML and 3ds max ascii formats. Once you have the model, you will need animations and a tool to edit/match your model rigs to the animations. The Ogre community should be the best source of informations to answer which tools, formats or workflow works best with Ogre3D.

Converting between formats, can often be a problem in itself. Thats why commercial sellers like Arteria, Dexsoft or 3DRT deliver models in a range of formats, rigged and including standard animations.
marc_256
Addict
Addict
Posts: 859
Joined: Thu May 06, 2010 10:16 am
Location: Belgium
Contact:

Re: 3D getting started - jointed - movement - Kinect

Post by marc_256 »

Hi jesperbrannmark,

After a long time of troubles and tests I do it this way now ...
See here http://www.purebasic.fr/english/viewtop ... t=+blender


1) I downloaded and installed Blender 2.49
2) I installed the Blender to Ogre3d exporter
3) I made a model in Blender 2.49 (modeler)
4) I export via OGRE export plugin to FileName.mesh.xml
5) Via OGRE XML Converter I convert to OGRE FileName.mesh
6) I start PB and load the ogre program.
7) I convert the XML file to Data in PB program so I can use it as ONE file.

You can see some results here ...
http://www.marc-systems.be/pvg-3dstudio ... allery.htm


PS: OGRE can handle bones and motion control but I do not know PB can ?


Marc,
- every professional was once an amateur - greetings from Pajottenland - Belgium -
PS: sorry for my english I speak flemish ...
PMV
Enthusiast
Enthusiast
Posts: 727
Joined: Sat Feb 24, 2007 3:15 pm
Location: Germany

Re: 3D getting started - jointed - movement - Kinect

Post by PMV »

marc_256 wrote: PS: OGRE can handle bones and motion control but I do not know PB can ?
look at: AnimateEntity(), EntityAnimationLength(), GetEntityAnimationTime(), SetEntityAnimationTime()
jesperbrannmark
Enthusiast
Enthusiast
Posts: 536
Joined: Mon Feb 16, 2009 10:42 am
Location: sweden
Contact:

Re: 3D getting started - jointed - movement - Kinect

Post by jesperbrannmark »

AnimateEntity()

Syntax

AnimateEntity(#Entity, Name$)
Description
Changes the current animation with the specified one, and start it. Entity uses the mesh animation (skeletons based, using bones) format.

Note: the "Name$" parameter is case-sensitive, which means than "Walk" will be different than "walk" for example.
Doesnt that mean that we can just animate "walk" in blender and then use "walk". If we want left leg sticking out 45 degrees and right arm 10 degrees out from body - we cant do that if it isnt already done before as a pre defined animation... or ?
Is it possible to change a figure dynamic according to coordinates or do we need to predefine everything as in a static animation?
PMV
Enthusiast
Enthusiast
Posts: 727
Joined: Sat Feb 24, 2007 3:15 pm
Location: Germany

Re: 3D getting started - jointed - movement - Kinect

Post by PMV »

jesperbrannmark wrote:Doesnt that mean that we can just animate "walk" in blender and then use "walk". If we want left leg sticking out 45 degrees and right arm 10 degrees out from body - we cant do that if it isnt already done before as a pre defined animation... or ?
Is it possible to change a figure dynamic according to coordinates or do we need to predefine everything as in a static animation?
Thats it ... you can't create animations programatically at runtime ...
any animation used in PB with OGRE needs to be predefined. I doesn't
have used animation with OGRE yet, so i don't know what OGRE really
provides ... but you could make a feature request for this. :)

MFG PMV
jesperbrannmark
Enthusiast
Enthusiast
Posts: 536
Joined: Mon Feb 16, 2009 10:42 am
Location: sweden
Contact:

Re: 3D getting started - jointed - movement - Kinect

Post by jesperbrannmark »

Hmmm. too me something like this http://www.youtube.com/watch?v=JQvLt7DQhaI sound like something that should be pretty basic. I might be extremely wrong, but there must be a way to do this in PB - right.. Purebasic is a very far developed language for 3D..
PMV
Enthusiast
Enthusiast
Posts: 727
Joined: Sat Feb 24, 2007 3:15 pm
Location: Germany

Re: 3D getting started - jointed - movement - Kinect

Post by PMV »

as my understanding, moving of every bones like that is far away from "basic"
you really can't do that in PB-OGRE yet. You can just provide all possible moves
and animate them at given time, to show what the player is needed to do or
has done ... but you can't represent the exact movements of the player. Hm,
You could make a single animation for every bone ... and animate them all
at the same time :lol: But it will not look that good.

The biggest problem of PB with 3D (and me is), that it doesn't support native
DLLs with classes (COM, Object-DLLs or what it is called) With that we could
implement every 3D-Engine at our own without a Wrapper ... beginning
with original OGRE3D :lol:

MFG PMV
marc_256
Addict
Addict
Posts: 859
Joined: Thu May 06, 2010 10:16 am
Location: Belgium
Contact:

Re: 3D getting started - jointed - movement - Kinect

Post by marc_256 »

Hmmm. too me something like this http://www.youtube.com/watch?v=JQvLt7DQhaI sound like something that should be pretty basic. I might be extremely wrong, but there must be a way to do this in PB - right.. Purebasic is a very far developed language for 3D..
For this,
1) You need first at all some cameras 2...4 (may be B&W).
2) Special clothings with Reference points on it.
3) Software to detect the motions (via Ref. points).
4) Interface/transfer (in real time) the data to PB > OGRE3D.
5) Show the images on the screen

OR
1) A kinect interface
2) Interface/transfer (in real time) the data to PB > OGRE3D.
3) Show the images on the screen

Purebasic is a very far developed language for 3D..
Yes, but it haves some limits...in the OGRE3D interface.


Marc
- every professional was once an amateur - greetings from Pajottenland - Belgium -
PS: sorry for my english I speak flemish ...
jesperbrannmark
Enthusiast
Enthusiast
Posts: 536
Joined: Mon Feb 16, 2009 10:42 am
Location: sweden
Contact:

Re: 3D getting started - jointed - movement - Kinect

Post by jesperbrannmark »

I have all steps except
X) Interface/transfer (in real time) the data to PB > OGRE3D.
Y) Show the images on the screen
With Kinect - real simple. With infrared tracking also pretty easy its just analyze a 2D image (although kinect is depth sensitive so it can give you 3D position).

But it seems impossible to do X and Y here...
IdeasVacuum
Always Here
Always Here
Posts: 6426
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: 3D getting started - jointed - movement - Kinect

Post by IdeasVacuum »

I am not a games programmer but there are a couple things I can contribute to the cause:

1) Beware of limitations:
http://www.purebasic.fr/english/viewtop ... 16&t=40597

2) deepMesh3D Modeller by Innesoft, is written in PB. It could be an ideal solution for your project:
http://www.purebasic.fr/english/viewtop ... 14&t=46115
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
Post Reply