webscene and transparency

3216
9
05-08-2014 03:24 AM
johnbrosowsky
Occasional Contributor II
In my city engine scene I make rooftops transparent in order to see into the buildings from the top.  When I export to a web scene, the rooftops in web viewer are solid.  How can I make the web scene observe the transparency?
Tags (2)
0 Kudos
9 Replies
LukeCzar
New Contributor III
Hi John,


How did you make them transparent? is it a sketchup model? did you use RULES to make those building transparent?



Lukasz
0 Kudos
johnbrosowsky
Occasional Contributor II
I imported a shapefile containing building footprints, and then used a simple rules cga to extrude the building footprint polygons, and assign color and opacity to floor, roof, and walls:

attr Height = 10

@StartRule

Lot--> extrude (Height)

comp(f){side: Facade | bottom: Floor | top: Roof}

Roof -->
set(material.color.a, 0)
color("#CDB38B")

Facade -->
color("#909090")

Floor -->
color("#F7F8E0")
0 Kudos
MatthiasBuehler1
Frequent Contributor
try :

set(material.opacity, 0.3)



matt
0 Kudos
johnbrosowsky
Occasional Contributor II
It still does not work.  I see the partial opacity in the City Engine desktop, but in exported web scenes or collada models.
0 Kudos
MatthiasBuehler1
Frequent Contributor
can you post some precise screenshots of what needs to be transparent and how it looks both in CE and in the WebScene ?

are textures involved that need to be transparent ?


let me know ..

matt
0 Kudos
johnbrosowsky
Occasional Contributor II
There are no textures.  I imported a shapefile of building footprints, extruded into 3D, and set the top to be transparent using the simple CGA rule I pasted above.  Attached are pictures.  The .cej shows a transparent roof.  When I export to 3ws or collada the roof becomes solid.
0 Kudos
MatthiasBuehler1
Frequent Contributor
Hi,


sorry for the trouble...


can you please try 1 single rectangular shape with this code:

Shape -->
      extrude(5)
      set(material.opacity, 0.5)



this should work in any case. it works for me here.

let me know ..

matt
0 Kudos
johnbrosowsky
Occasional Contributor II
That works!  Is it possible to get the polygons extruded from the imported shapefile to look the same?

Thanks a lot!
0 Kudos
MatthiasBuehler1
Frequent Contributor
Sure .. that should work.


So it seems something goes wrong with your CGA code ..

Just copy-paste my code into your code and this should work then.

Maybe start a fresh rule with this as a base. ok ?

Matt
0 Kudos