1,105,263 Community Members

dat to obj model converter (needs to know)

Member Avatar
Tcll
Posting Pro in Training
442 posts since Jan 2010
Reputation Points: -4 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

ok...
so I've decided to start work on a model converter...

I'm a lousy Py programmeer and I'm trying to understand a few things...
but first off:

I want to store vert XYZ data in 'verts' as a list...
say we have 3 verts, the var would look like this:

verts = [X,Y,Z , X,Y,Z , X,Y,Z]

#done with this:
while (count > 0):
    verts.append(vec(),vec(),vec())
    count -= 1

now how would I read from the 'verts' as 1 vert at a time??
I'm thinking something like:
verts[0], verts[1], verts[2]

but that would just return the first offset...

can someone help :/

Member Avatar
Gribouillis
Posting Maven
3,452 posts since Jul 2008
Reputation Points: 1,140 [?]
Q&As Helped to Solve: 883 [?]
Skill Endorsements: 18 [?]
Moderator
 
0
 

You can't append 3 values to a list

TypeError: append() takes exactly one argument (3 given)

Further, what is this vec() function ?

Member Avatar
Tcll
Posting Pro in Training
442 posts since Jan 2010
Reputation Points: -4 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

You can't append 3 values to a list

TypeError: append() takes exactly one argument (3 given)

Further, what is this vec() function ?

I know...
didn't feel like typing the entire code...

(I'm on Wii)

Member Avatar
SgtMe
Nearly a Posting Virtuoso
1,204 posts since Oct 2009
Reputation Points: 46 [?]
Q&As Helped to Solve: 86 [?]
Skill Endorsements: 0 [?]
Featured
 
0
 

So you want to read verts from a file and write it in your own format? You just need to be able to read a line from a file, delete any un-needed characters and split the string up into three parts. Then you can convert them to int and make a list of these. Just do google searches for the above bits and pieces. Should turn something up.

Member Avatar
Tcll
Posting Pro in Training
442 posts since Jan 2010
Reputation Points: -4 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

So you want to read verts from a file and write it in your own format? You just need to be able to read a line from a file, delete any un-needed characters and split the string up into three parts. Then you can convert them to int and make a list of these. Just do google searches for the above bits and pieces. Should turn something up.

dat is hex... (from a GCN game)
obj is ascii

the dat format is complex...
it has a header that takes you to a relocation table...

I want my converter to store everything in a var before prompting to save an obj :/

btw, I'm tired of 0 results on google D:

Member Avatar
Tcll
Posting Pro in Training
442 posts since Jan 2010
Reputation Points: -4 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

ignore that last post :/

I've just thought of a better way...
just rename the obj after the dat :/

^whith doing that, I can do 'per vert' conversion

EDIT: @ any admin that spots this
don't delete this thread...
there will be times I'll need to bring up something about this :/

You
This article has been dead for over three months: Start a new discussion instead
Post:
Start New Discussion
Tags Related to this Article