Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Reading x,y,z value from file&make it to 3d file

Author
Message
Stig Design Stig Magne
20
Years of Service
User Offline
Joined: 23rd Mar 2006
Location: Norway
Posted: 3rd Jul 2012 07:01
Hello its along time since i last whas on tgc foums etc&Programmed in dbpro or dbc but i have learned some new things theory&testing from udemy dbpro tutorials&dbpro books volume 1&2 +the book from same creater os udemy tutorial. i am trying on a thing hope some one can help &understand despite my bad english am Norwegian and syeleksia on wrighting so. Point of post=
i have a text file Vertices.txt and it has alott of values orginally it like this 2.000000
186
222

so but for me to make triangeles eks in dbpro i need to read and jum over lines iam not sure how to do that so i used notepad++ for sorting outr the rubbish lines it whent to this

so it helped alott but there is a space bethwen eatch x,y,z etc
so what i need help with is how i can read x,y,z then jump over the emtpy line then next line x,y,z
and at or at same time it makes a triangle and positying its 3 vertices after x.y.z value then next triangle etc entire text file.
and at end can save it to a 3d moell file .x or some thing so that i can load it in to 3dsmax
if you have done some modding you might see that this is yes from t3ed(Level editor) for Need for speed 3&4 its the exported track vertices file i whant to recreate the track as identikal as possible so best way i think of is to figure this out
i hope that some can help me to get this to work i will give credits for it Best regards StigDesign/StigDesign1
btw i attach the file if it helps

**StigDesign** cheap 3D Modell Pack`s Music-Free music at www.AltBillig.com (for Home&Comersial use)soon other aplication`s
BMacZero
20
Years of Service
User Offline
Joined: 30th Dec 2005
Location: E:/ NA / USA
Posted: 5th Jul 2012 03:38 Edited at: 5th Jul 2012 03:39
You'll want some kind of structured reading logic that can read a certain set of data (X, Y, Z, C) repeatedly. I'll work with the first data set, because it shouldn't be too hard.

You can do this with a WHILE loop and storing each value until you've read all of them, sort of like this:


Then you of course need a way to determine which value you're currently reading, which you can do by parsing the string you read and looking at the first character:


And the number value would be:


Let me know if you need any more detailed help after working with this.

TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 5th Jul 2012 04:19 Edited at: 5th Jul 2012 04:33
Well, the first thing I'd do is check how many vertices there are.



Next check that the number of vertices is valid:



Now before we continue to create the mesh, we need to look at how we're going to structure the memblock. First thing to do is look at the FVF format:



We'll be using XYZ, normals, diffuse (because you have a colour value there), and texture. That should give you a value of 338. This will make each vertex use 36 bytes of data.

Great! Let's read in the data and create the mesh now.



TheComet

Stig Design Stig Magne
20
Years of Service
User Offline
Joined: 23rd Mar 2006
Location: Norway
Posted: 9th Jul 2012 01:42
oh didnt know that i had gotten enny post. thanbx alott
al read them maby test them out laither and if i get it working or not al lett you know

