-
Notifications
You must be signed in to change notification settings - Fork 354
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Start work enabling cyclical graphs #94
Still needs work - make sure ready and dirty state are accurate - when an effect has itself as a source, need separate source and destination textures (ping pong) - more unit tests
- Loading branch information
1 parent
2d51781
commit 4560cb3
Showing
3 changed files
with
180 additions
and
61 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>Loop</title> | ||
<style type="text/css"> | ||
body { | ||
margin: 0; | ||
} | ||
|
||
img, video { | ||
display: none; | ||
} | ||
|
||
#canvas { | ||
position: absolute; | ||
top: 0; | ||
left: 0; | ||
width: 100%; | ||
height: 100%; | ||
} | ||
|
||
</style> | ||
</head> | ||
<body> | ||
<canvas id="canvas" width="960" height="540"></canvas> | ||
<script src="../../lib/require.js"></script> | ||
<img src="../images/pencils.jpg" id="pencils"/> | ||
<script> | ||
require.config({ | ||
baseUrl: '../../' | ||
}); | ||
|
||
require([ | ||
'seriously', | ||
'effects/seriously.blend' | ||
], function (Seriously) { | ||
// declare our variables | ||
var seriously, // the main object that holds the entire composition | ||
target, // a wrapper object for our target canvas | ||
transform, | ||
reformat, | ||
blend; | ||
|
||
function resize() { | ||
var aspect = window.innerWidth / window.innerHeight; | ||
target.width = Math.min(960, window.innerWidth); | ||
target.height = target.width / aspect; | ||
reformat.width = target.width; | ||
reformat.height = target.height; | ||
|
||
//temp | ||
target.width = 411; | ||
target.height = 425; | ||
} | ||
|
||
window.onresize = resize; | ||
|
||
seriously = new Seriously(); | ||
reformat = seriously.transform('reformat'); | ||
transform = seriously.transform('2d'); | ||
blend = seriously.effect('blend'); | ||
target = seriously.target('#canvas'); | ||
|
||
reformat.mode = 'none'; | ||
reformat.source = '#pencils'; | ||
|
||
blend.top = '#pencils'; | ||
blend.sizeMode = 'top'; | ||
|
||
transform.source = blend; | ||
transform.scale(1.05); | ||
|
||
blend.bottom = blend;//transform; //loop! | ||
// blend.bottom = '#pencils'; | ||
|
||
target.source = blend; | ||
|
||
resize(); | ||
seriously.go(function (now) { | ||
transform.rotation += 0.1; | ||
}); | ||
}); | ||
</script> | ||
</body> | ||
</html> |
Oops, something went wrong.