Skip to main content
GameDev.net gamedev.net
🔒 Locked

D3D .asc loader

Started by thekid Apr 29, 2000 at 9:14 PM 12 replies 1k views
Original Post
thekid
thekid
I need the source for a d3d .asc file loader I am working on one myself but I am a little stuck
thekid
thekid
Yes .asc It is a 3d file format that ouputs the data to a kind of text file called a .asc file.

Does anyone have any source??
AnalGoat
AnalGoat
I have the source for a loader, but it would probably help you more if you wrote your own. ASC files are really simple to parse and understand. Just look at one. If I gave you my source it would assume you use the same data-structures as I do and you probably don''t. So take a look at the file, it''s all there. Number of verts, polys. Then vert list, then poly list. Easy! Cheers!
thekid
thekid
I am have problems with the parsing code. So can anyone at least tell me where I can get the code to do the parsing?
goltrpoat
goltrpoat
try your head


--
Float like a butterfly, bite like a crocodile.

--Float like a butterfly, bite like a crocodile.
RotoMuffin
RotoMuffin
I use .ase (from 3dsMAX) all the time. It looks like .asc is a 3ds DOS format and completely different. Do people still use 3d Studio DOS?
Oniera
Oniera
I have to agree with Mr. Goat here. (the Anal one)I tackled this file format back in January, and the experience of creating a parser for the file will COMPLETELY change your understanding of 3D Studio. Parsing the file is easy as long as you have these 2 functions:

1-Create a function to search for a text string
2-Create a function to convert a string of numbers into a float

I don''t bother with the mapping normals, I instead use D3DDLVERTEX. You can get 3DS to spit out the correct vertex order for you. Does this help any?

Rather then giving up (tempting) tell us where you are stuck, and we can help dig you out of your trench.

Demetrios Georgeadis
Director/Programmer
Oniera Software Artists
www.oniera.com
Demetrios GeorgeadisDirector/ProgrammerOniera Software Artistswww.oniera.com
thekid
thekid
Ok I think I have everything loading correctly!!! BUT I have an huge problem now. I cannot get it to the screen. I realize that the coordinate system in my 3d modeler is different from d3d''s (I use TrueSpace3) so how do I get the vector values into d3d vector values? OR am I totally lost? I create 3 D3DVERTEXes (any type) then create them with there initializers using a D3DVECTOR type with the x,y,z coordinates from the file. I am so lost I have been working on this loader for 4-days solid and I am so STUCK

any help would be very appreciated
Oniera
Oniera
I would recommend that you manually go in and check the ''winding order'' of the vertexs (vertai for plural?) Each triangle should have its points described in a clockwise order, this tells D3D which side is the front (normal). The back side is never drawn of course. If the vertai are not described in a clockwise fashion you have to get TS to tell you the normals. (pain in the bum)

I would also recommend that you manually create a directional light source initially so you can find your loaded objects no matter where they are.

Good Luck!

PS (sorry if this got posted twice)

Demetrios Georgeadis
Director/Programmer
Oniera Software Artists
www.oniera.com
Demetrios GeorgeadisDirector/ProgrammerOniera Software Artistswww.oniera.com
thekid
thekid
How do you go clockwise in 3D shure its easy in 2d but how do you know when to skip to the back face?

Maybe I am still way to confused
thekid
thekid
Can someone PLEASE point me to source code!!!! I have been working on this for hours and I do not think I am any closer to a solution.

PLEASE???!!!?!?!?!??!

I AM DESPERITE HERE!!!!!!!!!!
Oniera
Oniera
"Programmin'' ain''t like dusting crops boy!" If you do not understand the way 3D engines work, then getting someone else''s code is not going to help you!

CLOCKWISE= plot the triangle on a graph then connect the dots starting with the point to the top left.
IGNORE the Z coord.

look at these points:
a)-25,50,40
b)-5,-5,0
c)5,22,10

The correct ordering is: a,c,b.

Hope this helps. Good Luck

Demetrios Georgeadis
Director/Programmer
Oniera Software Artists
www.oniera.com
Demetrios GeorgeadisDirector/ProgrammerOniera Software Artistswww.oniera.com

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.