Jump to content
COMBATSIM Forum

mikew

Charter Member
  • Content count

    3,821
  • Joined

  • Last visited

  • Days Won

    12

mikew last won the day on June 5 2017

mikew had the most liked content!

Community Reputation

4 Neutral

About mikew

  • Rank
    Maj. General

Recent Profile Visitors

2,357 profile views
  1. mikew

    TAW terrain format

    I'm sure there is no problem with the Z Buffer handling, but not much can be done if the data in it is wrong. The orientation is the least of my worries now. This model specifies 4 vertices, draws a concrete pad under the hanger then reassigns the vertices for the hanger itself. I wasn't expecting that sequence and it will be awkward to fix. That pales into insignificance though when we see the result of 2 textures fighting for the same polygon. As I understand it, a texture can override a shaded polygon in VRML, but you can't have coplanar textures. Hopefully, I've missed the chapter on decals.
  2. mikew

    TAW terrain format

    Well, I'm still cherry-picking which models to attempt, but making some small steps in the time I have. Here's something asymmetrical, but I can't get the same orientation as 3View by inverting either X or Z. In fact if I do that, the Z-buffering seems to fail.
  3. mikew

    TAW terrain format

    I'll just invert Y for now. and will invert Z later if an asymmetrical model looks wrong. That's easier than trying to work it out properly. Now, I just need to move on beyond the simplest terrain type...
  4. mikew

    TAW terrain format

    For the 32 triangles making up the tile, we now have 96 geometry vertices so the triangles are completely independent. I've left the coordinate system as it is, and I get the impression that the texture is being applied to the wrong side.
  5. mikew

    TAW terrain format

    No, they are there because I was too lazy to remove them. I have removed the duplicate polygons from that intermediate data though. It seems that I'm going to have to rebuild the vertex list anyway. I'll remove them then.
  6. mikew

    TAW terrain format

    I'm only dealing with triangles, so just have 3UV pairs. For a simple terrain tile like arablm_1.3, I'm just collecting the vertex information and triangle descriptors into an intermediate format like this: Then knowing the texture is tex_2 from the header, we should have enough information to make a VRML file for the 32 triangles. Obviously, I'm missing something. EDIT: Just noticed your edit. That would explain it...
  7. mikew

    TAW terrain format

    Right now, I'm ignoring those opcode/flags at the start of the file, like these from arablm_1.3: 0000; 00930004 ; If 0093 flag set, jump to line 2 0001; 0000 ; 0002; 002717700008 ; If Distance >6000 then jump to line 5 0003; 007b0004 ; If 007b flag set, jump to line 5 0004; 0000 ; 0005; 00760004 ; If 0076 flag set, jump to line 7 0006; 0000 I'm only dealing with the vertices and polygons for the time being. Something is going extremely wrong with my texture coordinates (or their relationship with the vertices) , but I have no idea what.
  8. mikew

    TAW terrain format

    I don't think there is too much else hidden in the .3 file itself, but we may not understand exactly how the information is used. For instance, the LOD2 shaded quads are described like this: 00020018001700000007 0071000000170001 We've interpreted this as: 1. Draw a flat shaded triangle using palette colour 0x18 between vertices 0x17,0x00 and 0x07 2. Keep 0x18 as the colour, but draw a second triangle at 0x00, 0x17 and 0x01 Now when we fly around, we don't see a constant colour for LOD2 but something more dynamic. That may be because the engine is doing something extra with the 0071 opcode, but I'm not going to worry about that for this exercise. I forgot that the 0015 lines are nested which gives quite a complex behaviour, but again I'm trying not to care about that except to navigate through all paths and suck up all polygon descriptors. Hmmn, I'm going to need to check that after I've handled a .3 file that all lines in the file have been 'touched' by the analysis code to avoid missing anything.
  9. mikew

    Weekend music

    I can do sleep inducing stuff as well...
  10. mikew

    Weekend music

  11. mikew

    Weekend music

  12. mikew

    Weekend music

  13. mikew

    TAW terrain format

    A week later and not much to report... At the moment I'm only using the 3View code for the excellent comments on what the opcodes do. In order to break this down into smaller tasks, I'll make multiple passes through the bytecode which 3View doesn't do. The hardest task is probably getting a list of all possible paths through the bytecode then culling the irrelevant ones in some evaluation step. So far, I've only implemented the simplest case of a basic terrain tile but even this shows up a couple of things to deal with. The only real decision is whether the distance further than 6000 or not (0027 opcode), so this leads to just two paths which in this case are LODs. So if I then 'run' the bytecode with the two cases, I encounter 0015 (rendering order) opcodes in the highest LOD case. As is suggested above, it's best just to extract all the polygons from 0015-TRUE and 0015-FALSE and sort them out in the next step. There are also vertices that are only used for the 0015 decisions, so these need to be culled as well. The other LOD just consists of shaded triangles, but this brings up a time of day problem. The triangle colour depends on the palette, so I'll probably create a different set of files for each time of day. I'm going to have to do a similar thing for the palette/texture combinations anyway by producing a set of BMP files. I've spent most of the limited time I have for TFX setting up a new development environment though. Since I'm using LInux more, I'm finding that Microsoft's VS Code is good in that it looks and works the same on Windows and Linux. That can't be said of my Python code though. It took a while to get the same output on various combinations of Win7/win10/Linux/Python2/Python3/32bit/64bit. The problem was mostly line endings and not putting my print statements in brackets, but Python3 seems to think 5/2=2.5 and not 2.
  14. mikew

    Weekend music

  15. mikew

    Weekend music

×