Docs/PlanetTextures.pdf there is .tree format description. That saysThe compressed data size of node i can be inferred from node[i+1].pos − node.pos, where
node[i+1].pos must be replaced with dataLength for the last node.
Textures\Earth\Archive\Surf.tree TreeNode's pos property I expect they values should not different too much but unfortunately it is Difference between first two values (0
141910014427136
4
17179869183
-1
25769803775
-4294833034
288540197912576
36159
309877595439104
10
-1
-1
412316860428
55834709110
288540197912576
105274
452711027834880
79
0 and 141910014427136) is 132.164 GiB. Obviously, my script works incorrectly. But wait I doing wrong?pos with type of __int64/Int64 (with buf.readBigInt64LE);size with type of DWORD/Int32 (with buf.readInt32LE);child.typedef struct TREEFILEHEADER // file header for tree archive data file
{
char id[4]; // ID string + version ('T','X',1,0)
int hdrsize; // header size (48 expected)
int flags; // flags - currently only bit0 is 1 for compressed tree
int arvstart; // archive start address
long long arvlen; // archive length
int nodes; // stored nodes incl. valid root nodes
int root[5]; // root node indices (level 1, 2, 3, 4a, 4b) -1 marks missing nodes
};
typedef struct TREENODEENTRY // quad-tree entry
{
long long arvoffset; // archive start address = header archive start + offset
int length; // uncompressed length, 0 if dummy entry
int q[4]; // quad-tree child indices - -1 marks sub-tree end
int reserved; // reserved, may contain garbage data
};
That works! Thank youYou must be off somewhere in your node size, because it works as described for the treeman code. Here are structs I use there:
Code:typedef struct TREEFILEHEADER // file header for tree archive data file { char id[4]; // ID string + version ('T','X',1,0) int hdrsize; // header size (48 expected) int flags; // flags - currently only bit0 is 1 for compressed tree int arvstart; // archive start address long long arvlen; // archive length int nodes; // stored nodes incl. valid root nodes int root[5]; // root node indices (level 1, 2, 3, 4a, 4b) -1 marks missing nodes }; typedef struct TREENODEENTRY // quad-tree entry { long long arvoffset; // archive start address = header archive start + offset int length; // uncompressed length, 0 if dummy entry int q[4]; // quad-tree child indices - -1 marks sub-tree end int reserved; // reserved, may contain garbage data };
OrbiterConfig.pdf describes BEGIN_OBJECTLIST section that contains an objects. Each object has the pos parameter with type of float vector [x, y, z]. So my question is what does mean the pos on surface? How to define base-relative coordinate (lon/lat) for each object from object list section?The base center point is defined as touching the Gbody sphere on the specified lon/lat coordinates. From there you basically have a tangential plane where the elements are place. AFAIK Orbiter has a left-handed coordinate system, so you take your left hand, assign x to thumb, y to index and z to middle and put them into orthogonal directions (thumb and index shaping an "L" while middle points away). Now imagine that hand placed on the center point of the base, the thumb pointing to the bottom of the plane (south), the index away from the sphere (altitude), and the middle to the right of the plane (east). Right means in parallel to the equator line, bottom means to the pole. Might get wonky at the poles, though.InOrbiterConfig.pdfdescribesBEGIN_OBJECTLISTsection that contains anobjects. Eachobjecthas theposparameter with type of float vector[x, y, z]. So my question is what does mean theposon surface? How to define base-relative coordinate (lon/lat) for each object from object list section?
I think I posted an Excel sheet for that somewhere already. I'll check.Thanks for your lightning fast answers
So, if I draw the surface (.tree) on 2d plane, how I can connect the "local coordinate system" with surface's tile pixels? What is the "local coordinat system"?
Or another words: how many pixels in meter for specified resolution level to define xy-pixel in the tile?