Where to begin

author Posted by: whaledawg on date Sep 16th, 2008 | filed Filed under: general

No posting for a while because the project is going well. I’m at the point where it’s time to start dealing with(ugg) files.

There’s a relatively simple solution for 3D file formats, the .OBJ. It’s text based so it’s almost human readable and other 3D tools readily export in it’s format. It’s just a series of verts, normals, texture coordinates then faces. Basically like this:


# this is a comment
# Here is the first vertex, with (x,y,z) coordinates.
v 0.123 0.234 0.345
v ...
...

#Texture coordinates
vt ...
...

#Normals in (x,y,z) form; normals might not be unit.
vn …
..

#Each face is given by a set of indices to the vertex/texture/normal
#coordinate array that precedes this.
#Hence f 1/1/1 2/2/2 3/3/3 is a triangle having texture coordinates and
#normals for those 3 vertices,
#and having the vertex 1 from the “v” list, texture coordinate 2 from
#the “vt” list, and the normal 3 from the “vn” list

f v0/vt0/vn0 v1/vt1/vn1 …

Easy to understand and process. But obviously my game library will need to have more information than just the polygons for most objects. Does it move? Does it have mass? Do other objects bounce off it or clip right through it? If they can’t move throught it what are it’s dimensions? So the questions becomes, how do I represent that?

The way I see it I have 3 options:

  1. Simply tack my information onto the end of the .OBJ with a new pattern.
  2. Place my information into .OBJ comments so it’s still a valid .OBJ file.
  3. Make my own file format from scratch.

I think I’ve talked about design principles before, that your pillars are simple, efficient, and elegant.  Effieicent isn’t that big a concern with file formats(getting it off the disk is never going to be the run) so lets concentrate on the others. Option 1 is simpler than 2, but 2 is more elegant. It’s nice that my files are compatible with a general standard. Or are they?

By burrying my propietary information in the comments they fake compatability, but is there a requirement that comments be treated a certain way by programs that use .OBJ? Not really, other than to ignore them if they find them. That means I could open up my faux-OBJ file with 3DS Max and change it’s color, then save it only to find it erased or moved my comments.

It’s actually very complicated and inelegant to try and hide new data in a standard not designed to hold it. Bad idea.

So that leaves making my own file format from scratch. I’ll be doing something XML based(simple and elegant). Sure this means I’ll have to make some tools for editing/combineing my files with .OBJ files but it’s not a huge amount of extra work and it’s worth it to have files that actually fit a standard instead of almost fit a standard. That never ends well.

     Add A Comment

You must be logged in to post a comment.

  • chicago bears 61
  • chad ochocinco height and weight
  • chicago bears posters
  • randy moss height
  • cspan kucinich
  • dope
  • bengals kids jersey
  • greg olsen 2009 calendar
  • chicago bears schedule 2011
  • hp support chat
  • randy moss bio
  • battleship kirishima
  • c span youtube obama
  • gregg olsen books
  • hp support hard drive replacement
  • search dog foundation
  • bengals for adoption
  • tea party for kids
  • la ink phone number
  • battleship bismarck wreck
  • freida pinto miral
  • hp support 530
  • chicago bears 96
  • chad ochocinco yesterday
  • tea party 8 28 09
  • freida pinto chanel
  • wolff
  • randy moss college
  • agents
  • chicago bears number 17
  • wave
  • hp support venezuela
  • chicago bears 2009 roster
  • la ink jabberwocky
  • disconnect
  • bengals merchandise
  • vince young stats
  • la ink corey
  • search and seizure
  • chad ochocinco johnson
  • summertime
  • search engines of the world
  • mtv 25 lame
  • search engines other than google
  • hp support 6930p
  • chicago bears 08 record
  • randy moss 07 08 highlights
  • bombings
  • dis boards cruise
  • bengals images
  • randy moss 98 vikings
  • rooms
  • search 32
  • freida pinto jeansfreida pinto kissing
  • new england patriots 3 4
  • search engines usage statistics 2010
  • whaler
  • search tumblr
  • tea party chicago
  • dis systems
  • zara phillips school
  • meeting
  • search vim
  • connie
  • stadium
  • connecticut 97.7connecticut attorney general
  • connecticut lottery
  • mtv website
  • connecticut airports
  • mtv rivals
  • volunteer
  • denso
  • la ink 03x05
  • zara phillips kids
  • chicago bears 09 draft
  • tea party hats
  • new england patriots 07
  • la ink games online
  • tea party nj
  • gearbox
  • battleship texas hours
  • dis pater
  • new england patriots 84
  • frazer
  • hp support greece
  • chad ochocinco quotes video
  • hull
  • vince young usc
  • geography
  • dis windsor wi
  • 22lr
  • vince young football camp
  • want
  • bea karp
  • chicago bears 17 lisa lampanelli
  • vince young released
  • la ink tattoos
  • search with image
  • bengals xxiii
  • bengals tryouts
  • vince young depression
  • chicago bears 1985
  • tea party agenda
  • kayaking
  • zara phillips baby
  • vince young 3rd 30
  • la ink season 6
  • new england patriots wiki
  • search engines for jobs
  • sense
  • bea test
  • chad ochocinco parents
  • bea luna
  • bea 4603
  • beagle
  • bea 2011 map
  • search operatorssearch people
  • disassembledis boards
  • hp support center
  • tavern
  • sahara
  • la ink season 5 premiere
  • connecticut sun
  • iver
  • anual
  • new england patriots 50
  • bea diy
  • chicago bears football club
  • bengals games
  • chad ochocinco quits football
  • randy moss arrested
  • widget
  • la ink show
  • bengals new uniforms 2012
  • mtv true life
  • battleship wilmington nc
  • zara phillips yachtzara phillips zimbio
  • bengals forum
  • vince young rivals
  • acessories
  • 10000
  • c span shelby foote
  • chicago bears pictures
  • cingular
  • bengals arrests
  • diamondback
  • search 78search 800 numbers
  • aires
  • bengals cheerleaders tryouts 2011
  • dis poem
  • c span kozol
  • dis lyrics
  • accumulator
  • freida pinto 1995
  • mtv overdrive
  • winston
  • la ink bam margera
  • new england patriots xxl
  • sling
  • dillon
  • new england patriots espn blog
  • search google cache
  • search 990 filings
  • hp support assistant review
  • greg olsen twitter
  • chad ochocinco age
  • connecticut lakes
  • search engines compared
  • mtv 30 years
  • vince young dadvince young eagles
  • centurion
  • connecticut 7 day weather forecast
  • bea verdi
  • connecticut education
  • new england patriots helmet
  • search engines 9
  • dist 91
  • cspan washington correspondents dinner 2011
  • chad ochocinco and cheryl burke
  • search domains
  • eyelet
  • whirlpool
  • la ink watch online free
  • battleship classes
  • search engines and flash
  • connecticut 104.1
  • chad ochocinco quickstep
  • intrest
  • mtv cartoons
  • vince young jay cutler
  • protective