Wrp File Format - 4WVR – Talk

From Bohemia Interactive Community
Revision as of 14:42, 17 April 2007 by Planck (talk | contribs) (Reverted edits by LcwIkm (Talk); changed back to last version by Hoz)
Jump to navigation Jump to search

note to self via vektorbosen

When trying to view the elevations I realized, that the elevations aren't short values as A-Lone-Wolfs doc implies.

After watching some hex-values, I found some formulas, that should reflect the values right.

w_e: elevations as in 4WVR wrp file f_e: elevations with floating point value

When I create some elevations and want them to convert to Wrp-elevations I'm using the following formula:

w_e = (short) ((f_e / 0.05) * 1.1111)

Ok, when I want to convert them back I am using something like this:

f_e = floor( w_e / 22222.0f ) * 1000 +

      floor( (w_e mod 22222.0f) / 2222.2f ) * 100 + 
     floor( (w_e mod 2222.2f) / 222.22f ) * 10 + a.s.o.

--ook? 13:50, 13 July 2006 (CEST)