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 a matrix or x files

Author
Message
lilgamz
19
Years of Service
User Offline
Joined: 10th Mar 2006
Location:
Posted: 23rd Mar 2006 19:04
Can you save a matrix and reload them as needed

Also is it possible to export a mesh as .x or obj file from Dark basic



Sorry if these are dumb questions. Im new.
General Sephiro
20
Years of Service
User Offline
Joined: 27th Sep 2004
Location:
Posted: 24th Mar 2006 18:10 Edited at: 24th Mar 2006 18:11
1.) saving a matrix, yea you can... simply do a small save loop getting all the co-ordinates of the matrix + height.

E.g.
a matrix with 50 by 50 tiles



Personally I feel it is better to create a 3d model landscape instead of using a matrix, far easier to manipulate within a 3d modeling tool. Unless you've already written your own 3d level editor

Yes it is possible to export a mesh to .x providing u can get all the information required and write it to a .x file. You'll need to learn how a .x model is structured though. In a scale of 1 - 10 for your programming skills you'll need a 6/10 to do this.

lilgamz
19
Years of Service
User Offline
Joined: 10th Mar 2006
Location:
Posted: 24th Mar 2006 19:13
How could I get the file structure for exporting .x files¨?

I have open some up and they were binary or chinese or something but others look like regular text files.
Duke Blue Devils
19
Years of Service
User Offline
Joined: 11th Mar 2006
Location:
Posted: 24th Mar 2006 22:31
Take a look at this.

J.J. Redick-Player of the year
2006 National Champions

Attachments

Login to view attachments
lilgamz
19
Years of Service
User Offline
Joined: 10th Mar 2006
Location:
Posted: 25th Mar 2006 16:37
thanks duke. Is that as simple as it gets? That looks like microsoft orginal documentation. Clear as mud.

Do you have anything on Direct3d retained mode date types?

"A familiarity with Direct3D Retained Mode data types is assumed. "

Also as per usualy MS documentation they have passages like this:

"Template Name: Coords2d
UUID
<F6F23F44-7686-11cf-8F52-0040333594A3>
Member Name Type Optional Array Size Optional Data Objects
u FLOAT None
v FLOAT
Description
A two dimensional vector used to define a mesh's texture coordinates."

Without a an example of what that all means.

So we are getting closer.

Any idea of how to make DBC write one of those files?


Thanks again Duke. It was a good find nonetheless.
Dodic
19
Years of Service
User Offline
Joined: 6th Nov 2005
Location: SNM (Serbia&amp;Montenegro)
Posted: 25th Mar 2006 16:41
You can get all dwords and whatever needed from memblock, make a memblock from wished object already loaded in dbc, and you will just need to make it write them in correct format.


Duke Blue Devils
19
Years of Service
User Offline
Joined: 11th Mar 2006
Location:
Posted: 25th Mar 2006 16:58
Dodic is right on. You need to use memblocks to get all of the coordinates of the vertices of the object. Some time ago I was going to make a program that would export .x models because I needed to scale them so that their vertices were all integer values. Gave up on it though because it got to complicated.

J.J. Redick-Player of the year
2006 National Champions
Dodic
19
Years of Service
User Offline
Joined: 6th Nov 2005
Location: SNM (Serbia&amp;Montenegro)
Posted: 25th Mar 2006 17:00
Yeap, it is VERY complicated, though when you make it work once...it is easy to go on later..


lilgamz
19
Years of Service
User Offline
Joined: 10th Mar 2006
Location:
Posted: 2nd Apr 2006 14:18
so nobody want to share a "save as x file" subroutine?

I would think that it would be laying around somewhere.

Login to post a reply

Server time is: 2025-05-23 19:19:46
Your offset time is: 2025-05-23 19:19:46