diff --git a/_sidebar.md b/_sidebar.md
index 8a92ac6..7083ee2 100644
--- a/_sidebar.md
+++ b/_sidebar.md
@@ -6,12 +6,12 @@
- [Custom Element Names](/guide/custom-element-names)
- [Scene Graph](/guide/scene-graph)
- [Common Attributes](/guide/common-attributes)
- - [Positioning](/guide/positioning)
+ - [Positioning](/guide/positioning/)
- [Sizing](/guide/sizing)
- [Rendering Modes](/guide/rendering-modes)
- [Reactivity](/guide/reactivity)
- - [Cameras](/guide/cameras)
- - [External Assets](/guide/external-assets)
+ - [Cameras](/guide/cameras/)
+ - [External Assets](/guide/external-assets/)
- [Making Elements](/guide/making-elements)
- [Compatibility](/guide/compatibility)
- [Debugging](/guide/debugging)
@@ -22,7 +22,8 @@
- [Hello world!](/examples/hello-world/ ':class=no-sublist')
- - [🎃🧛♂️🔥 Picture Frame](/examples/picture-frame ':class=no-sublist')
+ - [🎄 Skateboard Configurator](/examples/skateboard-configurator/ ':class=no-sublist')
+ - [Picture Frame](/examples/picture-frame ':class=no-sublist')
- [NASA Astrobee Robot](/examples/nasa-astrobee-robot/ ':class=no-sublist')
- [Velodyne Lidar Scan](/examples/velodyne-lidar-scan/ ':class=no-sublist')
- [Shelby GT350 Points](/examples/shelby-gt350-points/ ':class=no-sublist')
@@ -71,6 +72,7 @@
- [ProjectedMaterialBehavior](/api/behaviors/mesh-behaviors/materials/ProjectedMaterialBehavior.md)
- [StandardMaterialBehavior](/api/behaviors/mesh-behaviors/materials/StandardMaterialBehavior.md)
- cameras/
+ - [Camera](/api/cameras/Camera.md)
- [CameraRig](/api/cameras/CameraRig.md)
- [PerspectiveCamera](/api/cameras/PerspectiveCamera.md)
- core/
@@ -82,6 +84,8 @@
- [Sizeable](/api/core/Sizeable.md)
- [Transformable](/api/core/Transformable.md)
- [TreeNode](/api/core/TreeNode.md)
+ - examples/
+ - [LoadingIcon](/api/examples/LoadingIcon.md)
- layouts/
- [CubeLayout](/api/layouts/CubeLayout.md)
- lights/
diff --git a/_sidebar.src.md b/_sidebar.src.md
index 7fc65a4..2537b5b 100644
--- a/_sidebar.src.md
+++ b/_sidebar.src.md
@@ -6,12 +6,12 @@
- [Custom Element Names](/guide/custom-element-names)
- [Scene Graph](/guide/scene-graph)
- [Common Attributes](/guide/common-attributes)
- - [Positioning](/guide/positioning)
+ - [Positioning](/guide/positioning/)
- [Sizing](/guide/sizing)
- [Rendering Modes](/guide/rendering-modes)
- [Reactivity](/guide/reactivity)
- - [Cameras](/guide/cameras)
- - [External Assets](/guide/external-assets)
+ - [Cameras](/guide/cameras/)
+ - [External Assets](/guide/external-assets/)
- [Making Elements](/guide/making-elements)
- [Compatibility](/guide/compatibility)
- [Debugging](/guide/debugging)
@@ -22,7 +22,8 @@
- [Hello world!](/examples/hello-world/ ':class=no-sublist')
- - [🎃🧛♂️🔥 Picture Frame](/examples/picture-frame ':class=no-sublist')
+ - [🎄 Skateboard Configurator](/examples/skateboard-configurator/ ':class=no-sublist')
+ - [Picture Frame](/examples/picture-frame ':class=no-sublist')
- [NASA Astrobee Robot](/examples/nasa-astrobee-robot/ ':class=no-sublist')
- [Velodyne Lidar Scan](/examples/velodyne-lidar-scan/ ':class=no-sublist')
- [Shelby GT350 Points](/examples/shelby-gt350-points/ ':class=no-sublist')
diff --git a/api/behaviors/RenderableBehavior.md b/api/behaviors/RenderableBehavior.md
index a7faf68..07edf01 100644
--- a/api/behaviors/RenderableBehavior.md
+++ b/api/behaviors/RenderableBehavior.md
@@ -3,9 +3,6 @@
Base class for element behaviors that provide rendering features (f.e. geometries, materials, etc).
-Subclasses should provide loadGL and unloadGL methods in order to load or
-unload WebGL resources when GL is enabled or disabled in a scene.
-
Inherits properties from [Behavior](Behavior.md).
diff --git a/api/behaviors/mesh-behaviors/ClipPlanesBehavior.md b/api/behaviors/mesh-behaviors/ClipPlanesBehavior.md
index 50369c0..77b1cfb 100644
--- a/api/behaviors/mesh-behaviors/ClipPlanesBehavior.md
+++ b/api/behaviors/mesh-behaviors/ClipPlanesBehavior.md
@@ -9,7 +9,7 @@ only on elements that have a geometry and material.
## Properties
diff --git a/api/behaviors/mesh-behaviors/geometries/LineGeometryBehavior.md b/api/behaviors/mesh-behaviors/geometries/LineGeometryBehavior.md
index a80e696..911cbc2 100644
--- a/api/behaviors/mesh-behaviors/geometries/LineGeometryBehavior.md
+++ b/api/behaviors/mesh-behaviors/geometries/LineGeometryBehavior.md
@@ -10,7 +10,7 @@ default. This is typically paired with
## Properties
diff --git a/api/behaviors/mesh-behaviors/geometries/ShapeGeometryBehavior.md b/api/behaviors/mesh-behaviors/geometries/ShapeGeometryBehavior.md
index 3b3c3a3..3833259 100644
--- a/api/behaviors/mesh-behaviors/geometries/ShapeGeometryBehavior.md
+++ b/api/behaviors/mesh-behaviors/geometries/ShapeGeometryBehavior.md
@@ -15,7 +15,7 @@ only.
## Properties
diff --git a/api/behaviors/mesh-behaviors/materials/LambertMaterialBehavior.md b/api/behaviors/mesh-behaviors/materials/LambertMaterialBehavior.md
index 5322839..df631ee 100644
--- a/api/behaviors/mesh-behaviors/materials/LambertMaterialBehavior.md
+++ b/api/behaviors/mesh-behaviors/materials/LambertMaterialBehavior.md
@@ -9,7 +9,7 @@ for its material. It uses a
diff --git a/api/behaviors/mesh-behaviors/materials/LineBasicMaterialBehavior.md b/api/behaviors/mesh-behaviors/materials/LineBasicMaterialBehavior.md
index 777703c..6c5e90b 100644
--- a/api/behaviors/mesh-behaviors/materials/LineBasicMaterialBehavior.md
+++ b/api/behaviors/mesh-behaviors/materials/LineBasicMaterialBehavior.md
@@ -11,7 +11,7 @@ backed by Three.js `LineBasicMaterial` underneath. This is typically paired with
## Properties
diff --git a/api/behaviors/mesh-behaviors/materials/ProjectedMaterialBehavior.md b/api/behaviors/mesh-behaviors/materials/ProjectedMaterialBehavior.md
index 6e40be4..3b8a247 100644
--- a/api/behaviors/mesh-behaviors/materials/ProjectedMaterialBehavior.md
+++ b/api/behaviors/mesh-behaviors/materials/ProjectedMaterialBehavior.md
@@ -7,45 +7,94 @@ A physical material with the added ability to have additional textures
projected onto it with
[``](../../../textures/TextureProjector) elements.
+Project a texture onto a mesh using a `` and
+associating it with the `texture-projectors` attribute:
+
+```html
+
+
+
+
+
+```
+
## Properties
Inherits properties from [PhysicalMaterialBehavior](PhysicalMaterialBehavior.md).
-### .projectedTextures :id=projectedTextures
+### .associatedProjectors :id=associatedProjectors
+
+`readonly` `signal`
+
+The list of `TextureProjector` elements that are projecting onto the
+current owner element, normalized from
+[`.textureProjectors`](#textureprojectors) with selectors queried and
+null values ignored.
+
+This returns the currently associated array of ``
+instances, not the original string or array of values passed to
+[`.textureProjectors`](#textureprojectors).
+
-*string attribute*
+
+### .textureProjectors :id=textureProjectors
+
+`string attribute`
Default: `[]`
-The corresponding `clip-planes` attribute accepts one or more selectors,
-comma separated, that define which
-[``](../../core/TextureProjector) elements are to be used as
-clip planes. If a selector matches an element that is not a
-``, it is ignored. If a selector matches more than one
-element, all of them that are clip planes are used.
+The `texture-projectors` attribute accepts one or more selectors, comma
+separated, that define which
+[``](../../core/TextureProjector) elements are to
+project an image onto the owner element. If a selector matches an element
+that is not a ``, it is ignored (note that
+non-upgraded elements will not be detected, make sure to load element
+definitions up front which is the default if you're simply importing
+`lume`).
+If a selector matches
+more than one element, only the first `` will be used
+(in the near future we will allow multiple projectors to project).
```html
-
+
```
-The property can also be set with a string (comma separated selectors),
-or a mixed array of strings (selectors) or `` element
-instances.
+The `textureProjectors` JS property can be set with a string of comma
+separated selectors, or a mixed array of strings (selectors) or
+`` element instances, making the JS property more
+flexible for scenarios where selectors are not enough (f.e. maybe you
+need to get a reference to an element from some other part of the DOM,
+perhaps from a tree inside a ShadowRoot, or you are programmatically
+creating elements, etc).
```js
-el.projectedTextures = ".some-projected-texture"
+el.textureProjectors = ".some-texture-projector"
// or
-const plane = document.querySelector('.some-projected-texture')
-el.projectedTextures = [plane, "#someOtherTexture"]
+const projector = document.querySelector('.some-texture-projector')
+el.textureProjectors = [projector, "#someOtherTextureProjector"]
```
-The property getter returns the currently applicable collection of
-`` instances, not the original string or array of values
-passed into the attribute or setter. Applicable planes are those that are
-connected into the document, and that participate in rendering (composed,
-either in the top level document, in a ShadowRoot, or distributed to a
-slot in a ShadowRoot).
+Texture projectors that are not in the composed tree (i.e. not
+participating in rendering) will be ignored. The texture projectors that
+will be associated are those that are connected into the document, and
+that participate in rendering (i.e. composed, either in the top level
+document, in a ShadowRoot, or distributed to a slot in a ShadowRoot).
+This is the same as with the browser's built-in elements: a `
`
+element that is connected into the DOM but not slotted to its parent's
+`.shadowRoot` will not participate in the visual output.
+
+
+
+### .projectedTextures :id=projectedTextures
+
+`string attribute`
+
+*deprecated*: renamed to [`.textureProjectors`](#textureprojectors).
diff --git a/api/cameras/Camera.md b/api/cameras/Camera.md
new file mode 100644
index 0000000..863fc95
--- /dev/null
+++ b/api/cameras/Camera.md
@@ -0,0 +1,74 @@
+
+# class Camera extends [Element3D](../core/Element3D.md) :id=Camera
+
+Base class for all camera elements, f.e. [``](./PerspectiveCamera).
+
+## Properties
+
+Inherits properties from [Element3D](../core/Element3D.md).
+
+
+### .aspect :id=aspect
+
+*attribute*
+
+Default: `0`
+
+A value of `0` sets the aspect ratio to automatic, based on the
+dimensions of a scene. You normally don't want to modify this, but in
+case of stretched or squished display, this can be adjusted appropriately
+to unstretch or unsquish the view of the 3d world.
+
+
+
+### .near :id=near
+
+*attribute*
+
+Default: `1`
+
+Anything closer to the camera than this value will not be rendered.
+
+
+
+### .far :id=far
+
+*attribute*
+
+Default: `3000`
+
+Anything further from the camera than this value will not be rendered.
+
+
+
+### .active :id=active
+
+*attribute*
+
+Default: `false`
+
+When `true`, the camera will be used as the viewport into the 3D scene,
+instead of the scene's default camera. When set back to `false`, the last
+camera that was set (and is still) active will be used, or if no other
+cameras are active the scene's default camera will be used.
+
+
+
+### .zoom :id=zoom
+
+*attribute*
+
+Default: `1`
+
+The zoom level of the camera modifies the effective field of view.
+Increasing the zoom will decrease the effective field of view, and vice
+versa. At zoom level `1`, the effective field of view is equivalent to
+[`fov`](#fov).
+
+
+
+
+Inherits methods from [Element3D](../core/Element3D.md).
+
+
+
\ No newline at end of file
diff --git a/api/cameras/CameraRig.md b/api/cameras/CameraRig.md
index 1b9dc11..222ad3a 100644
--- a/api/cameras/CameraRig.md
+++ b/api/cameras/CameraRig.md
@@ -77,8 +77,8 @@ The highest angle that the camera will rotate vertically.
@@ -129,11 +129,15 @@ laterally around the focus point indefinitely.
*attribute*
-Default: `1000`
+Default: `-1`
The distance that the camera will be away from the center point.
When the performing a scroll gesture, the camera will zoom by moving
towards or away from the center point (i.e. dollying).
+
+A value of `-1` means automatic distance based on the current scene's
+[`.perspective`](../core/Scene#perspective), matching the behavior of
+[CSS `perspective`](https://developer.mozilla.org/en-US/docs/Web/CSS/perspective).
@@ -147,10 +151,13 @@ towards or away from the center point (i.e. dollying).
*attribute*
-Default: `200`
+Default: `-1`
-The smallest distance the camera can get to the center point when zooming
+The smallest distance (a non-zero value) the camera can get to the center point when zooming
by scrolling.
+
+A value of `-1` means the value will automatically be half of whatever
+the [`.distance`](#distance) value is.
@@ -158,10 +165,13 @@ by scrolling.
*attribute*
-Default: `2000`
+Default: `-1`
+
+The largest distance (a non-zero value) the camera can get from the
+center point when zooming out by scrolling or with pinch gesture.
-The largest distance the camera can get from the center point when
-zooming by scrolling.
+A value of `-1` means the value will automatically be double of whatever
+the [`.distance`](#distance) value is.
diff --git a/api/cameras/PerspectiveCamera.md b/api/cameras/PerspectiveCamera.md
index 005ce97..6b5094b 100644
--- a/api/cameras/PerspectiveCamera.md
+++ b/api/cameras/PerspectiveCamera.md
@@ -1,5 +1,5 @@
-# class PerspectiveCamera extends [Element3D](../core/Element3D.md) :id=PerspectiveCamera
+# class PerspectiveCamera extends [Camera](Camera.md) :id=PerspectiveCamera
Defines a viewport into the 3D scene as will be seen on screen.
@@ -9,86 +9,31 @@ the camera, while less can fit into view closer to the camera.
## Properties
-Inherits properties from [Element3D](../core/Element3D.md).
+Inherits properties from [Camera](Camera.md).
### .fov :id=fov
*attribute*
-Default: `50`
-
-The camera's field of view angle, in degrees, when [`zoom`](#zoom) level
-is `1`.
-
-
-
-### .aspect :id=aspect
-
-*attribute*
-
Default: `0`
-A value of `0` sets the aspect ratio to automatic, based on the
-dimensions of a scene. You normally don't want to modify this, but in
-case of stretched or squished display, this can be adjusted appropriately
-to unstretch or unsquish the view of the 3d world.
-
-
-
-### .near :id=near
-
-*attribute*
-
-Default: `1`
-
-Anything closer to the camera than this value will not be rendered.
-
-
-
-### .far :id=far
-
-*attribute*
-
-Default: `3000`
-
-Anything further from the camera than this value will not be rendered.
-
-
-
-### .zoom :id=zoom
-
-*attribute*
-
-Default: `1`
-
-The zoom level of the camera modifies the effective field of view.
-Increasing the zoom will decrease the effective field of view, and vice
-versa. At zoom level `1`, the effective field of view is equivalent to
-[`fov`](#fov).
-
-
-
-### .active :id=active
-
-*attribute*
-
-Default: `false`
+The camera's field of view angle, in degrees, when the [`zoom`](#zoom)
+level is `1`.
-When `true`, the camera will be used as the viewport into the 3D scene,
-instead of the scene's default camera. When set back to `false`, the last
-camera that was set (and is still) active will be used, or if no other
-cameras are active the scene's default camera will be used.
+A value of `0` means automatic fov based on the current Scene's
+[`.perspective`](../core/Scene#perspective), matching the behavior of [CSS
+`perspective`](https://developer.mozilla.org/en-US/docs/Web/CSS/perspective).
-Inherits methods from [Element3D](../core/Element3D.md).
+Inherits methods from [Camera](Camera.md).
\ No newline at end of file
diff --git a/api/core/ClipPlane.md b/api/core/ClipPlane.md
index 1c90eb3..92074c3 100644
--- a/api/core/ClipPlane.md
+++ b/api/core/ClipPlane.md
@@ -14,9 +14,9 @@ To clip an element, add a
element with the `has=""` attribute, then assign any number of connected
`` elements to the element's `clipPlanes` property.
-
+
diff --git a/api/core/Element3D.md b/api/core/Element3D.md
index 8ee1e3d..859a461 100644
--- a/api/core/Element3D.md
+++ b/api/core/Element3D.md
@@ -60,10 +60,7 @@ Finally, we listen to mouse or finger movement events in order to apply a
rotation to the root node based on the current mouse or finger position.
See the [events guide](TODO) for how the event system works.
-
-
+
## Properties
diff --git a/api/core/Scene.md b/api/core/Scene.md
index c357712..5653edb 100644
--- a/api/core/Scene.md
+++ b/api/core/Scene.md
@@ -18,10 +18,7 @@ have the appearance of being obscured by a haze.
The following example shows how to begin making a LUME scene within an HTML
file. To learn more about how to get started, see the [install guide](../../guide/install.md).
-
-
+
## Properties
@@ -164,15 +161,43 @@ Applies only if [`webgl`](#webgl) is `true`.
+### .backgroundIntensity :id=backgroundIntensity
+
+*attribute*
+
+Default: `0`
+
+A number between `0` and `1` that defines the intensity of the
+`background` when WebGL is enabled. If the value is 1, the background
+will be brightest, and if the value is 0 the background will be black.
+
+This applies only if [`webgl`](#webgl) is `true` and the
+[`background`](#background) property is set.
+
+
+
+### .backgroundBlur :id=backgroundBlur
+
+**`experimental`** *attribute*
+
+Default: `0`
+
+If [`background`](#background) is set, the background will be blurred by
+the given amount.
+
+Applies only if [`webgl`](#webgl) is `true`.
+
+
+
### .equirectangularBackground :id=equirectangularBackground
*attribute*
Default: `false`
-If the `background`
-is equirectangular, set this to `true` so use it like a skybox,
-otherwise the image will be used as a regular 2D background image.
+If the [`background`](#background) is equirectangular, set this to `true`
+so use it like a skybox, otherwise the image will be used as a regular 2D
+background image.
Applies only if [`webgl`](#webgl) is `true`.
@@ -331,20 +356,22 @@ infinitely big (respectively) when it comes to CSS rendering.
Default: `400`
-This property behaves just like CSS perspective
-when using CSS transforms, but also applies to LUME's WebGL rendering when using a scene's
-default camera. If using a custom camera (for example a `` element) then this
-value does not (currently) have any effect.
+This property behaves identical to CSS perspective
+(https://developer.mozilla.org/en-US/docs/Web/CSS/perspective) when using
+a scene's default camera, adjusting its fov and Z position. If using a
+custom camera (for example a ``) then this value
+affects only the camera's fov, unless we specify a non-zero fov value for
+the custom camera.
The value sets the default camera's Z position to the given value (relative to the world
origin, 0,0,0). Note that the default camera points in the -z direction, therefore a value
of 800 means the camera is at position 0,0,800 looking directly at the world origin
-at 0,0,0. Furthermore, based on the chosen value, the camera's aspect ratio and zoom
+at 0,0,0. Furthermore, based on the chosen value, the camera's aspect ratio and fov
will be adjusted such that if there were a plane positioned at 0,0,0, perpendicular
to the camera's line of sight, and having the same dimensions as the scene's viewport
in screen pixels, then the plane would fit perfectly in the view, and one unit on that
-plane would coincide with one pixel on the screen; essentially that plane would be lined
-up perfectly with the screen surface. This is the same meaning that CSS perspective has.
+plane would coincide with one CSS pixel on the screen; essentially that plane would be lined
+up perfectly with the screen surface.
Applies with both CSS and WebGL rendering.
@@ -354,13 +381,22 @@ Applies with both CSS and WebGL rendering.
*readonly*
-The current active THREE.Camera being
-used by the scene. It will be a default camera if no camera was manually
-specified by a camera element such as ``, in
-which case the scene's `perspective` property is used for configuring the
-default camera. If a manual camera element is set active with an
-`active` attribute, then this property will return the currently
-active THREE.Camera represented by the active camera element.
+The current active `THREE.Camera` being used to render visuals.
+
+If no Lume camera element such as `` is active,
+this returns the default `THREE.Camera` that the scene uses internally.
+
+If a camera element is set active with an `active` attribute (f.e.
+``, then this property will return the
+`THREE.Camera` from the active camera element.
+
+The scene's [`.perspective`](#perspective) property is used for
+configuring the default camera view's fov and Z position to behave
+identical to CSS `perspective` by default. This behavior can be bypassed
+by using a `` element manually, and configuring
+its [`.aspect`](../cameras/PerspectiveCamera#aspect) and
+[`fov`](../cameras/PerspectiveCamera#fov) properties or attributes to
+non-zero values.
Applies with both CSS and WebGL rendering.
@@ -390,6 +426,16 @@ positioned starting at the top/left.
*readonly*
+Returns the scene's underlying
+[THREE.WebGLRenderer](https://threejs.org/docs/index.html#api/en/renderers/WebGLRenderer)
+for custom uses, or `null` when GL rendering is not enabled.
+
+
+
+### .cssRenderer :id=cssRenderer
+
+*readonly*
+
Returns the scene's underlying `CSS3DRendererNested` (a forked version of
[THREE.CSS3DRenderer](https://threejs.org/docs/index.html#examples/en/renderers/CSS3DRenderer)
that allows us to have a nested DOM structure instead of a flat DOM
diff --git a/api/core/SharedAPI.md b/api/core/SharedAPI.md
index f3f770c..4ce1e5c 100644
--- a/api/core/SharedAPI.md
+++ b/api/core/SharedAPI.md
@@ -41,45 +41,30 @@ The value should be a number from `0` to `1`. `0` is fully transparent, and `1`
-### .glLoaded :id=glLoaded
-
-*readonly*, *signal*
-
-Returns a boolean indicating whether or not the WebGL rendering features
-of a LUME element are loaded and ready.
+### .debug :id=debug
-All elements in a `` have WebGL rendering disabled by
-default.
+`attribute`
-If a `` element has its `webgl` attribute set to
-`"false"` (the default), then `glLoaded` will always return `false` for any LUME
-elements in the scene.
+Default: `false`
-If a `` element has the `webgl` attribute set to
-`"true"`, then `glLoaded` will return `true` for any LUME
-elements in the scene *after* their WebGL APIs have been loaded
-(`false` up until then).
+When `true`, show debug visuals for the object. Not all objects implement
+debug visuals yet.
-### .cssLoaded :id=cssLoaded
+### .glLoaded :id=glLoaded
-*readonly*, *signal*
+DEPRECATED Now always true. For logic depending on this in an effect (f.e. returning early when false), instead init things when an element is connected, and uninit when an element is disconnected.
-Returns a boolean indicating whether or not the CSS rendering features
-of a LUME element are loaded and ready.
+*readonly*
+
-All elements in a `` have CSS rendering enabled by
-default.
-If a `` element has its `enable-css` attribute set to
-`"false"`, then `cssLoaded` will always return `false` for any LUME
-elements in the scene.
+### .cssLoaded :id=cssLoaded
-If a `` element has its `enable-css` attribute set to
-`"true"` (the default), then `cssLoaded` will return `true` for
-any LUME elements in the scene *after* their CSS APIs have been loaded
-('false' up until then).
+DEPRECATED Now always true. For logic depending on this in an effect (f.e. returning early when false), instead init things when an element is connected, and uninit when an element is disconnected.
+
+*readonly*
diff --git a/api/core/Transformable.md b/api/core/Transformable.md
index 807a8b3..8de36e9 100644
--- a/api/core/Transformable.md
+++ b/api/core/Transformable.md
@@ -78,10 +78,7 @@ at each origin point on each cube. All cubes are initially oriented the
same, but as you move the sliders, each cube rotates around their
specific origin.
-
-
+
diff --git a/api/examples/LoadingIcon.md b/api/examples/LoadingIcon.md
new file mode 100644
index 0000000..1a6ec25
--- /dev/null
+++ b/api/examples/LoadingIcon.md
@@ -0,0 +1,113 @@
+
+# class LoadingIcon extends HTMLElement :id=LoadingIcon
+
+A `` element useful for an initial loading
+animation while assets are loading. The element has no dependencies, so it
+can be imported directly quickly on its own to add into a web app as soon as
+possible while other modules are still being fetched.
+
+## Live Example
+
+Hit "Rerun" to see the loading icon again.
+
+
+
+
+## Usage:
+
+```html
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+```
+
+## CSS Properties
+
+### `--loading-icon-color`
+
+A string with an RGB triplet, comma separated.
+
+Default: `120,130,140`
+
+### `--loading-icon-outer-radius`
+
+The outer size of the icon.
+
+Default: `20px`
+
+### `--loading-icon-inner-radius`
+
+The size of the inner hole.
+
+Default: `calc(0.7 * var(--loading-icon-outer-radius))`
+
+
+
+Inherits properties from HTMLElement.
+
+
+
+
+
+Inherits methods from HTMLElement.
+
+
+
\ No newline at end of file
diff --git a/api/lights/DirectionalLight.md b/api/lights/DirectionalLight.md
index 880d680..1da1e7d 100644
--- a/api/lights/DirectionalLight.md
+++ b/api/lights/DirectionalLight.md
@@ -21,7 +21,7 @@ camera limits will be affects by shadows.
## Properties
diff --git a/api/lights/PointLight.md b/api/lights/PointLight.md
index 6bfa32c..4f4c338 100644
--- a/api/lights/PointLight.md
+++ b/api/lights/PointLight.md
@@ -17,7 +17,7 @@ All mesh elements [receive](../meshes/Mesh#receiveshadow) or
## Properties
diff --git a/api/lights/SpotLight.md b/api/lights/SpotLight.md
index ad6017a..c86bbbf 100644
--- a/api/lights/SpotLight.md
+++ b/api/lights/SpotLight.md
@@ -11,10 +11,7 @@ light in all directions.
## Example
-
-
+
## Properties
diff --git a/api/meshes/InstancedMesh.md b/api/meshes/InstancedMesh.md
index ef3cb02..394f085 100644
--- a/api/meshes/InstancedMesh.md
+++ b/api/meshes/InstancedMesh.md
@@ -16,7 +16,7 @@ phong-material by default.
## Properties
diff --git a/api/meshes/Line.md b/api/meshes/Line.md
index fc691ad..4b522d9 100644
--- a/api/meshes/Line.md
+++ b/api/meshes/Line.md
@@ -16,7 +16,7 @@ behavior on this element to load a set of points from a file.
diff --git a/api/meshes/Mesh.md b/api/meshes/Mesh.md
index da4faa6..05e80dc 100644
--- a/api/meshes/Mesh.md
+++ b/api/meshes/Mesh.md
@@ -5,7 +5,7 @@ Element: ``
An element that renders a particular 3D shape (geometry) along with a
particular style (material). This is a generic element with no particular
-shape. Elements like `` extend from `Mesh` in order to set define
+shape. Elements like `` extend from `Mesh` in order to define
behaviors they ship with by default. For example a `` element
(backed by the [`Box`](./Box) class) extends from this `Mesh` class and
applies two default behaviors:
@@ -13,14 +13,15 @@ applies two default behaviors:
and
[`phong-material`](../behaviors/mesh-behaviors/materials/PhongMaterialBehavior).
-For sake of simplicity, `` has a `box-geometry` and
-`phong-material` by default, just like a ``.
+A `` does not have any behaviors by default, a geometry behavior
+and material behavior need to be added for it to render something, using the
+`has=""` attribute, for example `has="box-geometry phong-material"`.
## Example
## Properties
diff --git a/api/meshes/Shape.md b/api/meshes/Shape.md
index d9571d1..55652ef 100644
--- a/api/meshes/Shape.md
+++ b/api/meshes/Shape.md
@@ -12,7 +12,7 @@ Default behaviors:
Inherits attribute properties from [`ShapeGeometryBehavior`](../behaviors/geometries/ShapeGeometryBehavior.md).
diff --git a/api/textures/TextureProjector.md b/api/textures/TextureProjector.md
index 6f7a6ae..deaacbe 100644
--- a/api/textures/TextureProjector.md
+++ b/api/textures/TextureProjector.md
@@ -21,7 +21,7 @@ texture is used, for now.
## Properties
diff --git a/examples/buttons-with-shadow.html b/examples/buttons-with-shadow.html
index 7c98f32..eedb657 100644
--- a/examples/buttons-with-shadow.html
+++ b/examples/buttons-with-shadow.html
@@ -155,6 +155,7 @@
Motor.addRenderTask(time => {
lightContainer.position.x += (this.targetPosition.x - lightContainer.position.x) * 0.05
lightContainer.position.y += (this.targetPosition.y - lightContainer.position.y) * 0.05
+ console.log(lightContainer.position.x, lightContainer.position.y)
plane.rotation.y = 10 * (lightContainer.position.x / window.innerWidth) - 5
plane.rotation.x = -(10 * (lightContainer.position.y / window.innerHeight) - 5)
})
diff --git a/examples/disco-helmet/disco-helmet.html b/examples/disco-helmet/disco-helmet.html
index 10ceb81..3583bfe 100644
--- a/examples/disco-helmet/disco-helmet.html
+++ b/examples/disco-helmet/disco-helmet.html
@@ -1,3 +1,5 @@
+
+
-
-
-
-
-
-
-
+
+
+
+
@@ -52,6 +53,8 @@
rotation="90 0 0"
mount-point="0.5 0.5 0.5"
position="0 300 0"
+ has="phong-material"
+ shininess="100"
>
diff --git a/examples/heem-air/README.md b/examples/heem-air/README.md
index a5fee4e..cd455cd 100644
--- a/examples/heem-air/README.md
+++ b/examples/heem-air/README.md
@@ -3,7 +3,7 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
diff --git a/examples/hello-world/example.html b/examples/hello-world/example.html
new file mode 100644
index 0000000..2759f20
--- /dev/null
+++ b/examples/hello-world/example.html
@@ -0,0 +1,146 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/examples/indian-boombox/README.md b/examples/indian-boombox/README.md
index d622367..c87d693 100644
--- a/examples/indian-boombox/README.md
+++ b/examples/indian-boombox/README.md
@@ -3,5 +3,5 @@
diff --git a/examples/mini-galaxy/example.html b/examples/mini-galaxy/example.html
new file mode 100644
index 0000000..537d758
--- /dev/null
+++ b/examples/mini-galaxy/example.html
@@ -0,0 +1,208 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/examples/mini-galaxy/sun.png b/examples/mini-galaxy/sun.png
new file mode 100644
index 0000000..419f9da
Binary files /dev/null and b/examples/mini-galaxy/sun.png differ
diff --git a/examples/nasa-astrobee-robot/README.md b/examples/nasa-astrobee-robot/README.md
index 107e1f8..bed68e6 100644
--- a/examples/nasa-astrobee-robot/README.md
+++ b/examples/nasa-astrobee-robot/README.md
@@ -22,6 +22,10 @@
}
+
+
+
+
+
+
diff --git a/examples/shelby-gt350-points/README.md b/examples/shelby-gt350-points/README.md
index b4fc7f1..b817f87 100644
--- a/examples/shelby-gt350-points/README.md
+++ b/examples/shelby-gt350-points/README.md
@@ -30,12 +30,16 @@
+
+
-
+
+
+
+
+
+
+
+
+
+
+
+