Skip to content

Instantly share code, notes, and snippets.

/**
* A Scene describes an ordered subset Nodes associated with a root Model that
* should be rendered together.
*
* @see https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#reference-scene
* @access package
*/
export declare interface Scene extends ThreeDOMElement {
/**
/* @license
* Copyright 2019 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the 'License');
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an 'AS IS' BASIS,
Errors: 964. Warnings: 2.
[Error]
Accessor contains 754 element(s) less than declared minimum value 0.
/accessors/1463/min/3
[Error]
Material is incompatible with mesh primitive: Texture binding textureBinding needs 'TEXcoordValue_0' attribute.
/meshes/0/primitives/0/material
[Error]
Material is incompatible with mesh primitive: Texture binding textureBinding needs 'TEXcoordValue_0' attribute.
THREE.WebGLShader: gl.getShaderInfoLog() fragment
Compile failed.
WARNING: 0:254: Calls to any function that may require a gradient calculation inside a conditional block may return undefined results
WARNING: 0:256: Calls to any function that may require a gradient calculation inside a conditional block may return undefined results
WARNING: 0:258: Calls to any function that may require a gradient calculation inside a conditional block may return undefined results
WARNING: 0:260: Calls to any function that may require a gradient calculation inside a conditional block may return undefined results
WARNING: 4 compilation warnings.
�1: #define n 20
2:
@cdata
cdata / disable-quick-look-ios-chrome.html
Created May 10, 2019 22:27
Example showing how to disable <model-viewer> Quick Look integration in iOS Chrome
<model-viewer src="something.glb" ios-src="something.usdz" ar>
</model-viewer>
<!-- ... somewhere after the <model-viewer> tag ... -->
<script>
function disableQuickLookForIosChrome() {
var modelViewer = document.querySelector('model-viewer');
var isIosChrome = /CriOS/.test(navigator.userAgent);
if (isIosChrome) {
/**
* This is mixin function is designed to be applied to a class that inherits
* from HTMLElement. It makes it easy for a custom element to coordinate with
* the :focus-visible polyfill.
*
* @param {Function} SuperClass The base class implementation to decorate with
* implementation that coordinates with the :focus-visible polyfill
*/
export function FocusVisiblePolyfillMixin(SuperClass) {
var coordinateWithPolyfill = function(instance) {
@cdata
cdata / model-viewer-legacy.js
Created March 1, 2019 16:48
One shot build of <model-viewer> for light configuration testing
This file has been truncated, but you can view the full file.
!function(a){"use strict";function b(a,b,c,e){var f=b&&b.prototype instanceof d?b:d,g=Object.create(f.prototype),h=new m(e||[]);return g._invoke=i(a,c,h),g}function c(a,b,c){try{return{type:"normal",arg:a.call(b,c)}}catch(a){return{type:"throw",arg:a}}}function d(){}function e(){}function f(){}function g(a){["next","throw","return"].forEach(function(b){a[b]=function(a){return this._invoke(b,a)}})}function h(a){function b(d,e,f,g){var h=c(a[d],a,e);if("throw"===h.type)g(h.arg);else{var i=h.arg,j=i.value;return j&&"object"===typeof j&&q.call(j,"__await")?Promise.resolve(j.__await).then(function(a){b("next",a,f,g)},function(a){b("throw",a,f,g)}):Promise.resolve(j).then(function(a){i.value=a,f(i)},g)}}function d(a,c){function d(){return new Promise(function(d,e){b(a,c,d,e)})}return e=e?e.then(d,d):d()}var e;this._invoke=d}function i(a,b,d){var e="suspendedStart";return function(f,g){if(e==="executing")throw new Error("Generator is already running");if("completed"===e){if("throw"===f)throw g;return o()}for(d.metho
const getScene = (modelViewerElement) => {
return modelViewerElement[Object.getOwnPropertySymbols(modelViewerElement)[3]];
};
const getCameraControls = (modelViewerElement) => {
return modelViewerElement[Object.getOwnPropertySymbols(modelViewerElement)[21]];
};
const modelViewer = document.querySelector('model-viewer');
const scene = getScene(modelViewer);
@cdata
cdata / css.pegjs
Last active August 31, 2018 00:25
{
function value(value, unit) {
return {
type: 'value',
value,
unit
};
}
function splitArgs(args) {
<script type="module">
import {MyElement} from './my-element.html#definition';
document.body.appendChild(new MyElement());
</script>