CGA rule that assigns obj file to building footprint

526
4
Jump to solution
04-11-2014 09:15 AM
RyanMalo
New Contributor
Hey everyone,

Im pretty new to City Engine and am wondering if it is possible to create a CGA rule that will apply an .obj file to an existing building   foot print......The .obj is a building that has already been modeled in other software.....I basically I have several building foot prints in the correct geo-referenced location and I would like to assign a separate obj file to each footprint.......meaning a separate rule for each one. Also does the start rule have to be "Lot" or "Generate" or does it matter?

Thanks!
0 Kudos
1 Solution

Accepted Solutions
MatthiasBuehler1
Frequent Contributor II
attr myBuildingFootprint = "assets/myFolder/myAsset.obj"  Lot -->     s(0,0,0)     i(myBuildingFootprint)     center(xz)     Footprint.


Hi,

sorry, made a little booboo. center(xz) needs to go after the insert.

for texturing is easy too.

check the CGA reference for:

setupProjection()
projectUV()
texture()

ok ?

View solution in original post

0 Kudos
4 Replies
MatthiasBuehler1
Frequent Contributor II
Hi !

That's easy ..

Something like ..

attr myBuildingFootprint = "assets/myFolder/myAsset.obj"

Lot -->
    s(0,0,0)
    center(xz)
    i(myBuildingFootprint)
    Footprint.


Let me know if this helps ..

Btw. did you see the tutorial videos ?
0 Kudos
RyanMalo
New Contributor
Thanks a bunch....ya that was super simple thanks.......Now I just need to figure out how to texture the obj. file and center it over the building foot print.......I realize this is simple stuff but like I said I'm pretty new to creating CGA rules.
0 Kudos
MatthiasBuehler1
Frequent Contributor II
attr myBuildingFootprint = "assets/myFolder/myAsset.obj"  Lot -->     s(0,0,0)     i(myBuildingFootprint)     center(xz)     Footprint.


Hi,

sorry, made a little booboo. center(xz) needs to go after the insert.

for texturing is easy too.

check the CGA reference for:

setupProjection()
projectUV()
texture()

ok ?
0 Kudos
RyanMalo
New Contributor
Awesome thanks a bunch!!
0 Kudos