ZhbanyFatty Posted July 24, 2023 Share Posted July 24, 2023 Hello. I'm trying to do 3D-terrain from earth map by framing area (pic .1). For that i'm using code from here https://developer.unigine.com/en/docs/2.17/code/usage/landscape_terrain/index?rlang=cs Then 3d-terrain is complete, i get flipping terrain (like mirror). (pic.2). I'm trying to figure out why terrain is flipping, trying to find parameters or method in landscapes classes that changes or control flipping, but dont "find a way". In result, i solved it by adding in code albedo.FlipX() and height.FlipX(). Question: can it solved by some parameters or method from landscapes or terrain classes? and why is flipping happened? private void OnCreatorCreate(LandscapeMapFileCreator creator, LandscapeImages images, int x, int y) { Image albedo = images.GetAlbedo(); albedo.Create2D(albedoImage.Width, albedoImage.Height, albedoImage.Format, albedoImage.NumMipmaps); albedo.Copy(albedoImage, 0, 0, 0, 0, albedoImage.Width, albedoImage.Height); albedo.FlipX(); Image height = images.GetHeight(); height.Create2D(heightImage.Width, heightImage.Height, heightImage.Format, heightImage.NumMipmaps); height.Copy(heightImage, 0, 0, 0, 0, heightImage.Width, heightImage.Height); height.FlipX(); } Link to comment
bmyagkov Posted July 24, 2023 Share Posted July 24, 2023 Hello! By design an image will be placed inside a texture "as is" but internally it is stored differently. To solve this issue you only need to flip it along the Y-axis as shown in the example below: if (Render::isFlipped()) { texture->flipY(); } Thanks! 1 Link to comment
Recommended Posts