I've been creating a bunch of buildings with negative extrusions in CE which works fine with my method below. However, when I checked them in the scene viewer, the buildings were full of holes. How do I avoid this?
Simplified script:
version "2014.0"
Lot-->
extrude(20) Gebaeude
Gebaeude--> comp(f){side: Facade(comp.index) | top: Roof}
Facade(FacadeIndex) -->
case FacadeIndex == 0: Facade000
else: FacadeXXX
Facade000 -->
color(1,0,0)
split (x){
5: side |
5: center |
~5: side
}
center -->
split (y){
5: top |
5: middle | // Would be a single window texture, for example
~5: bottom
}
middle -->
extrude(-1)
comp(f){side: FacadeXXX | top: Undefined} // "Undefined" rule doesn't exist, can be named anything. NIL doesn't work!
FacadeXXX -->
color(rand,rand,rand)
Screenshots:
Scene viewer:
View from inside/bottom:
Solved! Go to Solution.
Hi.
You need to fix the normals of the faces.
Extruding negative reverses the normals. CityEngine by default shows both sides of a polygon. The WebViewer does not to be more efficient.
Rather extrude positively, then translate back.
Ok ?
M.
Matthias Buehler
Head of 3D Technologies
twitter: @MattB3D
-------------------------------
Garsdale Design Limited
matthias.buehler@garsdaledesign.co.uk
Hi.
You need to fix the normals of the faces.
Extruding negative reverses the normals. CityEngine by default shows both sides of a polygon. The WebViewer does not to be more efficient.
Rather extrude positively, then translate back.
Ok ?
M.
Matthias Buehler
Head of 3D Technologies
twitter: @MattB3D
-------------------------------
Garsdale Design Limited
matthias.buehler@garsdaledesign.co.uk
Thanks, that fixed it.
Is it possible to enable this "viewer-view" in the editor?
Yes, activate 'backface culling' in the viewport render settings (cogwheel menu).
Cheers!
Matt
Matthias Buehler
Head of 3D Technologies
twitter: @MattB3D
-------------------------------
Garsdale Design Limited
matthias.buehler@garsdaledesign.co.uk
Great, thanks again