Texture problem. Need help. I cannot apply a seamless texture to the entire surface.

1014
3
Jump to solution
11-18-2022 03:15 PM
MikeJane
New Contributor III

   Hello. I'm working on a rule. But when I started working with 3d terrains instead of 2d terrains, the problem started.I define and extrude the building area on the parcel and make facade definitions. Such as window, entrance, wall, etc.

   I didn't use setupProjection because the surface was divided into too many parts when I was doing Texturing on the walls. It was enough to use projectUV(0) because I use seamless textures.But when plots were formed on 3d surfaces, I got help from the Align shapes to terrain process. In this way, my parcels fit perfectly on the land surface. But I need to use the wordupFlatTop command in order for the building to be flat.

   The problem started here. The projectUV(0) operation is probably referencing the surface. Even if the building is flat, the textures where the reference is crooked are not compatible with the building.

   When I use it as setupProjection(0, scope.xy, 1, 1), it does not give a seamless image because it processes each wall from scratch. But at least it is compatible with the building, not angularly incompatible.

   When I use it as setupProjection(0, world.xy, 1, 1) it actually gives exactly the result I want, but a coating problem arises that I don't know why. A flickering image emerges as if the textures are intertwined hundreds of times.

   I have attached the sample images below, it will be clearer when you look at it. How can I make a texturing that will be both seamless and properly formed according to the building without considering the angular condition of the terrain?  Maybe it's a simple process, but I've been struggling with these for 2-3 days and couldn't find a solution. Could you please help?

 

Example1.pngExample2.pngExample3.png

 

 

 

 

 

 

 

0 Kudos
1 Solution

Accepted Solutions
MikeJane
New Contributor III

   I found the solution. I guess defining the setupProection at the very beginning of the rule solves the problem. While defining the facade, the walls were divided into too many parts because there were many split operations. I got the desired result when I did the setupProjection before the split and then continued.

   Maybe there are other solutions, let it stay open for 1-2 days, then I will close it because it is solved. Btw , I couldn't figure out why setupProjection(0, world.xy, 1, 1) doesn't work properly for me. If anyone knows, it would be nice to share. Textures appear distorted or faded. It's like it's overlapping.

View solution in original post

0 Kudos
3 Replies
MikeJane
New Contributor III

   I found the solution. I guess defining the setupProection at the very beginning of the rule solves the problem. While defining the facade, the walls were divided into too many parts because there were many split operations. I got the desired result when I did the setupProjection before the split and then continued.

   Maybe there are other solutions, let it stay open for 1-2 days, then I will close it because it is solved. Btw , I couldn't figure out why setupProjection(0, world.xy, 1, 1) doesn't work properly for me. If anyone knows, it would be nice to share. Textures appear distorted or faded. It's like it's overlapping.

0 Kudos
CherylLau
Esri Regular Contributor

Align the scope to world.y

Your solution of doing setupProjection on the facade before it is split is the way to do it.  If you align the scope to the world y axis using alignScopeToAxes(y) before setupProjection, then the texture should not be slanted regardless of whether the building is on a hill or not.  In your example screenshot above, the slanted texture on the building on a hill is because the scope's x axis aligns to the facade's edge which follows the uphill terrain.  Aligning the scope to the world y axis straightens out the scope vertically.

 

alignScopeToAxes(y)
setupProjection(0, scope.xy, 1, 1)

 

 

What happens with world.xy

The reason why you might see distorted textures with setupProjection(0, world.xy, 1, 1) is because this projects the UVs onto the world.xy plane, and your building's facade might not align exactly with world.xy.  This means the texture will look undistorted when the surface that you are texturing aligns perfectly with the world.xy plane.  The more you rotate the building (around the y axis), the more the texture will look stretched, until you reach a rotation of 90 degrees where the facade aligns with the xz plane and the texture is maximally stretched.  Since buildings usually don't align exactly to world.xy, I would not recommend setting up the projection according to world.xy.

MikeJane
New Contributor III

Thank you for the information. I will consider it in my future work.

0 Kudos