how can texture,such as lawn, fit terrain well

6831
14
08-22-2013 10:43 PM
qingyangliu
Deactivated User
Hello!
  I want to add some lawn to my scene,but I find it can't fit terrain well when looking at it in a close distance. The terrain is DEM.
  This is my CGA:
    Lawn -->
setupProjection(0,scope.xz,~15,~15)
texture("images/lawn.jpg")
projectUV(0)
[ATTACH=CONFIG]26905[/ATTACH]
Tags (2)
14 Replies
MatthiasBuehler1
Deactivated User
Hi,

Texturing does not change the geometry.

Your specific issue is that you need to align the terrain back to the shapes.

check the CE manual on :

- align shapes to terrain
- align terrain to shapes

ok ?

m.
0 Kudos
qingyangliu
Deactivated User
Hi,
  To be honest,I have used both of them and tested many settings of them. I find that if the shapes are flat,it works very well.However,the shapes and the terrain don't fit well each other on the contrary.
  For example,there is a hill. Firstly, I use align shapes to terrain and align terrain to shapes next. Then I find only vertices around the shape get the elevation but the middle of the shape can't get the elevation from terrain and it likes a interpolation between the vertices.Finally,the hill becomes flat.What's more,align terrain to shapes doesn't work well if the shapes aren't flat such as lower terrain.
  Is there anything wrong and if there are better parameter combinations?
thanks
[ATTACH=CONFIG]26953[/ATTACH]  [ATTACH=CONFIG]26954[/ATTACH]  [ATTACH=CONFIG]26955[/ATTACH]  [ATTACH=CONFIG]26956[/ATTACH]
0 Kudos
MatthiasBuehler1
Deactivated User
Hi,


Yes, if you align a shape to the terrain, only the vertices are considered, since the vertices define the polygon.

If you need the shape to adapt more precisely to the hill, you need to subdivide the shape more, to produce more vertices.

Also, pay attention that you don't work with too detailed shapes. Your shape geometry seems to have a LOT of points. Maybe reduce the precision on those.

If you do not care about the topology in the end of the textured Model, what you could do is use 2 CGA rules :

1] 1 rule for the texturing itself, as you already have it.
2] 1 rule which only subdivides your BIG shape into smaller bits in X and Z, just as a preprocess. With this code :

attr dim = 10

Cutter -->
    split(x, noAdjust) {~dim : split(z) {~dim : Cut. }* }*


This code only cuts the shape in little quadrangles. Use the Right-Mouse-Button to convert this grid back to a shape. Align then that new shape to the terrain and assign rule 1] for the texturing.


Hope this makes sense.
0 Kudos
JugalPatel
Deactivated User

I'm using your code to try to split up my polygons into a grid so that I can better align it to the terrain. However, you say to use the right mouse button to convert this grid back to a shape. What exactly do you mean? I do not see any option to convert the grid back to shape.

Matthias Buehler

0 Kudos
CherylLau
Esri Regular Contributor

Maybe you are looking for Shapes -> Convert Model to Shapes

0 Kudos
JugalPatel
Deactivated User

Ohh okay, I am starting to understand now. Do you know if it's possible to get rid of this grid though?

fishnet grid.png

I want it to look more like this layer but with the detail from the grid above

no grid.png

0 Kudos
CherylLau
Esri Regular Contributor

For terrain, set the Wireframe Alpha (in the Inspector) for the terrain layer to 0.

Or for models, turn off the wireframe on models in the Settings drop down in the Viewport (keyboard shortcut 7).

0 Kudos
JugalPatel
Deactivated User

I tried turning off the wireframe on models in the Settings drop down in the Viewport but this is what I'm seeing now. It looks different but the grid is still there. Also the layer that makes up this golf course is a shape and not a model. I imported it originally as a vector polygon, then applied the CGA code that Matthias Buehler posted above to split it into a grid. Then I used Shapes -> Convert Model to Shapes on the golf course layer, and then turned off the wireframe on models in the Viewport settings window as you said.

wireframe off.png

0 Kudos
CherylLau
Esri Regular Contributor

Wireframe is usually black (unless you change it in the preferences).  I think the gray outlines are there because they are the faces of the shape(s) you made.  I would suggest applying a rule file, which could be as simple as just coloring the shape green such as Shape --> color(0,1,0), to the shapes and then hiding the shapes.

0 Kudos