joshmarinacci / webxr-workshops

Modular workshop series for teaching WebXR (VR & AR)
MIT License
55 stars 2 forks source link

lighting_basic - missing steps #23

Closed NickPax closed 6 years ago

NickPax commented 6 years ago

After adding this code (angle brackets removed here because markup doesn't like them):

a-sphere
          radius="1"
          position="4 4 -4"
          color="lightgrey"
          emissive="lightgrey"
       /a-sphere

I still only see the red cube.

Nothing changes after adding this code, either:

a-light type="point" position="4 4 -4"
         color="gray"
         intensity="1"
         distance="50"
         /a-light

... unless we delete the ambient and directional lights. Then we can see the moon and the cube in shade, with a white background.

After adding this code (the next step in the tutorial)

a-plane
         width="40"
         height="40"
         color="red"
         position="0 -1 -4"
         rotation="-90 0 0"
         /a-plane

... we see the red cube in the centre, with a red plane and the moon casting its point light, which falls off on the plane ok, but there is a white background, so it doesn't look like your one (blue cube in different position with black background).

After making the changes in the final three pieces of code I get everything the same as shown in your final screenshot except the background is still white, which is fixed by changing the opening scene element like so:

a-scene background="color: black"

joshmarinacci commented 6 years ago

You are correct that we must set the background to black. However, I can see moon as soon as I add it. Did you look up and to the right to see it? It might be off frame.

NickPax commented 6 years ago

Yes, I can see the moon when the background is set to black.

joshmarinacci commented 6 years ago

great. marking as fixed.