Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

skyfire360

Is the 3DS file *.asc good?

This topic is 6507 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm writing a loader for it (as well as many many other fileypes), and I'm wondering what the ASC file uses. Does it use triangle strips? Triangles only? Something completely different? I just find it wierd that there are 72 faces in a model and 92 points. This means that some of these points overlap, but how do you know which ponts are part of each triangle? -SkyFire Edited by - skyfire360 on 11/27/00 12:00:43 AM

Share this post


Link to post
Share on other sites
Advertisement
i havent used the asc format.
but look at the following model
6 points + 4 triangles
X-X-X
|/|/|
X-X-X

http://members.xoom.com/myBollux

Share this post


Link to post
Share on other sites
the faces are just indexes pointing onto the vertices/points:

Points: //always x,y,z

1,54,23,364,234,135,543,23,75,253,324,234 // our points

Faces: //always 3 for a face

0,1,2,0,1,3

at the end we have 2 faces:
first with vertices/points 0,1 and 2

([1,54,23],[364,234,135],[543,23,75])

and the second with 0,1, and 3

([1,54,23],[364,234,135],[253,324,234])


so you just have to load the points into an array

VERTEX vertices[verteccount];

and your faces into a facelist:

short int faces[facecount*3]; //always 3 points a face

then you easy can draw the faces like this:

glBegin(GL_TRIANGLES)
{
for(int i=0;i{
glVertex3fv(vertices[faces[i*3+0]]) //grab the index of the current vertex out of faces and send this vertice to glVertex()
glVertex3fv(vertices[faces[i*3+1]]) //for the second vertice of the face, too
glVertex3fv(vertices[faces[i*3+2]]) //and for the last one
}
}glEnd();

every normal 3d format is constructed like this, so i think the ASC, too

we wanna play, not watch the pictures

Share this post


Link to post
Share on other sites
I can''t thank you enough dave. I was very confused about what was going on in the ASC file, and now I see it clearly. Thanks Again!


-SkyFire

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!