Compare commits
5 Commits
7f6488cad6
...
d29d32e5db
Author | SHA1 | Date |
---|---|---|
|
d29d32e5db | |
|
610690a2b0 | |
|
24a7b463ef | |
|
f9c3a09ed7 | |
|
e7c34f7415 |
|
@ -1,3 +1,4 @@
|
||||||
*.png
|
*.png
|
||||||
*.mkv
|
*.mkv
|
||||||
*.DS_Store
|
*.DS_Store
|
||||||
|
*.pov-state
|
|
@ -15,6 +15,6 @@ Width=1080
|
||||||
Height=1920
|
Height=1920
|
||||||
|
|
||||||
Initial_Frame=1
|
Initial_Frame=1
|
||||||
Final_Frame=900
|
Final_Frame=2880
|
||||||
Initial_Clock=0
|
Initial_Clock=0
|
||||||
Final_Clock=1
|
Final_Clock=1
|
|
@ -8,7 +8,7 @@
|
||||||
#include "./path.inc"
|
#include "./path.inc"
|
||||||
#include "./changes.inc"
|
#include "./changes.inc"
|
||||||
|
|
||||||
#declare TOTAL_FRAMES = 900.0;
|
#declare TOTAL_FRAMES = 2880.0;
|
||||||
|
|
||||||
#declare X = 50;
|
#declare X = 50;
|
||||||
#declare Y = 50;
|
#declare Y = 50;
|
||||||
|
@ -20,7 +20,7 @@
|
||||||
#declare CAM_Z = -200;
|
#declare CAM_Z = -200;
|
||||||
#declare FRAME = floor(clock * TOTAL_FRAMES);
|
#declare FRAME = floor(clock * TOTAL_FRAMES);
|
||||||
|
|
||||||
#declare colorChoice = Changes[FRAME][0];
|
#declare colorChoice = Changes[FRAME];
|
||||||
#declare color1 = <LogoColors[colorChoice][0], LogoColors[colorChoice][1], LogoColors[colorChoice][2]>;
|
#declare color1 = <LogoColors[colorChoice][0], LogoColors[colorChoice][1], LogoColors[colorChoice][2]>;
|
||||||
|
|
||||||
|
|
||||||
|
@ -52,7 +52,7 @@ global_settings {
|
||||||
look_at <0, 0, 0>
|
look_at <0, 0, 0>
|
||||||
angle 50
|
angle 50
|
||||||
right -x*(image_width/image_height)
|
right -x*(image_width/image_height)
|
||||||
aperture 2.4
|
aperture 5.6
|
||||||
blur_samples 200
|
blur_samples 200
|
||||||
variance 1/10000
|
variance 1/10000
|
||||||
focal_point <0, 0, 0>
|
focal_point <0, 0, 0>
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
{"startx":96.18733752154176,"starty":1322.3104960990138,"startangle":45,"startframes":2880,"distance":17}
|
|
@ -0,0 +1 @@
|
||||||
|
{"startx":903,"starty":585,"startangle":45,"startframes":1351,"distance":16}
|
|
@ -0,0 +1 @@
|
||||||
|
{"startx":96.18733752154176,"starty":1322.3104960990138,"startangle":45,"startframes":2880,"distance":17}
|
3861
changes.inc
3861
changes.inc
File diff suppressed because it is too large
Load Diff
|
@ -1,15 +1,22 @@
|
||||||
const { writeFileSync } = require('fs');
|
const { writeFileSync } = require('fs');
|
||||||
|
|
||||||
|
function generateRandomIntegerInRange(min, max) {
|
||||||
|
return Math.floor(Math.random() * (max - min + 1)) + min;
|
||||||
|
}
|
||||||
|
|
||||||
const xMax = 1080.0;
|
const xMax = 1080.0;
|
||||||
const yMax = 1920.0;
|
const yMax = 1920.0;
|
||||||
|
|
||||||
const framesMin = 30 * 7;
|
const framesMin = 30 * 5;
|
||||||
const framesMax = 30 * 60;
|
const framesMax = 30 * 60 * 3;
|
||||||
|
|
||||||
const distanceMax = 30.0;
|
const distanceMax = 30.0;
|
||||||
|
|
||||||
const buffer = 50;
|
const buffer = 50;
|
||||||
|
|
||||||
|
const xRandStart = generateRandomIntegerInRange(buffer, xMax - buffer);
|
||||||
|
const yRandStart = generateRandomIntegerInRange(buffer, yMax - buffer);
|
||||||
|
|
||||||
let xStart = 0;
|
let xStart = 0;
|
||||||
let yStart = 0;
|
let yStart = 0;
|
||||||
let frames = framesMin;
|
let frames = framesMin;
|
||||||
|
@ -18,43 +25,110 @@ let angle = 45;
|
||||||
|
|
||||||
let angles = [ 45, 45 + 90, 45 + 180, 45 + 270];
|
let angles = [ 45, 45 + 90, 45 + 180, 45 + 270];
|
||||||
|
|
||||||
let searchHit = 1;
|
let searchHit = 100;
|
||||||
|
let iterator = 10;
|
||||||
|
|
||||||
|
function addCommas (num) {
|
||||||
|
let nums = (num + '').split('');
|
||||||
|
let output = '';
|
||||||
|
nums.reverse();
|
||||||
|
output += nums[0];
|
||||||
|
for (let i = 1; i < nums.length; i++) {
|
||||||
|
if (i % 3 === 0) output += ',';
|
||||||
|
output += nums[i];
|
||||||
|
}
|
||||||
|
return output.split('').reverse().join('');
|
||||||
|
}
|
||||||
|
|
||||||
|
function millisecondsToStr (milliseconds) {
|
||||||
|
// TIP: to find current time in milliseconds, use:
|
||||||
|
// var current_time_milliseconds = new Date().getTime();
|
||||||
|
|
||||||
|
function numberEnding (number) {
|
||||||
|
return (number > 1) ? 's' : '';
|
||||||
|
}
|
||||||
|
|
||||||
|
var temp = Math.floor(milliseconds / 1000);
|
||||||
|
var years = Math.floor(temp / 31536000);
|
||||||
|
if (years) {
|
||||||
|
return years + ' year' + numberEnding(years);
|
||||||
|
}
|
||||||
|
//TODO: Months! Maybe weeks?
|
||||||
|
var days = Math.floor((temp %= 31536000) / 86400);
|
||||||
|
if (days) {
|
||||||
|
return days + ' day' + numberEnding(days);
|
||||||
|
}
|
||||||
|
var hours = Math.floor((temp %= 86400) / 3600);
|
||||||
|
if (hours) {
|
||||||
|
return hours + ' hour' + numberEnding(hours);
|
||||||
|
}
|
||||||
|
var minutes = Math.floor((temp %= 3600) / 60);
|
||||||
|
if (minutes) {
|
||||||
|
return minutes + ' minute' + numberEnding(minutes);
|
||||||
|
}
|
||||||
|
var seconds = temp % 60;
|
||||||
|
if (seconds) {
|
||||||
|
return seconds + ' second' + numberEnding(seconds);
|
||||||
|
}
|
||||||
|
return 'less than a second'; //'just now' //or other string you like;
|
||||||
|
}
|
||||||
|
|
||||||
|
let currentDisplay = '';
|
||||||
|
let currentUpdate = 0;
|
||||||
|
function displayTimeLeft (msLeft, percent) {
|
||||||
|
const timeStr = `Time Left: ~${millisecondsToStr(msLeft)}`;
|
||||||
|
const now = +new Date();
|
||||||
|
const rateLimit = msLeft < 60 * 1000 ? (now - currentUpdate > 1000) : (now - currentUpdate > 60 * 1000) ;
|
||||||
|
if (timeStr != currentDisplay && !rateLimit) {
|
||||||
|
currentDisplay = timeStr;
|
||||||
|
currentUpdate = now;
|
||||||
|
console.log(timeStr + ` @ ${Math.round(percent * 10) / 10}%`);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
function simulate (x, y, frames, angle, distance) {
|
function simulate (x, y, frames, angle, distance) {
|
||||||
for (let i = 0; i < frames; i++) {
|
for (let i = 0; i < frames; i++) {
|
||||||
x = x + distance * Math.cos(angle * Math.PI / 180.0);
|
x = x + distance * Math.cos(angle * Math.PI / 180.0);
|
||||||
y = y + distance * Math.sin(angle * Math.PI / 180.0);
|
y = y + distance * Math.sin(angle * Math.PI / 180.0);
|
||||||
|
|
||||||
if (x >= 1080.0 || x <= 0.0) {
|
if (x >= 1080.0 || x <= 0.0) {
|
||||||
angle = 180 - angle;
|
angle = 180 - angle;
|
||||||
}
|
}
|
||||||
if (x >= 1080.0) x = 1080.0;
|
if (x >= 1080.0) x = 1080.0;
|
||||||
if (x <= 0.0) x = 0.0;
|
if (x < 0.0) x = 0.0;
|
||||||
if (y >= 1920.0 || y <= 0.0) {
|
if (y >= 1920.0 || y <= 0.0) {
|
||||||
angle = 360 - angle;
|
angle = 360 - angle;
|
||||||
}
|
}
|
||||||
if (y >= 1920.0) y = 1920.0;
|
if (y >= 1920.0) y = 1920.0;
|
||||||
if (y <= 0.0) y = 0.0;
|
if (y < 0.0) y = 0.0;
|
||||||
}
|
}
|
||||||
return { x, y, angle }
|
return { x, y, angle }
|
||||||
}
|
}
|
||||||
|
|
||||||
function simulateAll () {
|
function simulateAll (xStart, yStart, xLimit, yLimit) {
|
||||||
let res;
|
let res;
|
||||||
let attempts = 0;
|
let attempts = 0;
|
||||||
let startTime;
|
let startTime;
|
||||||
let duration;
|
let duration;
|
||||||
let secondsLeft;
|
let secondsLeft;
|
||||||
for (let x = buffer; x < xMax-buffer; x++ ) {
|
let pointsTotal = Math.ceil((xLimit - xStart) / iterator) * Math.ceil((yLimit - yStart) / iterator);
|
||||||
for (let y = buffer; y < yMax-buffer; y++) {
|
let searchesTotal = (pointsTotal * angles.length * 10 * Math.ceil( (framesMax - framesMin) / iterator) );
|
||||||
|
let pointsCounter = 0;
|
||||||
|
let rollingAvgDuration = null;
|
||||||
|
console.log(`Simulating ${addCommas(searchesTotal)} possible candidates...`);
|
||||||
|
console.log(``)
|
||||||
|
for (let x = xStart; x < xLimit; x+=iterator ) {
|
||||||
|
for (let y = yStart; y < yLimit; y+=iterator) {
|
||||||
startTime = +new Date();
|
startTime = +new Date();
|
||||||
console.time(`${x},${y}`)
|
//console.time(`${x},${y}`)
|
||||||
for (let a = 0; a < 4; a++) {
|
for (let a = 0; a < angles.length; a++) {
|
||||||
for (let d = 0; d < 10; d++) {
|
for (let d = 0; d < 10; d++) {
|
||||||
for (let frames = framesMin; frames < framesMax + 1; frames++) {
|
for (let frames = framesMin; frames < framesMax + 1; frames+=iterator) {
|
||||||
angle = angles[a];
|
angle = angles[a];
|
||||||
res = simulate(x, y, frames, angle, distance + d);
|
res = simulate(x, y, frames, angle, distance + d);
|
||||||
attempts++;
|
attempts++;
|
||||||
if (Math.abs(res.x - x) < searchHit && Math.abs(res.y - y) < searchHit && res.angle == angle) {
|
if (Math.abs(res.x - x) < searchHit && Math.abs(res.y - y) < searchHit && ((res.angle == angle) ) ) {
|
||||||
console.log(`#${attempts}`);
|
console.log(`#${attempts}`);
|
||||||
console.log(`startx = ${x} endx = ${res.x}`);
|
console.log(`startx = ${x} endx = ${res.x}`);
|
||||||
console.log(`starty = ${y} endy = ${res.y}`);
|
console.log(`starty = ${y} endy = ${res.y}`);
|
||||||
|
@ -63,24 +137,47 @@ function simulateAll () {
|
||||||
console.log(`distance = ${distance + d}`);
|
console.log(`distance = ${distance + d}`);
|
||||||
console.log(`searchHit = ${searchHit}`);
|
console.log(`searchHit = ${searchHit}`);
|
||||||
console.log("++++++++++++++++++++++++++++++++++++++++");
|
console.log("++++++++++++++++++++++++++++++++++++++++");
|
||||||
|
writeFileSync('candidate.json', JSON.stringify({
|
||||||
|
startx : x,
|
||||||
|
starty : y,
|
||||||
|
startangle : angle,
|
||||||
|
startframes : frames,
|
||||||
|
distance : distance + d
|
||||||
|
}) , 'utf-8')
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
console.timeEnd(`${x},${y}`)
|
//console.timeEnd(`${x},${y}`)
|
||||||
duration = ((+new Date()) - startTime);
|
duration = ((+new Date()) - startTime);
|
||||||
secondsLeft = (duration / 1000) * (x - (xMax - buffer)) * (y - (yMax - buffer));
|
if (rollingAvgDuration === null) {
|
||||||
console.log(`Minutes Left: ${Math.round(secondsLeft / 60)}`);
|
rollingAvgDuration = duration;
|
||||||
|
} else {
|
||||||
|
rollingAvgDuration = (rollingAvgDuration + duration) / 2;
|
||||||
|
}
|
||||||
|
msLeft = duration * (pointsTotal - pointsCounter);
|
||||||
|
displayTimeLeft(msLeft, attempts / searchesTotal);
|
||||||
|
pointsCounter++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function main () {
|
function main () {
|
||||||
let res;
|
let res;
|
||||||
|
let xLimit = xMax - buffer;
|
||||||
|
let yLimit = yMax - buffer;
|
||||||
|
xStart = xRandStart;
|
||||||
|
yStart = yRandStart;
|
||||||
for (let i = 0; i < 7; i++) {
|
for (let i = 0; i < 7; i++) {
|
||||||
res = simulateAll();
|
res = simulateAll(xStart, yStart, xLimit, yLimit);
|
||||||
|
xStart = res.x - searchHit;
|
||||||
|
yStart = res.y - searchHit;
|
||||||
|
xLimit = res.x + searchHit;
|
||||||
|
yLimit = res.y + searchHit;
|
||||||
searchHit = Math.floor(searchHit / 2.0);
|
searchHit = Math.floor(searchHit / 2.0);
|
||||||
|
iterator = Math.floor(iterator / 2.0);
|
||||||
|
if (iterator === 0) iterator = 1;
|
||||||
if (searchHit === 0) process.exit()
|
if (searchHit === 0) process.exit()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -1,8 +1,20 @@
|
||||||
import static javax.swing.JOptionPane.*;
|
import static javax.swing.JOptionPane.*;
|
||||||
|
JSONObject json;
|
||||||
|
|
||||||
float xmin = -57.0;
|
float xmin = -57.0;
|
||||||
|
|
||||||
PrintWriter output, changes;
|
PrintWriter output, changes, hits;
|
||||||
|
|
||||||
|
String[] colors = {
|
||||||
|
"{190, 0, 255}",
|
||||||
|
"{0, 254, 255}",
|
||||||
|
"{255, 131, 0}",
|
||||||
|
"{0, 38, 255}",
|
||||||
|
"{255, 250, 1}",
|
||||||
|
"{255, 38, 0}",
|
||||||
|
"{255, 0, 139}",
|
||||||
|
"{37, 255, 1}"
|
||||||
|
};
|
||||||
|
|
||||||
float xmax = 57.0;
|
float xmax = 57.0;
|
||||||
|
|
||||||
|
@ -12,20 +24,25 @@ float ymax = 145.75;
|
||||||
float xscale = 1080.0 / (xmax * 2.0);
|
float xscale = 1080.0 / (xmax * 2.0);
|
||||||
float yscale = 1920.0 / (ymax * 2.0);
|
float yscale = 1920.0 / (ymax * 2.0);
|
||||||
|
|
||||||
float startx = 0;//566.0, 893.0
|
float startx = 74.2428944942589;
|
||||||
float starty = 0;
|
float starty = 995.9830098644366;
|
||||||
|
float startangle = 225;
|
||||||
|
|
||||||
|
int startframes = 1645; //30 * 7;
|
||||||
|
int endframes = 30 * 30;
|
||||||
|
|
||||||
|
int frames = startframes;
|
||||||
float x = 0.0;
|
float x = 0.0;
|
||||||
float y = 0.0;
|
float y = 0.0;
|
||||||
|
float angle = 225;
|
||||||
|
|
||||||
float lastx = 1.0;
|
float lastx = 1.0;
|
||||||
float lasty = 1.0;
|
float lasty = 1.0;
|
||||||
|
|
||||||
int frames = 500;
|
int searchInc = 200;
|
||||||
int angle = 45;
|
int searchHit = 1000;
|
||||||
int startangle = 45;
|
|
||||||
|
|
||||||
float distance = 20.0;
|
float distance = 15.0;
|
||||||
int colorNumber = 0;
|
int colorNumber = 0;
|
||||||
|
|
||||||
boolean changed = false;
|
boolean changed = false;
|
||||||
|
@ -33,29 +50,96 @@ boolean changed = false;
|
||||||
PGraphics pg;
|
PGraphics pg;
|
||||||
|
|
||||||
boolean ranOnce = false;
|
boolean ranOnce = false;
|
||||||
|
boolean searching = false;
|
||||||
|
|
||||||
|
int endD = 8;
|
||||||
|
|
||||||
void setup () {
|
void setup () {
|
||||||
|
json = loadJSONObject("../candidate.json");
|
||||||
size(540, 960);
|
size(540, 960);
|
||||||
pg = createGraphics(1080, 1920);
|
pg = createGraphics(1080, 1920);
|
||||||
|
|
||||||
|
readJson();
|
||||||
//frameRate(30);
|
//frameRate(30);
|
||||||
}
|
}
|
||||||
|
|
||||||
void logPath () {
|
void readJson () {
|
||||||
|
if (json == null) return;
|
||||||
|
if (!json.isNull("startx")) {
|
||||||
|
startx = json.getFloat("startx");
|
||||||
|
println("startx = " + startx);
|
||||||
|
}
|
||||||
|
if (!json.isNull("starty")) {
|
||||||
|
starty = json.getFloat("starty");
|
||||||
|
println("starty = " + starty);
|
||||||
|
}
|
||||||
|
if (!json.isNull("startangle")) {
|
||||||
|
startangle = json.getFloat("startangle");
|
||||||
|
angle = startangle;
|
||||||
|
println("startangle = " + startangle);
|
||||||
|
}
|
||||||
|
if (!json.isNull("startframes")) {
|
||||||
|
startframes = json.getInt("startframes");
|
||||||
|
frames = startframes;
|
||||||
|
println("startframes = " + startframes);
|
||||||
|
}
|
||||||
|
if (!json.isNull("distance")) {
|
||||||
|
distance = json.getFloat("distance");
|
||||||
|
println("distance = " + distance);
|
||||||
|
}
|
||||||
|
searchHit = 10;
|
||||||
|
searchInc = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
void logPath (boolean last) {
|
||||||
output.print('{');
|
output.print('{');
|
||||||
output.print(map(x, 0.0, 1080.0, xmin, xmax));
|
output.print(map(x, 0.0, 1080.0, xmin, xmax));
|
||||||
output.print(',');
|
output.print(',');
|
||||||
output.print(map(y, 0.0, 1920.0, ymin, ymax));
|
output.print(map(y, 0.0, 1920.0, ymin, ymax));
|
||||||
output.print('}');
|
output.print('}');
|
||||||
output.println(',');
|
if ( !last ) {
|
||||||
|
output.println(',');
|
||||||
|
} else {
|
||||||
|
output.println("");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void logChange(){
|
void logChange(boolean last){
|
||||||
changes.print('{');
|
|
||||||
changes.print(colorNumber);
|
changes.print(colorNumber);
|
||||||
changes.print('}');
|
if (!last) {
|
||||||
changes.println(',');
|
changes.print(',');
|
||||||
|
}
|
||||||
|
changes.println("");
|
||||||
|
}
|
||||||
|
|
||||||
|
void generateColors () {
|
||||||
|
String firstColor = colors[floor(random(0, colors.length))];
|
||||||
|
int totalColors = colorNumber + 1;
|
||||||
|
changes.println(" ");
|
||||||
|
changes.println("#declare LogoColors = array[" + totalColors + "][3]{");
|
||||||
|
changes.println(firstColor + ",");
|
||||||
|
for (int i = 1; i < totalColors - 1; i++) {
|
||||||
|
changes.println( colors[floor(random(0, colors.length))] + "," );
|
||||||
|
}
|
||||||
|
changes.println(firstColor);
|
||||||
|
changes.println("}");
|
||||||
|
}
|
||||||
|
|
||||||
|
void logHit(){
|
||||||
|
hits.print("{ \"startx\" : ");
|
||||||
|
hits.print(startx);
|
||||||
|
hits.print(", \"starty\" : ");
|
||||||
|
hits.print(starty);
|
||||||
|
hits.print(", \"startangle\" : ");
|
||||||
|
hits.print(startangle);
|
||||||
|
hits.print(", \"frames\" : ");
|
||||||
|
hits.print(frames);
|
||||||
|
hits.print(", \"searchInc\" : ");
|
||||||
|
hits.print(searchInc);
|
||||||
|
hits.print(", \"searchHit\" : ");
|
||||||
|
hits.print(searchHit);
|
||||||
|
hits.print('}');
|
||||||
|
hits.println(',');
|
||||||
}
|
}
|
||||||
|
|
||||||
void draw () {
|
void draw () {
|
||||||
|
@ -63,18 +147,28 @@ void draw () {
|
||||||
x = startx;
|
x = startx;
|
||||||
y = starty;
|
y = starty;
|
||||||
angle = startangle;
|
angle = startangle;
|
||||||
print(x);
|
colorNumber = 0;
|
||||||
print(", ");
|
if (!searching) {
|
||||||
print(y);
|
print(x);
|
||||||
print(" - ");
|
print(", ");
|
||||||
println(frames);
|
print(y);
|
||||||
|
print(" - ");
|
||||||
|
println(frames);
|
||||||
|
}
|
||||||
|
|
||||||
pg.beginDraw();
|
pg.beginDraw();
|
||||||
|
pg.ellipseMode(CENTER);
|
||||||
pg.background(0);
|
pg.background(0);
|
||||||
pg.fill(255);
|
pg.fill(255);
|
||||||
pg.stroke(255);
|
pg.stroke(255);
|
||||||
//output = createWriter("log.txt");
|
if (!searching) {
|
||||||
//changes = createWriter("changes.txt");
|
output = createWriter("path.inc");
|
||||||
|
changes = createWriter("changes.inc");
|
||||||
|
|
||||||
|
changes.println("#declare Changes = array[" + frames + "] {");
|
||||||
|
output.println("#declare Path = array[" + frames + "][2]{");
|
||||||
|
}
|
||||||
|
hits = createWriter("hits.txt");
|
||||||
|
|
||||||
for (int i = 0; i < frames; i++) {
|
for (int i = 0; i < frames; i++) {
|
||||||
changed = false;
|
changed = false;
|
||||||
|
@ -84,15 +178,15 @@ void draw () {
|
||||||
pg.line(lastx, lasty, x, y);
|
pg.line(lastx, lasty, x, y);
|
||||||
pg.stroke(255, 255, 255);
|
pg.stroke(255, 255, 255);
|
||||||
} else {
|
} else {
|
||||||
pg.ellipse(x, y, 4, 4);
|
pg.ellipse(x, y, endD, endD);
|
||||||
}
|
}
|
||||||
|
|
||||||
pg.point(x, y);
|
pg.ellipse(x, y, 2, 2);
|
||||||
|
|
||||||
lastx = x;
|
lastx = x;
|
||||||
lasty = y;
|
lasty = y;
|
||||||
|
|
||||||
//logPath();
|
if (!searching) logPath(i == frames - 1);
|
||||||
|
|
||||||
x = x + distance * cos((float) angle * PI / 180.0);
|
x = x + distance * cos((float) angle * PI / 180.0);
|
||||||
y = y + distance * sin((float) angle * PI / 180.0);
|
y = y + distance * sin((float) angle * PI / 180.0);
|
||||||
|
@ -110,34 +204,80 @@ void draw () {
|
||||||
if (y >= 1920.0) y = 1920.0;
|
if (y >= 1920.0) y = 1920.0;
|
||||||
if (y <= 0.0) y = 0.0;
|
if (y <= 0.0) y = 0.0;
|
||||||
|
|
||||||
//logChange();
|
if (!searching) logChange(i == frames - 1);
|
||||||
if (changed) {
|
if (changed) {
|
||||||
colorNumber++;
|
colorNumber++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
pg.ellipse(x, y, 4, 4);
|
pg.ellipse(x, y, endD, endD);
|
||||||
pg.endDraw();
|
pg.endDraw();
|
||||||
image(pg, 0, 0, width, height);
|
image(pg, 0, 0, width, height);
|
||||||
|
|
||||||
/*output.flush(); // Writes the remaining data to the file
|
|
||||||
output.close(); // Finishes the file
|
|
||||||
changes.flush();
|
|
||||||
changes.close();*/
|
|
||||||
|
|
||||||
//ranOnce = true;
|
if (!searching) {
|
||||||
|
changes.println("}");
|
||||||
|
output.println("}");
|
||||||
|
|
||||||
|
generateColors();
|
||||||
|
|
||||||
|
output.flush(); // Writes the remaining data to the file
|
||||||
|
output.close(); // Finishes the file
|
||||||
|
|
||||||
|
changes.flush();
|
||||||
|
changes.close();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!searching) ranOnce = true;
|
||||||
|
//println(x);
|
||||||
|
//println(y);
|
||||||
|
//exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
startx++;
|
if (searching) {
|
||||||
if (startx >= 1079.0) {
|
if (!ranOnce && angle == startangle && abs(x - startx) < searchHit && abs(y - starty ) < searchHit ) {
|
||||||
startx = 0;
|
println(x + " vs " + startx);
|
||||||
starty+=100;
|
println(y + " vs " + starty);
|
||||||
}
|
println("xdiff = " + abs(x-startx) + " ydiff = " + abs(y-starty));
|
||||||
if (starty >= 1920.0) {
|
println("startangle = " + startangle);
|
||||||
starty = 0;
|
println("startframes = " + startframes);
|
||||||
frames+=100;
|
//delay(10000);
|
||||||
}
|
if (searchInc > 1) {
|
||||||
if (angle == startangle && abs(x - startx) < 100 && abs(y - starty ) < 100 ) {
|
logHit();
|
||||||
ranOnce = true;
|
|
||||||
|
startx = floor(x - (searchHit * 2));
|
||||||
|
starty = floor(y - (searchHit * 2));
|
||||||
|
startframes = frames - searchHit;
|
||||||
|
|
||||||
|
if (startx < 0) startx = 0;
|
||||||
|
if (starty < 0) starty = 0;
|
||||||
|
if (startframes < 30*7) startframes = 30 * 7;
|
||||||
|
|
||||||
|
searchHit = floor(searchHit / 2.0);
|
||||||
|
searchInc = floor(searchInc / 2.0);
|
||||||
|
if (searchInc == 0) searchInc = 1;
|
||||||
|
} else {
|
||||||
|
searching = false;
|
||||||
|
hits.flush();
|
||||||
|
hits.close();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (frames >= endframes && startangle == 45) {
|
||||||
|
frames = startframes;
|
||||||
|
startx += searchInc;
|
||||||
|
if (startx >= 1080.0) {
|
||||||
|
startx = 0;
|
||||||
|
starty += searchInc;
|
||||||
|
}
|
||||||
|
if (starty >= 1920.0) {
|
||||||
|
starty = 0;
|
||||||
|
searchInc = floor(searchInc / 2.0);
|
||||||
|
if (searchInc == 0) searchInc = 1;
|
||||||
|
}
|
||||||
|
} else if (frames >= endframes) {
|
||||||
|
|
||||||
|
}
|
||||||
|
frames += searchInc < 100 ? searchInc : 100;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
povray bounce.ini
|
povray bounce.ini
|
||||||
|
|
||||||
ffmpeg -f image2 -i bounce%03d.png -r 30 -vf "crop=ih*(9/16):ih" -b:a 64k -ar 44.1k -movflags faststart -c:v libx264 -strict -2 -preset veryslow -tune psnr -tune ssim -crf 28 dvdbounce.mkv
|
ffmpeg -f image2 -i bounce%04d.png -r 30 -vf "crop=ih*(9/16):ih" -b:a 64k -ar 44.1k -movflags faststart -c:v libx264 -strict -2 -preset veryslow -tune psnr -tune ssim -crf 28 dvdbounce_canidate.mkv
|
||||||
|
ffmpeg -f image2 -i bounce%04d.png -r 30 -c:v prores_ks -shortest -profile:v 4 dvdbounce_candidate.mov
|
||||||
|
|
||||||
rm bounce*.png
|
#rm bounce*.png
|
Loading…
Reference in New Issue