How can I show both sides of a face in the web viewer?

2375
4
01-14-2016 12:45 PM
MicahTaylor
Occasional Contributor III

I have an awkward situation where I need to see through a semi-transparent building using the CE WebViewer.  I can see everything fine in the viewport, but after I export and upload my .3WS file...the "wrong" side of the faces are no longer visible.  Is their a work around?

CityEngine...

CE WebViewer

 

Tags (3)
0 Kudos
4 Replies
by Anonymous User
Not applicable

Do this with the faces in question:

This is because the web viewer does "backface culling". It does this for performance reasons. One thing to do is to turn this on in the CityEngine viewport inside the gear menu - then you will see it as it will appear in the Web Scene. Then you can identify the faces you will need to "fix".

To fix, right after making the face in the CGA, make a copy of the face and move the face in the direction of the backface, very slightly, like 0.01 meters or some small amount, whatever it takes to avoid face clashing. Then do reverse normals, so that the front face shows where you saw through it before.

Like this:

YourFace -->

     ThisIsYourFace.  # The period makes your face become a terminal shape, or a leaf, in the final model.

     t(0,-0.01,0)  # Move the face backwards slightly.

     reverseNormals   # This makes the backface and frontface switch.

     ThisIsTheFaceToShowOnTheBack.  # Period is not needed here, nor is the name for the terminal shape.

So that last line is not required. I just put it there to show that there are two terminal shape in one rule - the front face and a copy of it with reversed normal.

Hope this helps,

Chris

DavidWasserman
Regular Contributor

I think this is a very helpful example Chris. Thanks for the code example.

David Wasserman, AICP
0 Kudos
MicahTaylor
Occasional Contributor III

IT WORKS!!! Thanks! worked for all windows and floors, but I could not get it to work with my outer walls , However, I found out if I apply a small amount of opacity (0.99) to the wall...it shows up at all angles.

by Anonymous User
Not applicable

Interesting visual! Glad it helped!

0 Kudos