**StigDesign** cheap 3D Modell Pack`s Music-Free music at www.AltBillig.com (for Home&Comersial use)soon other aplication`s
Stig Design Stig Magne
20
Years of Service
User Offline
Joined: 23rd Mar 2006
Location: Norway
Posted: 9th Jul 2012 02:14
Thanx both for post&help i copied your code TheComet
i got error about the code that had with(Next check that the number of vertices is valid so i tried quick to si if i got it fixed but no so i youst removed that code and it worked tested first with 3 lines before all x,y,x and without the 3 lines at start it got compiled&running but it looks extremly wierd lol some triangeles pointing toward center some triangeles seems to be some what right place cuz when i move my camera around i see some sort of Track design but looks like it dont have all or they pointing wrong direction. so what i can test is on got it to a 3d file dbo or .x and import in to 3dsmax you knwo how to add that? yet a gain Thanx alott for post&help both and you (TheComet)

**StigDesign** cheap 3D Modell Pack`s Music-Free music at www.AltBillig.com (for Home&Comersial use)soon other aplication`s
Stig Design Stig Magne
20
Years of Service
User Offline
Joined: 23rd Mar 2006
Location: Norway
Posted: 9th Jul 2012 06:40
i have gotte some what longer i added save mesh command before delete mesh and open it and it looked pretty strange lol i attached it its a image of how it looks

**StigDesign** cheap 3D Modell Pack`s Music-Free music at www.AltBillig.com (for Home&Comersial use)soon other aplication`s
paul5147
20
Years of Service
User Offline
Joined: 11th Jan 2006
Location: Hot & Sunny
Posted: 9th Jul 2012 20:14 Edited at: 9th Jul 2012 20:14
Can you post me up an un-edited copy of the vertex data as i think something has got lost in the editing,and if you have it the *.frd file that t3ed saves out for this track so i can see what it should like.
TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 10th Jul 2012 13:54
Ah, I think I know what's going on. Your list of vertices don't repeat themselves, do they? Every point you have defined is only described once, right?

If so, the information required to know which point connects to which is lost. You'd have to work out some kind of algorithm to find which points belong to each other and join them up again. Either that, or you need to export every triangle with their own separate 3D positions, and don't combine points at the same position into one position.

TheComet

Stig Design Stig Magne
20
Years of Service
User Offline
Joined: 23rd Mar 2006
Location: Norway
Posted: 14th Jul 2012 08:11
hello sure i can pack a example- rocky pass track frd file and orginal vertices exported document. am not sure how to read this and figure it out so :S sorry for lait post. i had things in realife
al attach a zip file. including .frd orginal track file that t3edit can open and in that programm you can edit the track etc used it alott when i modded nfs3&nfs4 tracks hehe. but in some laites version of t3ed(0.07 pre 1.1 Dev 3.6) you can find a export function of vertices& texture i guess texture export either uv cordinates or some thing about what texture nuber on what faces etc. vertices i guessed ity has to do vid the vertices and if making triangeles with thoes vertices cordinates i might get a way of get orginal track to a 3d modell file i can then use for my nfs4 remake in darkbasic pro. i have a physx test pretty ready. i know i have alott of work in front of me getting to know exporting car from 3dsmax and figure out easy way of limbs animating wheels etc. but right now am fokusing on this thing of getting moast as possible from the orginal track`s so. sorry for a lott of info&tekst but whanted to tell so it might help you to know what this is for and how important it is for me to get help and firue out. btw thecomet i have mention you in my google developing plan( https://docs.google.com/spreadsheet/ccc?key=0ApQ_VOJTvW5AdHNBWFkwWFdQcDlZSHZFQzhUUG41SEE#gid=0 )
i chekked yours and thinked i shud make my own like that for my project so.

**StigDesign** cheap 3D Modell Pack`s Music-Free music at www.AltBillig.com (for Home&Comersial use)soon other aplication`s
paul5147
20
Years of Service
User Offline
Joined: 11th Jan 2006
Location: Hot & Sunny
Posted: 14th Jul 2012 19:06
Hi Stig,had a quick look at the zip,i dont have a problem loading in the data now and it is in the shape of the track,but the data is exactly what it says,a list of vertex points,and without an index list to show how they make up the polyies its not a lot of good.
I have a rough idea that the blocks that make up the track are in a 14 x 9 grid,and i know roughly the order in which they are saved.Some of the blocks come out ok but others don't.There is also a lot of scenery data for track side objects mixed in with each block of data.When i get a bit more time ill take a closer look for you.
Stig Design Stig Magne
20
Years of Service
User Offline
Joined: 23rd Mar 2006
Location: Norway
Posted: 14th Jul 2012 23:34
ah ok. i see. yes i think its some cryptic pakked like .qfs file type that had alott of .bmp images inn it litle like .zip or .rar but in its own order i guess there is alott in vertices and might be in the other .txt too+ chekk out t3ed programm i guess 14*9 you have that idea from road block in the editor right? i whud probly without loading the programm right now. Thanx alott for reply. i whud be happy if you can and might get some thing done i will give credit in the nfs remake game this probly goes under Programming or Tools Programming you and thecomet i think i will have in one of thoes 2 chategories under credits. i have gotten ripped& get out the orginal low polygon cars alsoe the textures so thoes things are pretty strait forward. so this is my biggest road block so far and it whud mean alott for me+ it whud make the track even more genuine retro since it whud be all orginall data info i hope you can get it work some how for me if you can or whant to help me i even can pay if you get it work youst for getting the main track out right i alsoe need to do like this on other tracks but even bether if you can get it it whud be amazing if the scenery polygons like tree plates and offcourse right textured& uv mapped. BUT moast important youst the track out best ass possible in worst case i can fix it in 3dsmax on normals uv mapping&add textures so how mutch you whant to try&help you deside but yet again i whud be super glad and probly can pay you some or litle alott of money for the help of getting some thing of thoes important things working. but thanx alott for replys& info+helping in all or enny way

**StigDesign** cheap 3D Modell Pack`s Music-Free music at www.AltBillig.com (for Home&Comersial use)soon other aplication`s
Stig Design Stig Magne
20
Years of Service
User Offline
Joined: 23rd Mar 2006
Location: Norway
Posted: 14th Jul 2012 23:36
ps alsoe mention you now in my google developing plan youst for give credits for the replys&help so far

**StigDesign** cheap 3D Modell Pack`s Music-Free music at www.AltBillig.com (for Home&Comersial use)soon other aplication`s
paul5147
20
Years of Service
User Offline
Joined: 11th Jan 2006
Location: Hot & Sunny
Posted: 16th Jul 2012 22:00
After quite a bit of experimenting i can tell you that each block of data in the vertices file thats exported from T3ED is in a slightly different format,10 blocks in im starting to get annoyed with this.
The only way i can see to get around this is if T3ED can Export just the track vertices without the other objects.
Edit.
Just tried to load this in T3ED and remove every thing but the track,but the export still seems to arrange each block differently.Dont really know where to go from here with it.Its the export from T3ED thats just not consistent enough to make this a repeatable process.I could possibly do 1 track block by block but thats 186 blocks of data,but every other track thats needed would have to be done by hand,and this doesnt include the trackside objects.!!!!
Stig Design Stig Magne
20
Years of Service
User Offline
Joined: 23rd Mar 2006
Location: Norway
Posted: 17th Jul 2012 02:22
hello . oh i see yes i can think its getting alott of fideling and anoying with that. i had a hinc that it whud probly be tons of hard issues thing etc so a other easy way i can think of thhen to get the track out identically as possible is to to use a 3D ripping programm i have one that works but it dont suport the direct x that is ortginally in nfs3 or 4 its noramlly using Direct x 5.0 and ripping software only suports direct x 6.x 8.x 9.x so it can be used for test drive 4,5 and TestDrive off road 2&3 so. i dont supose you know of a way of getting the direct x to be forced to be in 6.0 or some thing?
thats only wqay i can think of a easy way of gettin tracks out.
than for your time on testing and trying for me.

**StigDesign** cheap 3D Modell Pack`s Music-Free music at www.AltBillig.com (for Home&Comersial use)soon other aplication`s

Login to post a reply

Server time is: 2026-07-07 20:22:24
Your offset time is: 2026-07-07 20:22:24