Lume Lume Versions Save

Create 3D web applications with HTML. Bring a new depth to your DOM!

v0.3.0-alpha.0

3 years ago

Version 0.3 is now in progress!

See the new demos!

Breaking changes:

  • the flingRotation function was converted into a FlingRotation class, which now provides an instance with start/stop methods similar to ScrollFling. 444ecbe38414dbf60d9f4c0af115ce69821de66b

  • add the <lume-fbx-model> element for loading FBX models. 6fbb1de0c1f27bcb7746179f9b7b8fb28548d06e

  • use a single type of event for all model elements. All model elements (<lume-gltf-model>, <lume-obj-model>, <lume-collada-model>, <lume-fbx-model>, and any elements with a points-geometry behavior) now emit a generic event named MODEL_LOAD of type {format: 'obj' | 'gltf' | 'collada' | 'fbx' | 'ply'; model: Group | GLTF | Collada | BufferGeometry}, and a generic MODEL_ERROR event of type Error. The GLTF_* and COLLADA_* events were removed.

  • support for declaration emit. This changes mixin type definitions and usage in order to make declaration output be possible import for TypeScript projects). Because of this, mixins are now called as extends SomeClass(Foo) instead of extends SomeClass.mixin(Foo), and come classes were converted to plain classes (use extends SomeClass instead of extends SomeClass.mixin(Foo) now). 56df57aaa9aec2bf738115c132cd5fd77bf842a1

    • Avoid use of "protected" and "private" modifiers by converting most private properties to #private fields and leaving "protected" properties public with single-underscore prefixes. A handful of private properties were left with double underscore prefixes because converting them to #private causes runtime errors.
    • Sizeable and Transformable private properties were converted to WeakMap storages. Let's see if we like this...
    • remove lowclass/Mixin from mixins
    • some classes were converted from mixins to regular classes
    • avoid default exports in all modules
    • update @lume/eventful with similar changes
    • some formerly private members are now public and prefixed with double-underscores __ to denote private. Do not rely on private members labeled with double underscores!, they can change at any time.
  • reorganize folder structure to co-locate related classes independently. Too many things were in the core/ folder. If you're importing classes directly from LUME's sub-folders, this will break your import statements. b06766a79b78a1322b02d70377cc8ae86b040341

  • rename LightBase to Light (the base class for <lume-point-light> and <lume-ambient-light> elements). 432b14bc30c59152b8eed3cc8df0f1667361aa4a

  • rename AutoLayoutNode's add and remove methods to addToLayout and removeFromLayout, respectively, to satisfy the TypeScript requirement that subclass methods do not change the signature of superclass methods. 4a357a4d2541d0bfa57667cadf28bbf0e657dda5

  • rename classes (along with corresponding element and behavior names) to follow a strict PascalCase convention, and one class deleted. e1366716df37e378f9a18a31abc7131370c5ed3d

    All words or "parts" or "things" of a name should have only the first letter uppercase and other letter lowercased. For example "GltfModel" instead of "GLTFModel", or "HtmlScene" instead of "HTMLScene".

    Main changes to worry about:

    • DOMNode (<lume-dom-node>) was deleted.
    • DOMPlane (<lume-dom-plane>) => MixedPlane (<lume-mixed-plane>)
    • DOMNodeGeometryBehavior (domnode-geometry) => MixedPlaneGeometryBehavior (mixedplane-geometry)
    • DOMNodeMaterialBehavior (domnode-material) => MixedPlaneMaterialBehavior (mixedplane-material)
    • domnode-material => mixedplane-material
    • Other renamed items are namely internal, undocumented, or both.

