Regenerate B3D files

Blitz3D Forums/Blitz3D Programming/Regenerate B3D files

Bobysait(Posted 2006) [#1]
Hi, i'm parsing the b3d format to built the whole stucture .

But unlucky i can't find where are stored the second Uv set ...

is anyone could help me ?

Here is the main part of the code




Bobysait(Posted 2006) [#2]
Ok, If i had look better, i would have found it ...


{
char file[] ;texture file name
int flags,blend ;blitz3D TextureFLags and TextureBlend: default=1,2
float x_pos,y_pos ;x and y position of texture: default=0,0
float x_scale,y_scale ;x and y scale of texture: default=1,1
float rotation ;rotation of texture (in radians): default=0
}

The TEXS chunk contains a list of all textures used in the file.

The flags field value can conditional an additional flag value of '65536'. This is used to indicate that the texture uses secondary UV values, ala the TextureCoords command. Yes, I forgot about this one




It is cumulated on the flag for the texture coord set

and all vertexTexCoords are stored using a flag too

VRTS:
int flags ;1=normal values present, 2=rgba values present
int tex_coord_sets ;texture coords per vertex (eg: 1 for simple U/V) max=8
int tex_coord_set_size ;components per set (eg: 2 for simple U/V) max=4
{
float x,y,z ;always present
float nx,ny,nz ;vertex normal: present if (flags&1)
float red,green,blue,alpha ;vertex color: present if (flags&2)
float tex_coords[tex_coord_sets][tex_coord_set_size] ;tex coords
}

The VRTS chunk contains a list of vertices. The 'flags' value is used to indicate how much extra
data (normal/color) is stored with each vertex, and the tex_coord_sets and tex_coord_set_size
values describe texture coordinate information stored with each vertex.




Bobysait(Posted 2006) [#3]
Just one thing don't understand ...


; Int tex_coord_set_size ;components per set (eg: 2 for simple U/V) max=4




how can we have more than two coordinates for one vertex ?
u,v and what else ???

I knw about a certain w , that i have never been abble to understand, but however it should be one the the four , what is the last ?


Bobysait(Posted 2006) [#4]
allright, in fact, there is the w mapping coords and an additionnal optional setting just here to prevent a different version that could need one more setting.

and, the 8 UV sets are here because, Blitz3D does not support more than 2 uv sets coords, but we can load b3d file from other engine. Like torque or Irrlicht that support more than 2 Uv Sets .

No any question :) , finally, i found answers.
( and my code is in a good way ... i'm happy :D )


puki(Posted 2006) [#5]
This all seems quite exciting - what is it for?


Bobysait(Posted 2006) [#6]
An animation tool :) I need to parse b3d, and then export the scene from Blitz, with anim, keys and bones.

For an other way, I need it for the Eliza3D Module for bmax.


Bobysait(Posted 2006) [#7]
updated



puki(Posted 2006) [#8]
Animation tool. Interesting.

Are you planning on making any animated RPG characters - like the ones in my sig?


Bobysait(Posted 2006) [#9]
you 're a nomad shop :)

I don't expect it. I just want to ave my own tool for a rpg I'm developing. So I'won't have to explain where my models come from :)
Imagine i have to justify Models from 3dsmax ( 5000€ license ... hum ... )

Maybe i'll share the tool, but for the moment, I don't know.

What i can say, The Eliza3D engine ( which will need this part of code ) is a freeware blitzmax 3D module developped by TMyke => http://www.eliza3d.com/index.htm

So, I'll see when i'll finish all this stuff :)


Tom(Posted 2006) [#10]
Puki: ....like the ones in my sig?

What sig?