Wrp File Format - 4WVR – Talk
Jump to navigation
Jump to search
mNo edit summary |
|||
Line 14: | Line 14: | ||
Ok, when I want to convert them back I am using something like this: | Ok, when I want to convert them back I am using something like this: | ||
f_e = floor( w_e / 22222.0f ) * 1000 | f_e = floor( w_e / 22222.0f ) * 1000 | ||
floor( (w_e mod 22222.0f) / 2222.2f ) * 100 | floor( (w_e mod 22222.0f) / 2222.2f ) * 100 | ||
floor( (w_e mod 2222.2f) / 222.22f ) * 10 | floor( (w_e mod 2222.2f) / 222.22f ) * 10 a.s.o. | ||
--[[User:Mikero|ook?]] 13:50, 13 July 2006 (CEST) | --[[User:Mikero|ook?]] 13:50, 13 July 2006 (CEST) |
Revision as of 23:13, 12 April 2007
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)