Coordinate Systems
When working with Voxel Farm projects, it is possible to encounter up to three different coordinate systems. These systems are:
- Project’s native coordinate system. These are the real-world coordinates, typically involving an Earth ellipsoid model (WSG84, etc.) a projection system (UTM, Mercator, etc.) and other additional parameters. In most cases, these are right-hand systems with Z coordinate going up.
- Voxel Farm’s internal coordinate system. This is a coordinate system that is used by all Voxel Farm components. It is equivalent to OpenGL’s system (right-handed, Y-up) but it does not contain negative coordinates.
- Rendering engines impose their own coordinate system, for instance, Unity is left-handed, Y-up.
Whenever necessary, it is possible to convert from project coordinates to Voxel Farm coordinates, and vice versa, by using the VoxelFarmAffineTransform class.
The class must be initialized with the project’s coordinate system and the voxel size. Once initialized, the “VF_TO_WC()” and “WC_TO_VF()” functions provide coordinate conversions from one system to another.