codyslater

Custom Light Source

Discussion created by codyslater on Mar 19, 2018
Latest reply on Mar 19, 2018 by zdseagle-co-nz-esridist

I've designed my buildings to have lights on them, they appear in the attached photo.  I'm wondering if there is a way to make those lights actually functional (shine, if you will) using CGA.  I'm also open to importing a .obj or .dae model if that will offer a valid solution.  My light operation is as follows:

#LIGHT#
Light --> split(y) {~1.1: X. | .4: LightBox | ~1: X.}
     LightBox --> offset(-0.02) comp(f) {inside: LBInner | border: LBOuter}
          LBOuter --> extrude(0.025) comp(f) {all: DarkGrey}
LBOuter2 --> extrude(-0.025) comp(f) {all: DarkGrey}
          LBInner --> extrude(.15) comp(f) {top: LightTop | bottom: GreySplit3 | left: GreySplit2 | right: GreySplit | front: NIL | back: DarkGrey}
               GreySplit --> split(x) {~.2: NIL | ~.8: YellowGlass | ~1: DarkGrey}
               GreySplit2 --> split(x) {~1: DarkGrey | ~.8: YellowGlass | ~.2: NIL}
               GreySplit3 --> split(y) {~.1: LBOuter2 | ~.9: GreyEx}
                    GreyEx --> extrude(-.15) comp(f) {top: NIL | bottom: DarkGrey | left: NIL |right: NIL | front: YellowGlass | back: NIL}
               LightTop --> split(y) { ~.2: NIL | ~.8: LightShed | ~1: GreyShed}
                    GreyShed --> roofShed(25, 2) comp(f) {top: DarkGrey | bottom: NIL | left: DarkGrey | right: DarkGrey | front: NIL | back: NIL}
                    LightShed --> roofShed(25,0) comp(f) {bottom: NIL | all: YellowGlass}
               YellowGlass --> setupProjection(0, scope.xy, scope.sx, scope.sy) projectUV(0) color("#65614c") texture("")
                set(material.specular.r, 1)
               set(material.specular.g, 1)
               set(material.specular.b, 0)
               set(material.ambient.r, 1)
               set(material.ambient.g, 1)
               set(material.ambient.b, 0)
               set(material.reflectivity, 0)
               set(material.opacity, .3)
               set(material.shininess, 50)

not included is the operation "DarkGrey" which is a simple coloring operation.

 

That code, along with the rest of the rule, gives me a building with lights extruded from them.  (See pic)

Attachments

Outcomes