Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Discussion / saving object from memblock

Author
Message
BN2 Productions
21
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 8th Aug 2006 05:31
ok, I have my object inside a memblock and I want to save it as a .x or .3ds file. how do I do that? I tried making a file named "object.x" and writing the memblock to it, but that didn't work. Is this even possible with dbc?

Thanks for your help
Latch
18
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 8th Aug 2006 06:45 Edited at: 8th Aug 2006 06:47
Hi,

You can save the memblock as a memblock - and then just reload it into DBC as a memblock. Just give it a filename and some extension - to keep track I usually use .mem.

If you want to change it to another file format, then that takes work. Take a look at this post. When it opens, take a look at the link in the first post.

http://forum.thegamecreators.com/?m=forum_view&t=85862&b=10

Enjoy your day.
BN2 Productions
21
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 8th Aug 2006 07:06 Edited at: 8th Aug 2006 07:24
lol, i already found that post, thx anyway. What I really want, though is the ability to save the objects so that they can be used in other programs. I didn't see anything llike that on the other post.
[edit]
Ok, I think I figured out half the solution. I opened a .x model in notepad and got a really long list of commands. Now all I need to do is know how to manipulate all of these different things. I don't know what a lot of them mean. Since the file is too long to post all of the text, just open a .x file in notepad to find out what i am talking about.


thanks again
Kevin Picone
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Australia
Posted: 8th Aug 2006 07:42 Edited at: 23rd Aug 2010 00:32
In order to save the memblock mesh as a X file, you'll need to look into the .X file format. There's two versions of .X files, those being Binary and ASCII. The later would be easier to use, since you can open them in a text editor to verify the output.

To build your .x means dumping the header (which will be basically be the same for any mesh) then dumping the list of vert's, faces and any materials(textures). I'd ignore materials to start with and just get it working.

http://local.wasp.uwa.edu.au/~pbourke/dataformats/directx/

BN2 Productions
21
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 8th Aug 2006 08:12
Awesome thanks. Maybe I will make some functions to do all this and post them in the codebase or something.....

Anyway thanks Kevin and Latch.

Login to post a reply

Server time is: 2025-05-25 10:27:36
Your offset time is: 2025-05-25 10:27:36