New features:

  • improve native ESM compatibility. 429f4ea5ffde95f545bf329eab155e64fd417471 and other commits
  • add NASA Astrobee and HTML Earth demos. 332a484225da026f0c093960c7900d14101c9aa4
  • add a perspective attribute to Scene (<lume-scene>). a991e69749b78f9cefdecb36c86f0656ecbb83ae
  • Add a points-material behavior for lume-mesh elements for rendering point clouds. See the ply-geometry example (the lume-points element there implicitly uses the points-material behavior by default). 8c7025879c17befc1d1a3487f09d755f7d6194c2
  • protected keywords were removed, working towards working declaration emit. This means formerly protected members are now technically public, but note that they are still prefixed with an underscore _ to denote that they are protected! 00758eaa29054e6ae2732a60d4b9f7e0a33a8a6a
  • add initial React JSX types for all the elements. See the react-typescript example. b971c4d90d8b6e8ac0165e64fd87275bcf345d0b
  • add a plain JavaScript React example. e2b58d12e9074f1e4d6b7f44fcc9e479c76c6350

Fixes

  • make sure to clear stop functions on cleanup (fix memory leak). 6a1f9019945bcdd22ab0776b85f66f625fd804a2
  • workaround for bug in Chrome that causes camera rig dragging to break sometimes (https://crbug.com/1166044). e1667300aaf8762cec9e5826f644bc80f3662b84
  • specify pointer-events:none on the CSS 3D camera element to prevent it from blocking pointer events in Firefox. 82dcdf2c120ca22e7e1332c337fb3cf5fb9f9745
  • remove event handler when finished with it (fix memory leak). 6f5a039d5abc06712396dae1d893230518d3be4d
  • content was leaking outside of a scene when a scene was not full screen. e5206c5808fa36a28daba45768505b257e26277e

v0.2.2

3 years ago

New features:

  • CameraRig.active property (<lume-camera-rig> active attribute) - When the property is set to true, the CameraRig's camera becomes the scene's active camera.
  • CameraRig.dollyFactor property (<lume-camera-rig> dolly-factor attribute) - A number that that multiplies the speed that the CamerRig will dolly the camera in and out when scrolling (zooming). Set it to a lower number to make the camera dolly slower, for example.
  • The type definition for the has attribute has been added. F.e. <lume-mesh has="phong-material">.

v0.2.1

3 years ago

Removed console.logs from source.

v0.2.0

3 years ago

Summary:

The align property (align attribute) renamed to alignPoint property (align-point attribute).

Breaking changes:

  • The align property was renamed to alignPoint (with its dash-cased align-point attribute equivalent) for all 3D elements. This prevents us from colliding and shadowing the built-in DOM align property.

Fixes:

  • Fixed an issue preventing initial element property values from being passed to behaviors hosted by an element with those properties if the properties were assigned before custom element upgrade.

v0.1.0

3 years ago

This release is non-breaking to plain JavaScript users, but some type definitions were modified and improved (especially for JSX templating), which is a breaking change in type checking for TypeScript users.

The properties that all LUME 3D elements have (f.e. position, rotation, etc) have setters that accept values that can be coerced into the underlying data type that is returned by the getter.

In JavaScript, we can set values as follows:

// with an array of numbers with up to three items:
element.position = [1, 2, 3]

// with an object with x,y, and z properties:
element.position = {x: 1, y: 2, z: 3}

// with a string (normally we avoid this form in JavaScript, but this is the form in which values from
// HTML attributes arrive to the properties):
element.position = "1 2 3"

// with an XYZValues object (f.e. XYZNumberValues):
element.position = new XYZNumberValues(1, 2, 3)

// with an property function which gets called repeatedly in an animation render loop. The function
// can return the same type of values as we can set in the previous example lines.
// The following animates Y position over time.
element.position = (x, y, z, time) => [x, ++y, z]
element.position = (x, y, z, time) => {x, y: ++y, z}
element.position = (x, y, z, time) => new XYZNumberValues(x, ++y, z)

The getters always return an XYZValues object (f.e. XYZNumberValues):

console.log(element.position) // XYZNumberValues { x: 1, y: 2, z: 3, ... }

// We can also set values like this:
element.position.x = 1
element.position.y = 2
element.position.z = 3

The breaking change is that now all of these possibilities are now described in the type definitions for the properties. Whereas before the types of the properties were only something like XYZNumberValues, they are now typed as XYZNumberValues | [number, number, number] | {x: number, y: number, z: number} | string | PropertyFunction or similar.

TypeScript has not (until the near future) had a way to define a different type for a getter than for a setter, so in TypeScript, the return value of element.position will currently be that union type, and we'd have to type cast it like the following in order to use it:

;(this.position as XYZNumberValues).x = 1

To remedy this until the upcoming TypeScript Variant Accessors is out, we've provided get*() methods for each of the properties, so TS users can write like follows:

this.getPosition().x = 1

A benefit of the new types is that all the following types of JSX are now valid and type checked correctly:

const sphere = <lume-box rotation={[1, 2, 3]} />
const sphere = <lume-box rotation={{x, y: ++y, z}} />
const sphere = <lume-box rotation={new XYZNumberValues(1, 2, 3)} />
const sphere = <lume-box rotation={"1 2 3"} />
const sphere = <lume-box rotation="1 2 3" />
const sphere = <lume-box rotation={(x, y, z, time) => [x, ++y, z]} />

v0.0.0

3 years ago

This is the first release of LUME's 3D elements! :tada:

This isn't 1.0 yet. There will be changes until 1.0 is ready.

v21.0.0

5 years ago

Breaking change: the public mountPromise property is now gone from all nodes, and underneath the hood the logic relies on synchronous connected/disconnected callbacks, which makes the code simpler and easier to understand.

v20.0.1

5 years ago

Fixes a bug that was causing sizes not to propagate to WebGL objects.

v20.0.0

5 years ago

This release updates all props (position, size, rotation, etc) to be reactive by means of SkateJS instead of our own (not very organized) getters/setters. This cleans up the code a bit. For the most part, the changes are not noticeable and everything works the same as before on the outside.

breaking change

The only breaking changes are that camelCased props are now mapped strictly to dash-cased attributes.

This means the mountPoint property of a Node can also be set via the mount-point="" attribute but no longer via the mountpoint="" attribute, and same for sizeMode (use size-mode="", not sizemode="" or sizeMode="").

From now on any new props that are camelCased will map only to dashed-cased attributes.

Example code changes:

The following,

<i-plane id="plane" mountPoint="0.5 0.5"></i-plane>
<i-box id="box" sizemode="proportional literal"></i-box>

changes to

<i-plane id="plane" mount-point="0.5 0.5"></i-plane>
<i-box id="box" size-mode="proportional literal"></i-box>

The JavaScript props remain the same (camelCased):

plane.mountPoint = [0.5, 0.5]
box.sizeMode = ['proportional', 'literal']

v19.0.4

5 years ago

Major changes:

  • A new (experimental) VR mode. This requires the experimental-webgl attribute on your <i-scene> element. Stick the following in an HTML file and open it in your browser:
    <!DOCTYPE html>
    <html lang="en" dir="ltr">
        <head>
            <title>VR mode test</title>
            <meta charset="utf-8">
    
            <!-- required polyfills if your browser doesn't have Custom Elements -->
            <script src="https://unpkg.com/[email protected]/dist/polyfill.min.js"></script>
            <script src="https://unpkg.com/@webcomponents/[email protected]/webcomponents-sd-ce.js"></script>
    
            <script src="https://unpkg.com/[email protected]/global.js"></script>
            <script> infamous.html.useDefaultNames() </script>
    
            <style> body, html { width: 100%; height: 100%; padding: 0; margin: 0; } </style>
        </head>
        <body>
            <i-scene experimental-webgl vr>
                <i-box id="node" size="80 80 80" align="0.5 0.5 0.5" mountPoint="0.5 0.5 0.5" position="0 0 -500" rotation="30 30 30" color="deeppink"></i-box>
                <i-point-light align="0.5 0.5 0.5" mountPoint="0.5 0.5 0.5" position="-200 0 0" color="yellow"></i-point-light>
            </i-scene>
            <script>
                window.node.rotation = ( x, y, z, time ) => [ x, ++y, z ]
            </script>
        </body>
    </html>
    
  • All classes were re-written with lowclass (This might be a breaking change in some browsers, as I haven't tested in all of them yet. So far it works in modern versions of Chrome, Firefox, and Safari.)