Code Monkey home page Code Monkey logo

polygon-shredder's Introduction

The Polygon Shredder

The polygon shredder that takes many cubes and turns them into confetti

See the site here

A WebGL experiment write up coming soon!

Curl Noise GLSL function from Isaac Cohen's gist

The MIT License (MIT)

Copyright © 2016 Jaume Sanchez Elias


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 SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

polygon-shredder's People

Contributors

spite avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

polygon-shredder's Issues

Non-interactive version?

I'm in the process of building a community for celebrating code-based art:

http://www.artywidget.com/
http://www.artywidget.com/about/

… and I'd love to include The Polygon Shredder. The focus for that site is passive art; think of a TV or photo frame on the wall where there may not even be an option for interaction. For that reason, I'd love to be able to programmatically hit the "close controls" and "close this message" buttons (e.g. with a URL parameter) so the audience can kick back and enjoy the art without extra visual distraction. Would that be okay with you? I'm happy to make a patch to this effect, but I wanted to check with you first.

Downshifting particles shader

Hi, Jaume!

Why do you have particle position multiplied by 18?

var positionsLength = curlNoiseModel.width * curlNoiseModel.height * 3 * 18;
var positions = new Float32Array( positionsLength );

var p = 0;

for( var j = 0; j < positionsLength; j += 3 ) {

    positions[ j ] = p
    positions[ j + 1 ] = Math.floor( p / 18 )
    positions[ j + 2 ] = p % 18
    p++;

}

geometry.addAttribute( 'position', new THREE.BufferAttribute( positions, 3 ) );

And can you give me a hint how to downshift particles shader for simple flat 2D sprite, like https://bl.ocks.org/vkuchinov/0942e561a993ce91d789299b44adfee0?

CurlNoise function

I would like to use the CurlNoise function and was wondering who's the author (to mention her/him). Is that you @spite or someone else? I'm talking about this one:

vec3 curlNoise( vec3 p ){
	const float e = .1;
	vec3 dx = vec3( e   , 0.0 , 0.0 );
	vec3 dy = vec3( 0.0 , e   , 0.0 );
	vec3 dz = vec3( 0.0 , 0.0 , e   );
	vec3 p_x0 = snoiseVec3( p - dx );
	vec3 p_x1 = snoiseVec3( p + dx );
	vec3 p_y0 = snoiseVec3( p - dy );
	vec3 p_y1 = snoiseVec3( p + dy );
	vec3 p_z0 = snoiseVec3( p - dz );
	vec3 p_z1 = snoiseVec3( p + dz );
	float x = p_y1.z - p_y0.z - p_z1.y + p_z0.y;
	float y = p_z1.x - p_z0.x - p_x1.z + p_x0.z;
	float z = p_x1.y - p_x0.y - p_y1.x + p_y0.x;
	const float divisor = 1.0 / ( 2.0 * e );
	return normalize( vec3( x , y , z ) * divisor );
}

By the way I also noticed that 2 other curl noise and 1 noise functions are not even used! You could remove ~100 lines. Amazing how short and clean is the code, compared to the complexity of the result. Bravo :)

Chrome experiments URL is jerky on desktop with facet artifacts but perfect on mobile phone

https://www.clicktorelease.com/code/polygon-shredder/
screenshot from 2018-01-02 15-40-52

With all scale tunables ramped up my Nexus 5x is perfectly smooth, renders perfectly and barely gets warm (1,920 x 1,080), but my Ubuntu 17.04 Skull canyon gets a low framerate with rendering artifacts on the cube faces and blasts out a lot of hot air:

  • Intel® Core™ i7-6770HQ CPU @ 2.60GHz × 8
  • Intel® Iris Pro Graphics 580 (Skylake GT4e)
  • 64 bit Ubuntu 17.04
  • Google Chrome Version 63.0.3239.84 (Official Build) (64-bit)
  • also 1920 x 1080

On the desktop, the github version has no facet artifacts but it's all dark and those parts have no artifacts on the web version. It still has a low framerate and throws out hot air.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.