Texture deterioration in City engine

368
1
01-20-2018 08:21 PM
JayakumarKamalakkannan
New Contributor II

Hi,

I am trying to build a model in city engine for feature class called "Landscape" . Using texture method I render one jpg file. After rendering in city engine the texture get collapsed (ref attached snapshot). The CGA is as follows:

attr textureScaleX =100
attr textureScaleY = 100
const facadeDirectory = "assets/BrickWoodStone/"

Landscape -->
comp(f) {object.top: Landscapeface}

Landscapeface -->
setupProjection(0, scope.xy, textureScaleX, textureScaleY)
projectUV(0)
texture(facadeDirectory + "Landscape.jpg")

JPG file size is 56kb.

Kindly let me know how to resolve this issue.

Regards,

K.Jayakumar

0 Kudos
1 Reply
CherylLau
Esri Regular Contributor

Maybe the shape that you're trying to put the texture on is in xz instead of xy.  Try this:

rotateScope(0, 90, 0)
setupProjection(0, scope.zx, '1, '1)
texture("builtin:uvtest.png")
projectUV(0)

Using scope.zx instead of scope.xy in setupProjection() means that the u direction will correspond to the z axis, and the v direction will correspond to the x axis.  The rotateScope() operation makes it so that u will go along the shape's original x axis, and v will go along the shape's original z axis.  You can take out the rotateScope if you're happy with u corresponding to z and v corresponding to x.

To see the shape's scope, use the Model Hierarchy (Window -> Show Model Hierarchy -> Inspect Model -> select shape in viewport).

Working with the Model Hierarchy Explorer 

0 Kudos