#### Archived

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

# Is the 3DS file *.asc good?

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

## 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 on other sites
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 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 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

1. 1
2. 2
3. 3
Rutin
16
4. 4
5. 5

• 13
• 26
• 10
• 11
• 9
• ### Forum Statistics

• Total Topics
633723
• Total Posts
3013546
×