Tilt photography OSGB format files, tricky, need to put osgb into UE for rendering today. The problems encountered are as follows:
1, after the osgb file is imported in, the Z axis doesn't want to be on, it's crooked, and the villain stands diagonally on the road when it's put in.
2, the root cause is the coordinate system, UE's plugin cesium for UE supports WGS84 coordinates (wkid:4326).
How do we solve the problem?
1, of course, is to ask the GPT ah, engage in quiz, see what answers it out, the results, very pull across.
2, direct conversion: osgb coordinate system transformation through osgbLab software, used, can succeed, however, is false success. Open with other software to see, will find that the conversion is not right at all, with polar coordinates.
3. GDAL, a nice library, however, doesn't work either.
The question arises: how does it work?
Of course it's indirect projection!
1, Convert osgb to obj format. Use osgbLab tool to convert the success of tilt photography to an obj, big several hundred MB.
2, obj for format conversion, see code. Note the modification with.Core function: find the coordinate part of the obj code and transform the coordinate system.
# -*- coding: utf-8 -*- import pyproj # Initialize the coordinate system converter transformer = .from_crs("EPSG:4528", "EPSG:4326", always_xy=True) with open('', 'r') as infile, open('', 'w') as outfile: for line in infile: if ('v '): # Processing vertex information parts = () x, y, z = map(float, parts[1:4]) # Performs coordinate system conversions x, y = (x, y) (f"v {x} {y} {z}\n") else: (line)
3, the use of osgbLab format conversion, obj to osgb. So far, the curve is complete.
Related Notes:
Introduction to obj format /dzmsjs/p/18389082