×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
• Talk With Other Members
• Be Notified Of Responses
• Keyword Search
Favorite Forums
• Automated Signatures
• Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

#### Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

# How do I specify model coordinates in a text file?

## How do I specify model coordinates in a text file?

(OP)
Hey guys.  I recently downloaded the source to a pretty nice 3D engine.  I've incorporated some smooth sound events and enhanced the control of the player, but now I've started the process of adding 3D objects to the game.  There are currently 3 objects included with the game, but I can't seem to figure out how they work.  Rather than a .X or .3DS file, these models are simple text files which specify information about the models.  As much as I've tinkered with the files, I still cannot understand how to create my own.  Let's say we have a metal sign.  It looks like a stop sign, except the actual face of the sign is a triangle rather than an octagon (8 sided is octagon right?)  Here's the coordinates for the sign, right from the text file (Sign.emp):

#### CODE

t,-25,100,0,0,150,0,25,100,0,0,1,0.5,0,1,1,1
t,-2,0,0,2,0,0,-2,100,0,0,0,1,0,0,1,2
t,-2,100,0,2,100,0,2,0,0,0,1,1,1,1,0,2
p,2800, 440, 10900
m,"\objects\sign.mtx"
m,"\objects\stand.mtx"
Now I can only presume that any line starting with t is a set of vertices (3 lines where t is the first character and 3 sides to the triangle).  I guess p is the actual location of the object in the "world".  Obviously m specifies the textures used for the object.  Now here's what throws me off - There are 3 lines that start with "t", but these 3 lines control the way the sign (3 sides) AND the pole (2-4 sides?) are rendered.  The pole probably has 2 sides because it's paper thin, so I guess specifying the thickness of it isn't needed.

So the question is, how are those 3 lines of coordinates used to determine the shape and size of the sign?  I would LOVE to see a generator out there that allows you to draw an object with the mouse and it automatically generates the text file with these coordinates.  If one doesn't exist, could someone please try to explain to me how this file works with an application?  I will most definitely create a generator (if one doesn't exist) to automate however this file was created.  Thank you very much for any input you can provide!

#### Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

#### Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Close Box

# Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

• Talk To Other Members
• Notification Of Responses To Questions
• Favorite Forums One Click Access
• Keyword Search Of All Posts, And More...

Register now while it's still free!