Made a B3D Loader

Announce new projects or updates of Irrlicht Engine related tools, games, and applications.
Also check the Wiki
Luke
Admin
Posts: 449
Joined: Fri Jul 14, 2006 7:55 am
Location: Australia
Contact:

Post by Luke »

I wrote a bit of code that combines all the meshes of the blender scene into one mesh (seems what blitz3d needs to animate them), one of the thing it does to do that is take each vertex’s position and transform it by the mesh’s global matrix before writing it to file, but I’m pretty new to matrixes and I might be doing some thing wrong or missing something. It’s hard to find any good information on matrixes for games; I can only find short bits of info.


I’ve been testing your worm and it exports fine but animates on the wrong axis with something else going on, or the animation could be right and the mesh is wrong.

Image

One mesh I’m testing is inverting (inside out) when I transform the vertices but there is no negative scale in the matrix, and I cannot work out why it is doing it

That cylinder works fine, it’s not breaking.



blender armatures have a bone.001 name stuff...that dot messes most exporters and engines.
B3d should be fine with dots in names.


I'll email der_ton


I’m busy this weekend so I cannot work on the exporter much, I look in to it better when I have some free time.
vermeer
Posts: 2017
Joined: Wed Jan 21, 2004 3:22 pm
Contact:

Post by vermeer »

'right handed' or 'left handed' (axis system. I think)...that's something in files that used to break it all...

many plugins added a setting to change that depending on the case...

Another thing: Look, main difference between the worm and the cilinder is a double thing... first, I see that you have not deleted the floor object....secondly, ...constraints! The worm is using a freak lot of them: IK, contrain position and rotation to empties, copy location...

It's not like in the cilinder, that the bones are keyframed directly. Instead, in the worm example, the bones are driven by empties (like Max dummies, like helper boxes) which generate the behaving of the character. This thanks to the use of constraints. Without them, is pretty hard to animate some realistic human animation...(in any software)

Also the IK. (which is another constraint...you asign to a bone(usually ) chain an ik solver.this is artist side stuff)

So, x plugin does actually need me to bake the whole thing as standard bone keyframing...but this have its issues...
der ton's plugin does not need it.

that's why I mentioned "pose module".I read that der_ton did have to investigate that new code stuff of very recent blender versions, as to be able to export directly with no bake, the animated characters with constraints...

Also, Z axe is not the same in Blender than in most packages, like Ultimate Unwrap.

er....apart from inversion of stuff...looks like u got right the b3d file inside u3d, no? just looks as if the worm has got inverted normals, or lost material or something...

Yep, chat with der_ton, if he has time... he's a very gentle person, it seems.

Thanks for your work. i am not using irrlicht engine, but I like it and the comunity :)
Finally making games again!
http://www.konekogames.com
Luke
Admin
Posts: 449
Joined: Fri Jul 14, 2006 7:55 am
Location: Australia
Contact:

Post by Luke »

Vermeer:

I’ll look into them things soon, I’m a bit busy right now


just looks as if the worm has got inverted normals, or lost material or something...

Its just unwrap putting in black lines, see:

Image
vermeer
Posts: 2017
Joined: Wed Jan 21, 2004 3:22 pm
Contact:

Post by vermeer »

Luke:

this guy is making a game engine which loads directly blender armatures.

He seem to be loading interpolation but am not sure.

I don't know if this also helps for you on the issue you mention that you are having...

http://www.xp108.com

Lol, I see lightmaps generators there?
Maybe not...
Finally making games again!
http://www.konekogames.com
vermeer
Posts: 2017
Joined: Wed Jan 21, 2004 3:22 pm
Contact:

Post by vermeer »

lol
the animation is...ahem
Finally making games again!
http://www.konekogames.com
afecelis
Admin
Posts: 3075
Joined: Sun Feb 22, 2004 10:44 pm
Location: Colombia
Contact:

Post by afecelis »

wow! Vermeer, talking about weird discoveries. :wink: I had no idea this even existed. Pretty interesting. Thnx for the link.
Zoot
Posts: 2
Joined: Mon Sep 04, 2006 8:18 pm

