1 (edited by XiaWuchu 2023-03-22 12:29:32)

Topic: Questions about the anchor location of downloaded terrain

Hello, Alex!

I have encountered another problem.
I first downloaded a large range of terrain using RWT, and then downloaded a small high-precision terrain.
However, the anchor point of the former is in the lower left corner, but the latter is in the center.
This caused me some trouble with coordinate conversion.
How does this need to be set? Why is there such a difference between the two?

In addition, does our plug-in have its own coordinate conversion method about conversion of unity coordinates and true longitude and latitude coordinates?
I added a target on onlineMaps, and then transferred the corresponding position of longitude and latitude in the three-dimensional terrain to generate the target. But I found a significant positional difference between the two. I use my own method to convert, and I feel there is a certain error. I downloaded Google's satellite maps, while I used Mapbox for RWT.
I don't know if my conversion method is not very accurate or if the two map sources are different.  Can I directly apply the downloaded offline satellite images from onlinemaps to the RWT Terrain? HAHA~ Can you give me some suggestions? Be deeply grateful!

By the way, these two plug-ins work well together. They help me a lot, you too.

Re: Questions about the anchor location of downloaded terrain

Hello.

Please tell me more about your problem with coordinate conversion.

No, RWT uses a publicly available conversion algorithm from Google.
See RealWorldTerrainUtils.LatLongToTile.

Please attach your generation settings and object coordinates, I will check it.

Maybe the problem is in your conversion method.
Try using RWT API (RealWorldTerrain.RealWorldTerrainMonoBase.GetWorldPosition) .
http://infinity-code.com/doxygen/real-w … 2c7eeca5b6

Kind Regards,
Infinity Code Team.

Boost your productivity a lot and immediately using Ultimate Editor Enhancer. Trial and non-commerce versions available.

Re: Questions about the anchor location of downloaded terrain

1.I conducted coordinate conversion according to the method you mentioned. But there have been some problems here, and I don't know how to eliminate them. I used the following statement to perform coordinate conversion. Please check the attached image for the error code.

“RealWorldTerrainContainer.GetInstances()[0].GetWorldPosition(FlgtDataSet.Instance._dUAVLon, FlgtDataSet.Instance._dUAVLat, FlgtDataSet.Instance._fUAVAlt, out v3Temp);”

2. Questions about the anchor location of downloaded terrain.
I first downloaded a large range of terrain using RWT, and then downloaded a small high-precision terrain.
However, the anchor point of the former is in the lower left corner, but the latter is in the center.
This caused me some trouble with coordinate conversion.
How does this need to be set? Why is there such a difference between the two?
I didn't actually make any special settings. Generally speaking, where is the anchor point for the downloaded terrain? I have attached the anchor location images of the terrain I downloaded twice. Please check them.

3. Do you mean that the downloaded offline satellite images in onlinemaps cannot be used for the terrain downloaded by RWT? Must I use the satellite image texture automatically downloaded by RWT to attach to the elevation?

Thank you for your help. I feel like I'm not far from success.

Post's attachments

Attachment icon 1679559451457.png 927.64 kb, 41 downloads since 2023-03-23 

Re: Questions about the anchor location of downloaded terrain

1. This could happen in two ways:
a. When you have deleted several generated terrains.
This can be corrected by switching the Inspector to debug mode, and from Real World Terrain Container / Terrains removing all Missing elements.
b. You deleted all or part of Real World Terrain Items components from the generated terrains.
Unfortunately, there is no way to add them back. It simply will not work.
You will need to generate terrains again.

2. No idea. RWT always generates a container aligned to the same corner.
Most likely you manually created a parent for the terrain.
Fixing this is very easy:
- Create an empty GameObject child for terrain.
- Set its position to (0, 0, 0).
- Move this object to the root of the scene.
- Place the terrain inside this object.

3. Unfortunately, I don't understand the question.
If you mean to use Online Maps tiles to generate terrains using RWT, this is not possible.
If you mean to use a texture generated by RWT in Online Maps, then it is possible. If you need I can give you an example how to do this.

Kind Regards,
Infinity Code Team.

Boost your productivity a lot and immediately using Ultimate Editor Enhancer. Trial and non-commerce versions available.

5 (edited by XiaWuchu 2023-03-24 03:17:24)

Re: Questions about the anchor location of downloaded terrain

1. Real World Terrain Items components from the generated terrains are not missing. I just made the terrains downloaded from RWT into  offline assetbundles. In this way, I can only load a few pieces of terrain at a time, which can achieve offline dynamic loading, and can also update the terrain offline. I don't know if this is the reason for the error, so what should I do? Is it that the built-in coordinate conversion algorithm I can't use anymore?

2.2. I did not set a parent object, and the way to download it was the same for both times. I downloaded it several times, but the corners were still in the center.

3.My idea is that RWT can use the texture of Onlinemaps.

Post's attachments

Attachment icon 1679627920995.png 1.84 mb, 34 downloads since 2023-03-24 

Re: Questions about the anchor location of downloaded terrain

1. In that case you need to iterate over all the terrains you have loaded.
Get the RealWorldTerrainItem component from them.
Use Contains method to find an item that contains a coordinate, and use GetWorldPosition of that item.

Kind Regards,
Infinity Code Team.

Boost your productivity a lot and immediately using Ultimate Editor Enhancer. Trial and non-commerce versions available.