const float PI = 3.1415926535897932384626433832795;
const float PI_2 = 1.57079632679489661923;
const float PI_4 = 0.785398163397448309616;
float PHI = (1.0+sqrtf(5.0))/2.0;
This file contains 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 { Component } from "React"; | |
export var Enhance = ComposedComponent => class extends Component { | |
constructor() { | |
this.state = { data: null }; | |
} | |
componentDidMount() { | |
this.setState({ data: 'Hello' }); | |
} | |
render() { |
On mac:
- Download the latest release.
- Extract the binary and place it in
/usr/local/bin
.
All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.
Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.
elem.offsetLeft
,elem.offsetTop
,elem.offsetWidth
,elem.offsetHeight
,elem.offsetParent
This file contains 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 bpy | |
myCurve = bpy.data.curves[0] # here your curve | |
spline= myCurve.splines[0] # maybe you need a loop if more than 1 spline | |
scale = 200 | |
curvepath_template = """ | |
var curves = new THREE.CurvePath(); | |
%s |
This file contains 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
<?php | |
error_reporting(0); | |
define("CF_ZONE_ID", ""); | |
define("CF_EMAIL", ""); | |
define("CF_API_KEY", ""); | |
define("GH_SECRET", ""); | |
if($_SERVER['REQUEST_METHOD'] !== 'POST') { | |
error_log("Invalid request (expected POST)"); | |
http_response_code(400); |
This file contains 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
// Here is a simple class that contains loading methods. | |
// Nothing fancy, but the idea is simply to return a Promise | |
import { loadImg } from './load'; | |
class Sprite { | |
/* | |
@Example | |
import Sprite from './Sprite'; |
This file contains 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
# Unix (Terminal) | |
open -a "Google Chrome" --args --disable-gpu-vsync --disable-frame-rate-limit | |
# Windows (Command prompt) | |
start chrome --args --disable-gpu-vsync --disable-frame-rate-limit |
This post has been moved to my blog, under Color Management in three.js.
OlderNewer