Post by Zoot »

I wrote a bit of code that combines all the meshes of the blender scene into one mesh (seems what blitz3d needs to animate them)
Really? Does this mean that b3d can't hold TRS anmation? (Translate rotate scale of individual meshes, good for tanks and robots.)

And a bit OT: do bones only apply to vertex based animation or can you use them with a bunch of meshes too?
Luke
Admin
Posts: 449
Joined: Fri Jul 14, 2006 7:55 am
Location: Australia
Contact:

Post by Luke »

Zoot:
Really? Does this mean that b3d can't hold TRS anmation? (Translate rotate scale of individual meshes, good for tanks and robots.)
with boned meshes holding animation, blitz3D (the program, not the file format) seems to have trouble with using more than one mesh.

B3d files can hold the animation of individual meshes if you put a KEYS chunk in a mesh node chunk but I don’t think blitz3D (I think) or my b3d loader (yet?) will read it.

Bone animation can do everything animating individual meshes can, expect it is a little slower, but you have a point, I could look it to making the loader animate meshes individually (as a whole, no vertex moving) when it finds a bone that has a vertex weight of one on all vertices in a mesh. (That way the b3d files with still work with blitz3D, and you don't need special exporters to use it)
juliusctw
Posts: 392
Joined: Fri Apr 21, 2006 6:56 am
Contact:

questions on the dwarf that held the pistol

Post by juliusctw »

hey luke , in your code for dwarf holding a gun

f32 deltaSpeed=((f32)(newTime-lastTime)) * (60.0f/1000.0f);
why did you multiply it by (60/1000) ??

i'm kinda confused by these 4 lines
node->setTransitionTime(0.6);
node->setFrameLoop(371*100, 382*100);
node->setAnimationSpeed (10*100);
node->setTransitionTime(0);

i'm assuming that setTransitionTime sets the amount of time it takes to finish the animation, wouldn't that automatically determine the speed for setAnimationSpeed? why would you setTransitionTime to zero again right after?
Luke
Admin
Posts: 449
Joined: Fri Jul 14, 2006 7:55 am
Location: Australia
Contact:

Post by Luke »

Juliusctw:
f32 deltaSpeed=((f32)(newTime-lastTime)) * (60.0f/1000.0f);
why did you multiply it by (60/1000) ??
Just a habit, if the game is running at 60 fps, deltaSpeed will equal one, it makes it easier to turn non-delta timed code into delta timed because I can just times values by it, and the game still runs at about the same speed.

i'm assuming that setTransitionTime sets the amount of time it takes to finish the animation, wouldn't that automatically determine the speed for setAnimationSpeed?

I’m not sure what you mean, setTransitionTime and setAnimationSpeed don’t affect each other.

setTransitionTime will basically create extra bits of animation that joins two animations together.

setAnimationSpeed is not my function, and it still does what it says in the Irrlicht doc.


This may help:

node->setTransitionTime(0.6); //Sets the transition for the next change in animation in about half a second
node->setFrameLoop(371*100, 382*100); //Set the frame loop
node->setAnimationSpeed (10*100); //Sets the Speed the animation plays at (unrelated to transitions), this line will make the animation play at 10 frames a second (its really playing at 1000 frames per second but that’s just make the animation smooth, there’s no overhead/slowdown in doing this)

node->setTransitionTime(0); //Sets the transition time for the next change in animation, this doesn’t effect this change in animation and is not really needed.
CK_MACK
Posts: 7
Joined: Mon Sep 18, 2006 12:57 am

Post by CK_MACK »

Greetings all,

I am new to Irrlicht and just starting. I currently run Irrlicht 1.1
Luke, what do I need to do to get your additional functionality for 1.1?

I noticed that 1.1 loads b3d, but for example transparancy does not seem to work for the mesh we are using...

http://www.macktek.com/akb3d/OAB3D.zip

PS I hope I can edit these posts...

Is there an update link for Irrlicht 1.1 for your improvements?

Also, I would like to thank you very much for your incredible work.

MACK
[/url]
MACK
RichardT
Posts: 4
Joined: Sun Aug 13, 2006 2:44 pm

Post by RichardT »

Hi all,

I'm new here too. I was reading this forum and noticed questions about Blitz 3D and animated meshes. Unless I misunderstood what I read :), there are two methods of animating in B3D. One is using the MD2 style of animation, extracting sequences. This method works well for animations with IK and so on. The other method is a "find child" method that allows the coder to rotate, turn or move any of the parts of a model's heirarchy, as long as the model isn't one piece or doesn't have a skeleton attached. So those methods give Blitz3D a decent degree of flexibility. The coder has to know the sequences or the names of the models components in the heirarchy for the methods to work.

I'm new to both Irrlicht and C++. Wish me luck!

Richard
Luke
Admin
Posts: 449
Joined: Fri Jul 14, 2006 7:55 am
Location: Australia
Contact:

Post by Luke »

CK_MACK:


(edit: The mesh was made in giles, not sure if you have giles)
I've only got the demo of giles, but it seems that mesh’s materials uses ‘multiply’ as the blend mode, the b3d loader just ignores this because I couldn’t find any ‘MaterialType’ to do this in Irrlicht. In giles try changing the material’s blend mode to alpha and give it an alpha value, I can’t test this because the demo doesn’t let me save. If you change the blend mode of that mesh could you please send me it, it would be helpful for testing. Also Irrlicht (or the loader?) seems to have a bug drawing transparency on meshes in OpenGL.


There’s an example with a patch on page 6 of this topic, I’m not sure if it still works with the latest SVN, let me know if you have any trouble.



RichardT:


Yeah that’s about right the coder can also move bones around while the mesh is animating (eg only move the head). The standard Irrlicht won’t let you move around bones you'll need a patch, also when I’m finished this exporter and have a bit of free time I add support for moving the bones of .X and .MS3d meshes too.

Good luck with Irrlicht
RichardT
Posts: 4
Joined: Sun Aug 13, 2006 2:44 pm

Post by RichardT »

@ Luke:

In Gile[s] there are are three effects for texture blending in the main texture panel. Alpha, Multiply, Additive. In the Texture Window, accessed from Window > Texture Window, there are 10 texture flags, 5 Blending effects and 5 tiling settings for texture tiling (setting the UVs). Since Gile[s] uses a technique that renders a lightmap in .png format, when you export a model from Gile[s] to .b3d, the information for the lightmap is in the b3d file along with the texture information and the data for creating the model in Blitz. If you simply place a model and a lightmap, without the textures in the same location as the model, you get a "Memory Access Violation" error in Blitz. When I tried to load a b3d model in Irrlicht, I didn't get all the textures rendered correctly, only the model and lightmap were correct.

I don't know if that will help you, but I'm looking forward to the plugin so that I can use the models I create in my programs done with Irrlicht. This is one of them, a screenie from Gile[s].

16 meshes, 33,483 faces, 37,212 vertices. It took about 2.5 secs to load and render in Blitz. My system has integrated graphics. :(


Image

Richard

Edit: BTW, Blitz3D was written using the DX7 SDK. You might be able to look in there to see how DX uses the alpha, multiply and additive modes for rendering. You can get it at:

http://www.oldversion.com/program.php?n=directx
"Do or do not. There is no try." - Yoda
vermeer
Posts: 2017
Joined: Wed Jan 21, 2004 3:22 pm
Contact:

Post by vermeer »

I dont understand well...

With Murphy's old format, in the xml (MIM), there was a setting called "multiply" , which is the usual lightmapping method in other engines, and one could type there "2x" , "1x" , "4x".For the type of lightmap mode.

I am a Giles registered user, problem is I dont like that evil thing of exporting my name and data inside the b3d file, as also, it's binary, so I cant even strip it out. Giles seem to do this with all files exported. Luckily at least in x(ascii) , obj files , I there still can strip my info.

Anyway, material types. Have the UI loaded now. I can select multiply, alpha, additive. Multiply is darker, alpha is default, and more brigt, additive is too much bright, but usefull for certain lightmap kind.
Finally making games again!
http://www.konekogames.com
Post Reply