3ds support in minib3d ?

BlitzMax Forums/MiniB3D Module/3ds support in minib3d ?

Stenley(Posted 2008) [#1]
At the moment minib3d supports only .b3d files. But is it planned, that it will in any time support also .3ds ?

Hopefully this side will help:
http://www.geocities.com/aliens_can_dunk/main.html

At
http://www.geocities.com/aliens_can_dunk/x3ds.html
is an OpenSource 3ds to b3d converter and at
http://www.geocities.com/aliens_can_dunk/3dlinks.html
are 3ds format specifications.


simonh(Posted 2008) [#2]
No, sorry, .b3d only.


Beaker(Posted 2008) [#3]
Stenley - that link to the 3ds to b3d converter is a different b3d file format (Believe3D).


gman(Posted 2008) [#4]
Biturn works well.


kfprimm(Posted 2009) [#5]
Markus Ranch's engine which was posted in the archives can loaded 3DS meshes without any problems. Grab MR_LOADER.bmx (I believe that is what it's called).


IceVAN(Posted 2009) [#6]
Hi, Stenley

You can use this code:


save like "T3DSLoader.bmx" in INC folder of sidesign.minib3d mod


next add include "inc/T3DSLoader.bmx" in minib3d.bmx source.
and replace loadAnimMesh function of tmesh.bmx source in INC forlder for this:



build modules and now you can load .3DS files.

this loader is not perfect but run ok.


SIMONH you can include it in the next version?!! please!!

BYE!


IceVAN(Posted 2009) [#7]
Note:
This code is not mine. I found some time in the forum. I do not remember the name of that program.


DreamLoader(Posted 2009) [#8]
hi IceVan,how about shadows and shader?


matty47(Posted 2009) [#9]
I tried the above code but could not get it to work properly - could be something I am doing. should the line
 If Right(String(file),4)=".3ds" Then Return T3DSLoader.Load(file)

read
If Right$(file$,4)=".3ds" Then Return T3DSLoader.Load(file$)


although when I changed it my example still did not work. I will need to check further. Note that Build Modules succeeded (apparently) with either.

Does anyone have a ".obj" loader that could be incorporated into minib3d or alternately a .3ds or .obj to .b3d that works natively on Mac OS X ( ppc)
Thanks in advance
Matthew


Difference(Posted 2009) [#10]
I have something in the works, but it's not quite production ready yet: http://blitzmax.com/Community/posts.php?topic=82586

I don't know if it will compile on a Mac because I have not tried yet.


matty47(Posted 2009) [#11]
I think the code above is actually included in the Klepto version of minib3d (it certainly looks the same). I can use that mod and load a .3ds in WindowsXP but on OS X I get a null object error when loading a .3ds (the same one used on windows) file. There must be comething in T3DSLoader.bmx that is failing on OS X. Unfortunately the module compiles OK and there is no debug info to see what is failing - only a message to say that I am trying to access a null object when I try to get the mesg depth. Will need to look at this further.


IceVAN(Posted 2009) [#12]
Hi,

This code works ok on osx. I use MAC to program and works well.
it may not work in PPC cpu but in Intel run well.


matty47(Posted 2009) [#13]
I added some debug messages to T3DSLoader andiscovered that the failure is an endian issue. Even though the 3ds file was saved on a ppc mac the byte order (as set by the file format I guess) is intel. When reading the stream the order is being misinterpreted. In the load function I get reported
Size of file - 000016AA Hex Correct
ChunkID - 00004D4D Hex Correct again
ChunkSize - AA160000 Hex Back to front?
Obviously I need to learn how to use endian streams to fix this (Unless of course someone has already done this and is willing to share their code)
Thanks


matty47(Posted 2009) [#14]
Had a bit of a play with this and by changing the ReadFile in the T3DSLoader.Load function to

Loader.Stream = ReadFile(("littleendian::" + String(URL)))


I can at least get an untextured 3ds file to show up on the screen running on a ppc mac

One little annoyance possibly solved
Thanks
Matthew