Race Sim Central
Rec.Autos.Simulators Archive

Racer-- DOF1 file loading

8 posts by 3 people · 15 Jul 2001 18:43 UTC - 19 Jul 2001 12:24 UTC

J. Todd Wasson 15 Jul 2001 18:43 UTC#173288
Ruud, I got a little further today with my first 3-D file loader. Figured I'd post this here so others could copy it and ask similar questions too :-) I'm opening up a DOF file in binary as you said to do, reading in 4 bytes at a time and am finding lots of the GOB1's, VERT's, etc., as shown on your site, scattered throughout the file. I'd like to try and get a nothing but a list of triangle vertices loaded for starters. Strange thing though, when doing this with the Ferrari file, I find on only 33 GOB1's, with 33 VERT's. These indicate the beginning of a list of vertices, right? If so, when I hit the first GOB1 and VERT, I check the next 4-byte chunk (after VERT), reading it in as a long integer. This gives the number of vertices coming up. Then, if I start reading in data as floats, I'm getting one vertex at a time from there on out (until some other GOB1 or something similar is hit), right? Problem is, I'm seeing numbers that range from 1*10^-33 to 1*10^+23 at first glance. I'll try loading them as different data types. What approximate range of values should I be seeing here? Thanks, Todd Wasson --- Performance Simulations Drag Racing and Top Speed Prediction Software http://PerformanceSimulations.Com
Whoops! Hold on a second, think I might have just got it. When reading in the vertex data, I was not moving the pointer ahead four byes at a time when moving through the vertex list (reading in as floats). Now, the first 3 sets of vertices shown in the Ferrari "body.dof" file are: (1) 3.363116E-44 (Wrong probably, why? Wrong address?), -.436, .186 (2) .985,-.435,.176 (3) 1.123, .429, .186 Is this right? Thanks, Todd Wasson --- Performance Simulations Drag Racing and Top Speed Prediction Software http://PerformanceSimulations.Com
One more thing :-) Going through the entire file, I'm finding 17940 vertices. Dividing by three would indicate 5980 triangles in the Ferrari. Seems rather high. Is this right? Also, the very first vertex loaded after VERT is still a bizarre number every time. Any idea what I might be doing wrong there? Thanks, Todd Wasson --- Performance Simulations Drag Racing and Top Speed Prediction Software http://PerformanceSimulations.Com
On 15 Jul 2001 18:43:18 GMT, [email hidden] (J. Todd Wasson) wrote: > Ruud, > > I got a little further today with my first 3-D file loader. Figured I'd post >this here so others could copy it and ask similar questions too :-) Ah, gee, I went to Ireland and have been busy on the Racer forum, so it's just now that I saw this. :)
Quoted text (7 lines)> I'm >opening up a DOF file in binary as you said to do, reading in 4 bytes at a time >and am finding lots of the GOB1's, VERT's, etc., as shown on your site, >scattered throughout the file. I'd like to try and get a nothing but a list of >triangle vertices loaded for starters. Strange thing though, when doing this >with the Ferrari file, I find on only 33 GOB1's, with 33 VERT's. These >indicate the beginning of a list of vertices, right?
Yes, vertex information: VERT; vertices (triangle data only) int vertices; float vertex[vertices*3]; BUT make sure that the first 'int32' you read after VERT is the length of the VERT chunk. So it will be sizeof(int)+vertices*3*sizeof(float). This is because you might not handle the VERT chunk, and want to skip it; you can just skip 'chunkLen' bytes. > If so, when I hit the first GOB1 and VERT, I check the next 4-byte chunk >(after VERT), reading it in as a long integer. This gives the number of >vertices coming up. As above, this is probably the chunk length, and only the NEXT (4-byte) integer gives you the number of vertices. Note that the number of actually DRAWN vertices is given by the INDI chunks; since OpenGL can handle indexed vertices (which has some advantages with caching and geometry/lighting), these are used to point into the vertex array and pick out the correct vertex/normal pairs. > Then, if I start reading in data as floats, I'm getting >one vertex at a time from there on out (until some other GOB1 or something >similar is hit), right? You read nVertices*{ float vertex[3] } yes. Don't check for chunk you know about, just read the exact number of vertices. > Problem is, I'm seeing numbers that range from 1*10^-33 to 1*10^+23 at first >glance. I'll try loading them as different data types. What approximate range >of values should I be seeing here? The float should probably not exceed 10 or so; Racer uses 1.0f = 1 meter. Hope this helps, Ruud van Gaal, GPL Rank +53.25 Pencil art : http://www.marketgraph.nl/gallery/ Free car sim : http://www.marketgraph.nl/gallery/racer/
On 15 Jul 2001 19:02:32 GMT, [email hidden] (J. Todd Wasson) wrote: > Whoops! Hold on a second, think I might have just got it. When reading in >the vertex data, I was not moving the pointer ahead four byes at a time when >moving through the vertex list (reading in as floats). Now, the first 3 sets >of vertices shown in the Ferrari "body.dof" file are: > >(1) 3.363116E-44 (Wrong probably, why? Wrong address?), -.436, .186 First might probably be the nVertices integer that you needed. So you're probably using the chunk length as the vertex count (the chunk length is probably about 12x that of the vertex count). That would also explain finding 5900 or so vertices; it's more like 1590 (try Modelers' information button, it gives the #poly's). Ruud van Gaal, GPL Rank +53.25 Pencil art : http://www.marketgraph.nl/gallery/ Free car sim : http://www.marketgraph.nl/gallery/racer/
Ruud!! You went to Ireland and didnt come to visit!! I am offended! :) Ash - see if I care <g> | Ah, gee, I went to Ireland and have been busy on the Racer forum, so | it's just now that I saw this. :) |
On Thu, 19 Jul 2001 12:06:49 +0100, "Ashley McConnell" <[email hidden]> wrote: >Ruud!! > >You went to Ireland and didnt come to visit!! I am offended! :) Ah, ofcourse the Mc should have given your location away. :) Sorry, Ash! ;-) I was in Spiddal, near Galway, but it was quite a hop in, lots of work, a Guinness (too bitter for me, so I switched to Smithwicks and whiskey), and hop out. Ruud van Gaal, GPL Rank +53.25 Pencil art : http://www.marketgraph.nl/gallery/ Free car sim : http://www.marketgraph.nl/gallery/racer/
Ahhh, you were VERY VERY far away.....thats ok then :) If you are ever coming up North anywhere, you have a place to stay! All the best, Ash "Ruud van Gaal" <[email hidden]> wrote in message news:[email hidden]...
Quoted text (17 lines)| On Thu, 19 Jul 2001 12:06:49 +0100, "Ashley McConnell" | <[email hidden]> wrote: | | >Ruud!! | > | >You went to Ireland and didnt come to visit!! I am offended! :) | | Ah, ofcourse the Mc should have given your location away. :) Sorry, | Ash! ;-) | I was in Spiddal, near Galway, but it was quite a hop in, lots of | work, a Guinness (too bitter for me, so I switched to Smithwicks and | whiskey), and hop out. | | | Ruud van Gaal, GPL Rank +53.25 | Pencil art : http://www.marketgraph.nl/gallery/ | Free car sim : http://www.marketgraph.nl/gallery/racer/

Sponsors

Affiliate Links

Sim Gaming Expo MOZA Racing Sim-Lab Fanatec TrakRacer Asetek Internet Privacy From NordVPN Dreamhost Capital One Credit Card Application Fanatical CDKeys Amazon Amazon UK Project Motor Racing iRacing Get your racing gloves, boots and more from Demon Tweeks. Enlist at Roberts Space Industries, developers of Star Citizen and Squadron 42


Back from the ashes since July, 2019. First created in 2001 with the merger of Legends Central (founded 1999) and simracing.dk.

A site by a sort of sim racer, for sim racers, about racing sims. News and information on both modern and historic sim racing software titles.

All products and licenses property of their respective owners.


Facebook Threads Bluesky Twitter Mastodon Instagram YouTube Tiktok Twitch Reddit Google News Apple News Subscribe via WordPress Flipboard eBay

Race Sim Central © 1999-2026 | Some links pay RSC a commission. Advertising does not equal endorsement.Cookie Policy