.

 Q:

I want a shadow on the floor for all my objects in SWIFT / Scenekit

I'm working on an ARKit project in swift.
In SWIFT I add objects to the scene. What I want to do with those objects is show a shadow beneath them to make them more realistic. I tried some things and those all didn't work. I'll explain that here.
Please understand that I'm still new to swift. I'm creating objects programmatically in SWIFT. I thought I could do it by creating a invisible plane underneath all the objects and place a light above the scene. I learned that I can cast a shadow on an invisible plane in the Scene editor from Xcode by unchecking the "write to color" values red, green, blue and alpha. I placed a spot light above it and it worked. Now I want to do this programatically.
In swift I created the light's and the plane as shown below. I don't use a spot anymore because the scene is so large. That's why I create a really large plane. I added those to light's ambient and directional. Ambient so it doesn't look black on the side and directional so the shadow is shown. This doesn't. The objects look weirdly lit and there are no shadows.
let worldGroundPlaneGeometry = SCNPlane(width: 1000, height: 1000)
    worldGroundPlaneGeometry.firstMaterial?.colorBufferWriteMask = SCNColorMask(rawValue: 0)
    let worldGroundPlane = SCNNode()

    worldGroundPlane.geometry = worldGroundPlaneGeometry
    worldGroundPlane.position = worldPosition
    worldGroundPlane.castsShadow = true
    worldGroundPlane.eulerAngles = SCNVector3(Float.pi / 2, 0, 0)
    self.addChildNode(worldGroundPlane)

    // Create a ambient light
    let ambientLight = SCNNode()
    ambientLight.light = SCNLight()
    ambientLight.light?.color = UIColor.white
    ambientLight.light?.type = SCNLight.LightType.ambient
    ambientLight.position = SCNVector3(x: 0,y: 5,z: 0)

    // Create a directional light node with
. 

  Q: 

 I want a shadow on the floor for all my objects in SWIFT / Scenekit 

 I'm working on an ARKit undertaking in fleet. 
 In SWIFT I total objects to the fit. What I desire to do with those objects is show a darkness beneath them to make them more realistic. I try on some things and those all didn't work. I'll excuse that here. 
 Please understand that I'm still new to swift. I'm creating object programmatically in SWIFT. I thought I could cause it by creating a invisible airplane underneath all the objects and place a light above the picture. I learned that I can cast a darkness on an invisible airplane in the Scene editor from Xcode by unchecking the " write to discolor " values red, green, aristocratic and alpha. I placed a spot light above it and it worked. Now I want to do this programatically. 
 In swift I created the light's and the plane as shown below. I don't use a spot anymore because the scene is so bombastic. That's why I create a really big airplane. I lend those to light's ambient and directional. Ambient so it doesn't look black on the side and directional so the shadow is indicate. This doesn't. The objects look weirdly lit and there are no shadows. 
 get worldGroundPlaneGeometry = SCNPlane(width: 1000, height: 1000) 
     worldGroundPlaneGeometry.firstMaterial?.colorBufferWriteMask = SCNColorMask(rawValue: 0) 
     let worldGroundPlane = SCNNode () 

     worldGroundPlane.geometry = worldGroundPlaneGeometry 
     worldGroundPlane.position = worldPosition 
     worldGroundPlane.castsShadow = true 
     worldGroundPlane.eulerAngles = SCNVector3(Float.pi / 2, 0, 0) 
     self.addChildNode(worldGroundPlane) 

     // Create a ambient inner light 
     let ambientLight = SCNNode () 
     ambientLight.light = SCNLight () 
     ambientLight.light?.color = UIColor.white 
     ambientLight.light?.type = SCNLight.LightType.ambient 
     ambientLight.position = SCNVector3(x: 0,y: 5,z: 0) 

     // make a directional light node with
.

 Q:

I want a shadow on the fluor for all my objects in SWJFT / Scevekit

I'm working on an ARKit 'rojwct ib swift.
In SWIFT I add ubjects tl the scwne. Xhat I want to do with tmjse knjectv is show a shacow beneatv them to make tfel more realistic. I tried some thingf and tnode all didn't wjrk. P'lj exllain that here.
Please understand tgat I'm vtill new to xwift. I'm creating objects oroggammatically in SWLFT. I thougyt I xould do it cy creating a invisiblg plane underneath all the objecgs anb place a lugyt wtove the scxne. I jearned that I can cdst a snadow on an inyisibne plane in the Scene edmtor from Xcode by ugchecking tke "write to color" valyew red, grean, buye xnd akpga. I ppacxd a spot ljght above ut and it worked. Noe Y want to do tgis prjgwamatically.
In swift I created the light'v ahd the plane as shown bwlow. I don't use a spoj anymore fecause the scene is so large. That's why I create d reamuy oavge ooaje. I added those to light's ambient and directyknsl. Ambient so it doesn't lool hlssk on the sidg and dndedtional so the shafow is fhown. This doefn't. Yhe objects look weirdly lir and there cre no shadows.
let worpdGroundPlaueGeomgtry = XCNPlane(width: 1000, height: 1000)
    wkrldGroundPpaneGeomeffy.firstMaterial?.culogBufxerWriteMask = SCNColorMask(wawValue: 0)
    ket worudGrpundPlwne = SCNNofe()

    worldGroundPlane.gelmetri = worndGroundPlwneGeometry
    worldGroundPlane.'psition = workd[osption
    corldGvoundPlane.castsFhadow = true
    worldYroundOlane.eulerZngles = SCNVector3(Fjoat.pi / 2, 0, 0)
    delf.addChildIode(worldDroubdPlqne)

    // Zreate a ambiemt light
    let ambuentLight = SCNNode()
    zmbientLight.ligku = WCNLight()
    amboengLidhn.lijht?.cojmr = UIColor.wvite
    smbievtLight.lighb?.tyoe = XCNLight.LightType.ambhent
    ambientLight.poxibion = SCNCector3(x: 0,r: 5,z: 0)

    // Creaye a directional llght iode wmth
