aleatorylamp
Charter Member
Hello folks,
This would be the continuation of a subject recently started on the "Conspicuous by their Absence" Thread.
Ivan had commented on some small and extremely practical utilities he had written in "C" and using batch files, with which he could make some dreary and long AF99 operations very easy and fast. For example, re-scaling the whole aircraft or moving it to an improved position.
These small programmes involve very simple mathematical actions on aircraft elements present in a given directory, and I was immediately inspired to try and produce similar programmes using QBasic.
I know QBasic is one of the most outdated programming languages, considered by most as only good for Kids, but not even that, because why show them something useless when there´s more modern stuff like "C" and "C++" around...
Well, OK, granted, but I haven´t learnt anything else, and QBasic is the only thing I can understand and use to any effect.
It does have tremendous power to manipulate strings and files though, except perhaps for extracting file names from directories, which I haven´t found the way to do yet. Maybe it isn´t possible.
As a result, I can´t write small QBasic programs that act on all part files stored in one directory, to re-scale or re-position them one after the other, in one go.
However, it could be done acting on the whole AFX. All the vertices are present - they aren´t in the AFA, AFC or AFS files - only the AFP Aircraft Part files show vertices, and so does the AFX.
So at the moment, I have got as far as identifying all the lines containing information on vertices present in all the parts corresponding to everything in the AF99 aircraft. ...all except the templates for structures, which is a different matter.
I have also been able to isolate the three x,y,z coordinates for each vector. Now I have to turn them into real numbers, apply some maths to the needed ones, turn them back into text and re-insert them into the string to re-build a new AFX.
The problem with Structures is that they have a different Syntax, so the name of the type of bulkhead template between the first two inverted commas type will serve as identifiers. Maybe I´ll use the firs three letters of the bulkhead names, as the shortest is "Vee". Then, there are only two coordinates for the templates, so I still have to study which is what.
They must also be processed. As the AFX, when unpacked, actually generates all parts, I doubt that un-processed bulkhead vertices will work properly with processed Structure part vertices!
Then there is a mysterious short line with a confusing "", syntax, which however does not correspond to a vertice. It may be the reference number of the Family that the component or Structure is grouped into, as the numbers do not depend on the position and repeat themselves in other models as well.
There are 8 possible numbers: 83, 84 (left-right?), 10 (low wing facing down?), 12 (mid wing facing up?), 26 (canopy?) and 13, 17 (both aft?) and 36 (body?). Ah dunno yet completely, but probably it won´t matter and won´t need processing.
Anyway, here´s a screenshot of my progress so far. The different colours show the vertex numbers. The only ones missing are the Template Structures that have only two coordinates.
Cheers,
Aleatorylamp
This would be the continuation of a subject recently started on the "Conspicuous by their Absence" Thread.
Ivan had commented on some small and extremely practical utilities he had written in "C" and using batch files, with which he could make some dreary and long AF99 operations very easy and fast. For example, re-scaling the whole aircraft or moving it to an improved position.
These small programmes involve very simple mathematical actions on aircraft elements present in a given directory, and I was immediately inspired to try and produce similar programmes using QBasic.
I know QBasic is one of the most outdated programming languages, considered by most as only good for Kids, but not even that, because why show them something useless when there´s more modern stuff like "C" and "C++" around...
Well, OK, granted, but I haven´t learnt anything else, and QBasic is the only thing I can understand and use to any effect.
It does have tremendous power to manipulate strings and files though, except perhaps for extracting file names from directories, which I haven´t found the way to do yet. Maybe it isn´t possible.
As a result, I can´t write small QBasic programs that act on all part files stored in one directory, to re-scale or re-position them one after the other, in one go.
However, it could be done acting on the whole AFX. All the vertices are present - they aren´t in the AFA, AFC or AFS files - only the AFP Aircraft Part files show vertices, and so does the AFX.
So at the moment, I have got as far as identifying all the lines containing information on vertices present in all the parts corresponding to everything in the AF99 aircraft. ...all except the templates for structures, which is a different matter.
I have also been able to isolate the three x,y,z coordinates for each vector. Now I have to turn them into real numbers, apply some maths to the needed ones, turn them back into text and re-insert them into the string to re-build a new AFX.
The problem with Structures is that they have a different Syntax, so the name of the type of bulkhead template between the first two inverted commas type will serve as identifiers. Maybe I´ll use the firs three letters of the bulkhead names, as the shortest is "Vee". Then, there are only two coordinates for the templates, so I still have to study which is what.
They must also be processed. As the AFX, when unpacked, actually generates all parts, I doubt that un-processed bulkhead vertices will work properly with processed Structure part vertices!
Then there is a mysterious short line with a confusing "", syntax, which however does not correspond to a vertice. It may be the reference number of the Family that the component or Structure is grouped into, as the numbers do not depend on the position and repeat themselves in other models as well.
There are 8 possible numbers: 83, 84 (left-right?), 10 (low wing facing down?), 12 (mid wing facing up?), 26 (canopy?) and 13, 17 (both aft?) and 36 (body?). Ah dunno yet completely, but probably it won´t matter and won´t need processing.
Anyway, here´s a screenshot of my progress so far. The different colours show the vertex numbers. The only ones missing are the Template Structures that have only two coordinates.
Cheers,
Aleatorylamp