- First, let’s take a look at the effect of Unity loading 3mx and osgb formats.
- First, use the oblique photography model in 3mx and osgb format generated in the previous chapter. The address of the previous section is: Unity Oblique Photography Development-Aerial Image Generation 3mx and OSGB Model_Virtual Reality (Mote) Blog-CSDN Blog
- Using the Software
- Unity3d
- OSGBImporter (unity3d plug-in, you can download it from the Unity Mall, download address: OSGBImporter | Utilities Tools | Unity Asset Store
- Use Unity to create a URP rendering pipeline project (the plug-in supports the default rendering pipeline and HDRP rendering pipeline. The author uses the URP rendering pipeline here to facilitate WebGL and mobile terminals to load models), and import the OSGBImpporter plug-in.
- Copy the oblique photography model in 3mx format generated in the previous section to the StreamingAssets/ConvertDatas directory of the project.
- Open the case scenario (03_SimpleDemo) that comes with the OSGBImport plug-in, select the ImporterManager game object, and modify the URL
- After running Unity, we found that the oblique photography model was not within the camera's field of view. We found the oblique photography model in the Scene window. After adjusting the field of view to a suitable position, we selected the Main Camera object, first disabled the ControlCamera script, and then pressed control+shft+f Press the button to align the camera to the current perspective and copy the camera's Transform data
- Stop Unity from running, select the camera object, and paste the data copied in the previous step, as shown in the figure below
- If it is URP and HDRP rendering pipeline, you need to create a light in the scene
- If you use the URP rendering pipeline to publish WebGL and mobile terminals, you need to add material.shader = Resources.Load<Material>("Materials/RenderMat").shader; to OSGBImporterLoader.cs, as shown in the figure below
- Load the OSGB format model. Note that the OSGBImporter plug-in only supports the window segment to read the OSGB format. It is mainly used for high-performance reading of the osgb oblique photography model.
- Open the 01_SimpleDemo case project in the OSGBRead directory
- If the following script is missing, drag ReaderOSGB into it and replace it.
- Configure the OSGB file path, note that it is the Data directory
- Refer to steps 7~9 to adjust the initial position of the camera. The following figure shows the adjusted camera parameters.
- Attach effects
Unity oblique photography development-Unity loads oblique photography models in 3mx and osgb formats
Guess you like
Origin blog.csdn.net/fengzi1103771698/article/details/132391817
Recommended
Ranking