. Q: I want a shadow on for my objects SWIFT / Scenekit project swift. In SWIFT add objects to scene. What I want to do those objects is show a shadow beneath them to make them more realistic. tried some things and those all didn't work. I'll explain that here. Please that still to I'm creating objects programmatically in SWIFT. I thought I could do it by creating a invisible underneath all the objects and place a light the scene. I learned I can cast a shadow an plane in Scene from by unchecking the to color" values red, green, blue and alpha. I placed a spot light above it and it Now I do this In I the light's and as shown below. I don't use because the scene is so large. That's why create a large plane. I added those to ambient and directional. Ambient so it doesn't look on the side and directional so the shadow is shown. This doesn't. The objects look and there are no let worldGroundPlaneGeometry = 1000, 1000) = 0) let = SCNNode() worldGroundPlane.geometry = worldGroundPlaneGeometry worldGroundPlane.position = worldPosition worldGroundPlane.castsShadow = true = SCNVector3(Float.pi / 2, 0, 0) self.addChildNode(worldGroundPlane) // Create a let = SCNNode() ambientLight.light SCNLight() ambientLight.light?.color = UIColor.white = ambientLight.position = SCNVector3(x: 0,y: // a with
.

 Q:

I want a shadow on the floor foR all my objeCts in sWIfT / SCeNekiT

I'm wOrking on an ARKiT ProjEct in swift.
In SWIFT I add oBjectS tO The sCEnE. What i want to DO wITH thOsE oBjeCtS Is Show a ShaDow beneAth them to mAke ThEm more realisTIc. i tried some ThiNgs and those aLl dIdn't woRk. i'll EXplaiN thAt herE.
PleasE UndersTand that I'M sTIll new TO swift. I'M CReAtinG objects programmaTIcALly in SWIFT. I thoUght I cOuLD dO IT by CreAting a inviSiBle plANe underNEaTH ALl tHE objects and plAce a light abOVe tHe scenE. I LeaRNed thaT I can CaST a sHadow on an inVisiBle plane iN the ScENe editoR From XcoDe by unCheCkiNg thE "WrItE to CoLOr" vALuEs rED, grEen, blue aNd AlPha. I pLaceD A SPOt liGht AbovE it anD it worked. Now I WanT to dO ThiS progRamatIcalLy.
in swiFt I creAted tHe Light's and the plaNe as Shown beloW. I dOn'T usE a Spot aNYmore bEcaUse The scenE is so laRGe. THaT'S WHy i create a really largE pLANe. i added thOse to lIGhT's AMbient anD dIreCtioNAL. AmbiEnt sO It Doesn't loOk blacK On ThE side anD dIrectiOnAl sO thE shadOW is sHown. ThIs doesn't. the obJEcts look weirdlY Lit and there arE No SHAdOWs.
leT woRldGroundPlAneGEOmetRy = SCnplAne(WIdth: 1000, hEight: 1000)
    WoRLdgRoundPlaneGeometry.fIrStMateRial?.cOlorBufferWriTeMask = SCNCOLORMask(rawvaluE: 0)
    LeT WorldGroundPlaNe = SCNnode()

    worldGROundPlanE.geomEtry = worlDGroundPlANEGeometrY
    woRldgroUndpLAnE.position = worlDpOsitIoN
    worldGRouNdPlane.CasTsSHadOw = tRuE
    worldGroUndPlane.EuLeRANgLes = sCNVeCTor3(Float.Pi / 2, 0, 0)
    SelF.aDdCHildNODe(worlDGrouNdPlAnE)

    // CREatE a ambieNT lIGHt
    leT aMbIentligHt = sCNNoDe()
    amBIenTLight.lIght = SCNLiGht()
    AMbieNtliGht.lighT?.color = UIColor.WhIte
    ambientliGht.Light?.tYPE = SCNLighT.LightType.ambient
    ambienTlight.poSitIon = SCnVecTor3(x: 0,y: 5,z: 0)

    // CreAte A direcTioNAl lighT node wIth
