I'd like to add fbx support.

Discuss about anything related to the Irrlicht Engine, or read announcements about any significant features or usage changes.
JoshM
Posts: 28
Joined: Thu Apr 30, 2009 9:00 pm
Location: Salt Lake City, Utah

Post by JoshM »

Hybrid, or Blindside, any ideas on my previous post? I've kind of hit a brick wall on this part.

JoshM
BlindSide
Admin
Posts: 2821
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Post by BlindSide »

I would say get the ASCII loader working before worrying about that stuff. Focusing on the binary format is gonna give you unnecessary troubles.

Good news, I found a very informative blog on parsing FBX files, it goes through all the tags and what they mean. I think with this you don't even have to study the Blender exporter:
http://thunderfist-podium.blogspot.com/ ... -results=7

Once you get the ASCII loader working, you can either tackle the binary format or just use FBX convertor to convert any binary format files to ASCII.
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
JoshM
Posts: 28
Joined: Thu Apr 30, 2009 9:00 pm
Location: Salt Lake City, Utah

Post by JoshM »

That really helps a lot. I'm not really sure what you mean by the ascii loader though. I've spent about an hour looking for the ascii loader, and I can't seem to find it. I try to never ask a question about something without spending a little bit of time researching. Can you tell me what to look for in the code to learn more about how to use the ascii loader?

This helps a lot. Thanks for all of the help. I'll be really really glad when I have something at least partially working.

JoshM
BlindSide
Admin
Posts: 2821
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Post by BlindSide »

FBX comes in two formats. ASCII and Binary.

I am just saying focus on getting ASCII files loaded first, and then focus on binary.
I've spent about an hour looking for the ascii loader, and I can't seem to find it.
Yes because you're the one that wants to implement one, you don't find it, you make it. :P

If you need an example of parsing an ASCII model format, the .X loader in Irrlicht handles those, and their syntax is fairly similar to FBX (Uses curly brackets and what not). Although some parts are quite different.

Cheers
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
JoshM
Posts: 28
Joined: Thu Apr 30, 2009 9:00 pm
Location: Salt Lake City, Utah

Post by JoshM »

Ok that makes sense. I was just a little confused is all.

Thanks again.

JoshM
JoshM
Posts: 28
Joined: Thu Apr 30, 2009 9:00 pm
Location: Salt Lake City, Utah

Post by JoshM »

This is great. I didn't know that there was a way to convert from a binary fbx file to an ascii fbx file. It's actually a sample program in the fbx sdk. This simplifies things a lot. I might only implement an ascii importer, but I'm not sure. Like you said, I should worry about the ascii format first though.

JoshM
JoshM
Posts: 28
Joined: Thu Apr 30, 2009 9:00 pm
Location: Salt Lake City, Utah

Post by JoshM »

As an update: I have started to build an fbx reader that will be hopefully really simple to use. I'll have a lot to clean up at the end with naming conventions and all sorts of other stuff. I have some questions. I'm using std::string and std::vector to simplify some of the code in the reader. I think that this functionality is c++ specific. Is that going to screw things up for some people for any reason? I also have built the reader somewhat object oriented. There just seemed to be too many different properties to jumble it all up in one file. One problem with that is that I'm adding upwards of 16 different files. My worry is that because of some of these things, people won't want to, and/or be able to use the code, and the point of course is to make it usable and hopefully easy to update. I need to know if I'm going about this the right way. I would feel really bad if I got to the end and it wasn't usable.

Additionally, I think that when I'm done, I'll pretty much have a nice set of files that other people can pretty easily port over to their projects and use as well. That's an additional hope that people will be able to use this code in other projects if they would like to. It's open source and free anyways. Why not? I just hope that I can finish it. It has taken a lot longer than I thought that it would.

Thanks.

JoshM
BlindSide
Admin
Posts: 2821
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Post by BlindSide »

It's not a problem. If it is non-irrlicht specific I think it will be even more beneficial to the community, as unrelated projects could benefit easily.

If it IS meant to be irrlicht specific then you might as well swtich to core::stringc and core::array.

Either way one of us will get around to making it a built in Irrlicht loader if we find your code useful.

Good luck.
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
JoshM
Posts: 28
Joined: Thu Apr 30, 2009 9:00 pm
Location: Salt Lake City, Utah

Post by JoshM »

Yeah I think that I might keep them separate for now, and then after I finish the loader I'll figure out how to get it to get the loaded mesh into the irrlicht engine. I'm having a major problem at the moment which is that I don't know how the components all work together. I've tried looking at the md2, md3, and X loaders but I still don't understand how everything links together. What I mean is that there are vertices, normals, uv coordinates, and then there are joints and weights and bones, and then there are multiple layers of textures. Can you explain how all of these work together or send me to a tutorial that will explain how these generally work together? When I was in school, I never did anything with animated meshes. I have learned a lot during this project which is good.
BlindSide
Admin
Posts: 2821
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Post by BlindSide »

I'm afraid Luke would be the man to talk to about that as he pretty much single-handedly designed and coded our current SkinnedMesh system. Try pm him for tips.

Either way you would have to fill up something like CMeshBuffers with vertices and indices, which is rather straight forward. Just get the vertex and index arrays via meshbuffer.Vertices/Indices and fill them up, then add the mesh buffer to an SMesh via addMeshBuffer(). It may be quite a bit more involved t o do the animation side of things however, you would need to study the SkinnedMesh class to figure out how that all works.
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
JoshM
Posts: 28
Joined: Thu Apr 30, 2009 9:00 pm
Location: Salt Lake City, Utah

Post by JoshM »

Ok, I'll try and get ahold of LuKe sometime via pm after I feel like this part is ready to go.

Thanks.

JoshM
JoshM
Posts: 28
Joined: Thu Apr 30, 2009 9:00 pm
Location: Salt Lake City, Utah

Post by JoshM »

Unfortunately after spending a lot of time, I was unable to finish the fbx importer. I did get it to a point where the mesh was drawing scattered all over the place, but in the end, I just don't know enough about animations to really do this project. I hope that you guys all understand.

Really sorry.

Josh
FuzzYspo0N
Posts: 914
Joined: Fri Aug 03, 2007 12:43 pm
Location: South Africa
Contact:

Post by FuzzYspo0N »

hey dont feel bad! thats how learning goes. You CAN ask questions though, and you CAN post what you had so we can help fix it and move it along and help you learn.
JoshM
Posts: 28
Joined: Thu Apr 30, 2009 9:00 pm
Location: Salt Lake City, Utah

Post by JoshM »

That would be great if I can post the code and you could fix it up. Another problem is that right now I don't have more time to work on it.

How can I get my code to you?

Josh
wildrj
Posts: 301
Joined: Thu Mar 23, 2006 12:49 am
Location: Texas/ Cyberspace
Contact:

Post by wildrj »

You could probably go to the code snippet forum and post the code in

Code: Select all

 tags. or upload a zip somewhere perhaps media fire.
http://wild.deathtouchstudios.com << My gamedev blog
<Programming is a way of life>
If at first you don't succeed press the delete key till you do :)
Post Reply