This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| The MIT License (MIT) | |
| Copyright 2022 watab0shi | |
| Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | |
| The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | |
| THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFT |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| javascript:(()=>{const e=document.querySelector('.editor-preview-container>.SplitPane>.Pane>.SplitPane');e.style.flexDirection=e.style.flexDirection==='row'?'row-reverse':'row';})() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * three.js canvas | |
| */ | |
| class GLCanvas { | |
| /** | |
| * @param {Object} param | |
| * @param {HTMLCanvasElement} param.element | |
| */ | |
| constructor({ element }) { | |
| this._element = element; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| let isGACreated = false; | |
| window.addEventListener('hashchange', () => { | |
| const hash = location.hash.length > 0 ? location.hash.slice(1) : 'index';// '#' を削除, 空だったら index にする | |
| if (typeof window.ga === 'function') { | |
| if (!isGACreated) {// 初回のみ create する | |
| ga('create', 'UA-XXXXXXXXX', 'auto'); | |
| isGACreated = true; | |
| } | |
| const pathname = location.pathname.slice(0, location.pathname.lastIndexOf('/') + 1);// ファイル名ついてたら削除 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include "AutoReloadShader.h" | |
| //-------------------------------------------------------------- | |
| bool AutoReloadShader::load(const std::filesystem::path& _vertName, const std::filesystem::path& _fragName) { | |
| vertFile.open(_vertName); | |
| fragFile.open(_fragName); | |
| vertLastWriteTime = ""; | |
| fragLastWriteTime = ""; | |
| return shader.load(_vertName, _fragName); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include "ofMain.h" | |
| #include "ofApp.h" | |
| //======================================================================== | |
| int main( ){ | |
| ofSetupOpenGL(1024,768,OF_WINDOW); // <-------- setup the GL context | |
| // this kicks off the running of my app | |
| // can be OF_WINDOW or OF_FULLSCREEN | |
| // pass in width and height too: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { PlaneGeometry } from 'three/src/geometries/PlaneGeometry'; | |
| import { MeshStandardMaterial } from 'three/src/materials/MeshStandardMaterial'; | |
| import { Mesh } from 'three/src/objects/Mesh'; | |
| import { resolveShaderIncludes } from './resolveShaderIncludes'; | |
| const geo = new PlaneGeometry(); | |
| const mat = new MeshStandardMaterial(); | |
| mat.onBeforeCompile = (shader) => { | |
| const { vertexShader, fragmentShader } = shader; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { | |
| CubeUVReflectionMapping, | |
| GammaEncoding, | |
| LinearEncoding, | |
| NoToneMapping, | |
| NearestFilter, | |
| NoBlending, | |
| RGBDEncoding, | |
| RGBEEncoding, | |
| RGBEFormat, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // loop back | |
| const arr1 = [0, 1, 2, 3, 4]; | |
| arr1.splice(0, 0, arr1.slice(-1)[0]); | |
| arr1.splice(-1, 1); | |
| console.log(arr1);// [4, 0, 1, 2, 3] | |
| // loop forward | |
| const arr2 = [0, 1, 2, 3, 4]; | |
| arr2.splice(arr2.length, 0, arr2.slice(0)[0]); | |
| arr2.splice(0, 1); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>Document</title> | |
| </head> | |
| <body> | |
| <p>Time: <span id="txt-time">0</span></p> | |
| <script> |
NewerOlder