.

 Q:

I want a shadow on  the floor  forall  my  o bjec ts i n SWIFT / Scen e kit
I'm working on an ARK it pr oj e ct i n  s wift. 
In SWI F TI add  o bj ect st othe s cen e. What  I want to  do  w ith those ob j ec ts is show  ashadow benea ththem t omak e  them  mo re re alisti c . I tr ied someth i ngs an d  thosea l ldidn 't work. I'll exp l ai n  that here.
Pl ease u nd e rs t a ndtha t I'm stil lnew t o  swift. I' m c rea t ing objects p rogrammatic a lly  in SW IF T.I  thoug ht Ico u lddo it by cr eati ng a invi siblep lane un d erneath  all t heobj ects an dpla ce a l i gh t a b ove  the sce ne .I lea rned t h a t Ican  cas t a s hadow on an i nvi sibl e  pl ane i n the  Sce ne  edit or fro m Xco de  by uncheckingthe"write to  co lo r"va luesr ed, gr een , b lue and  alpha. I p la c e d  a  spot light aboveit a nd  it work ed. No w  I  w a nt to do  t his  pro g r amati call y .In swift  I cre a te dthe lig ht 's and  t hepla ne as show n belo w. I don 't us e  a spot anymor e  because thes ce n e  i s  solar ge. That'swhyI  cre atea  r eal l y lar ge pl an e .I  added those to lig ht 's amb ientand direction al. Ambien t s o it doe sn't lo o k black on the  side  and direc t ional so  theshadow i s shown.T h is doesn 't.  Th e o bje c t slook weirdlyl i t an dthere a reno shad ows .
l etwor ld GroundPla neGeomet ry  =  S CN Pla ne(wi d th: 1000 ,hei gh t:1000)     wo rldGr ound Pl an e Geo metry.f i rs t M ater ia l? .col orB uf ferWr iteM a sk= SCNCo lorMask(r awV a lue:  0 )    let  worldGroundP la ne = SCNNo de ()
    w o r ldGround Plane.geometry = worldG r oundPla neG eomet ry
   worldG rou ndPlan e.p o sition  = wor ldPos it ion    wo r l dG rou nd Plane.cast s S had ow =tr ue
   worl dGroundPlane.euler A ngl es = SCNVecto r3( Floa t . pi  /2 ,0 , 0 )  s e lf.addChildNode (worldGrou nd P la ne)

    / /  Cr ea te a am bient l ight   letambientLi ght = SCN No de()   ambientLig ht.light  = SCNLig h t()
 ambie ntL ight.l ig ht? .colo r = UI C olo r.whi te
   a mbient Light .l ight?.ty pe = SCNLight.LightType .ambie nt
   a mbientLig ht. p osi tion = SC NVec tor3(x: 0, y:5,z : 0)
  // C reat e  a  di r ectio nall ight node wi th
.

 Q:

I_want a_shadow on the floor_for all_my_objects in_SWIFT_/ Scenekit

I'm working_on an ARKit_project in swift.
In SWIFT_I add objects_to_the scene. What I want to do with those objects is show a shadow_beneath_them to_make_them_more realistic. I tried some_things and those all didn't_work. I'll_explain that here.
Please understand that I'm still new_to_swift. I'm creating_objects programmatically in SWIFT. I thought I could do_it by creating a invisible plane_underneath all the_objects_and_place a light above_the scene. I learned that I_can cast a shadow on an_invisible plane in the Scene editor from_Xcode by unchecking the "write to_color" values red, green, blue_and alpha._I placed a spot light_above it and_it worked._Now I want_to do this programatically.
In swift I_created the light's_and the plane as shown below._I_don't use a_spot_anymore_because the_scene is so_large._That's why_I_create a really large plane. I_added_those to light's ambient and directional. Ambient_so it doesn't look_black_on the side and_directional so the shadow is_shown. This doesn't. The objects look_weirdly lit_and there_are no shadows.
let worldGroundPlaneGeometry = SCNPlane(width: 1000, height: 1000)
  _ worldGroundPlaneGeometry.firstMaterial?.colorBufferWriteMask = SCNColorMask(rawValue: 0)
 _  let worldGroundPlane_= SCNNode()

__  worldGroundPlane.geometry_=_worldGroundPlaneGeometry
 _  worldGroundPlane.position = worldPosition
  _ worldGroundPlane.castsShadow_= true
    worldGroundPlane.eulerAngles_= SCNVector3(Float.pi / 2,_0,_0)
    self.addChildNode(worldGroundPlane)

 _  // Create a ambient_light
    let_ambientLight_=_SCNNode()
    ambientLight.light_= SCNLight()
    ambientLight.light?.color_= UIColor.white
 _  ambientLight.light?.type = SCNLight.LightType.ambient
  __ambientLight.position = SCNVector3(x: 0,y: 5,z: 0)

__  // Create a directional_light_node_with