Problems with B3d model

BlitzMax Forums/MiniB3D Module/Problems with B3d model

impixi(Posted 2007) [#1]
Very simple code + B3d model created with Tree Magik. The equivalent Blitz3D code displays the model without problems. BlitzMax + MiniB3d does not display the textures.

Can anyone help? Have I overlooked something obvious?

EDIT: Removed dead link.


Takuan(Posted 2007) [#2]
Hi, no clue why it doesnt load. Maybe its an old .b3d file format or something is wrong with the path?

Anyway, until you found a clean solution you could load textures that way:

Import "MiniB3D.bmx"

Graphics3D 800, 600

Camera = CreateCamera()
PositionEntity Camera, 0.0, 0.0, -5.0

mesh = LoadMesh("tree01.b3d\tree01.b3d")

BrushA=loadBrush("tree01.b3d\artifact2.jpg")
BrushB=loadBrush("tree01.b3d\eeeeeee.png",2)
SurfA=getsurface(mesh,1)
SurfB=getsurface(mesh,2)
paintsurface SurfA,BrushA
paintsurface SurfB,BrushB

ScaleEntity mesh, 0.1, 0.1, 0.1

While Not KeyHit(KEY_ESCAPE)

RenderWorld

Flip
Wend
End


There is a second problem.
MB3D cant read your .jpg format and you have to convert "artifact2.jpg".
You could load it in Gimp and then save it again (i tried 100 quality) as .jpg


bradford6(Posted 2007) [#3]
I fixed it by loading it into Ultimate Unwrap 3D, assigning the artifact.jpg bitmap and saving as .b3d. both (low and high poly) work fine after doing that)

not sure why?


impixi(Posted 2007) [#4]
Thanks guys. I'll investigate a little further and see if I can find out why.


Mikele(Posted 2007) [#5]
Your b3d files contain two TEXS nodes and two BRUS nodes (typicaly should be one node TEXS and one node BRUS). This can affect LoadMesh function.


impixi(Posted 2007) [#6]
Ahhh, okay. Thanks Mikele.

I guess I'll use Takuan's workaround, then, since Tree Magik does not export to any other MiniB3d compatible formats. And I don't own Unwrap 3D. And I don't know enough about MiniB3d's internals to modify Simon's loader code.

@Takuan: I had no problems loading the jpg file as is. Have you ‘synchronised modules’ recently?


Takuan(Posted 2007) [#7]
Ah, yes. I just did a syncmod and now it loads that .jpg;)


simonh(Posted 2007) [#8]
Fixed in 0.42


impixi(Posted 2007) [#9]
Thanks.


z4g0(Posted 2007) [#10]
Fixed in 0.42

great! I hope that this time my .b3D will imported with correct materials and texture :D


simonh(Posted 2007) [#11]
Send me a file and I'll try it out.