microsoft / AirSim

Open source simulator for autonomous vehicles built on Unreal Engine / Unity, from Microsoft AI & Research
https://microsoft.github.io/AirSim/
Other
16.32k stars 4.55k forks source link

Fix .binvox files being saved with the inverse scale #4710

Open sotpapathe opened 2 years ago

sotpapathe commented 2 years ago

Fixes: no related issue

About

According to the binvox specification the scale stored in binvox should be what the normalized voxel coordinates (in the interval [0, 1]) should be scaled by.

binvox now includes two extra lines in the header (which may be omitted, viewvox and thinvox don't need them): translate \ scale \ First scale (x_n, y_n, z_n) by the scale factor, then translate them by (t_x, t_y, t_z)

This is also how the scale is interpreted in this Python binvox implementation.

How Has This Been Tested?

Tested by using other implementations to read the resulting .binvox files.