You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using sublime text and browser sync to test p5.js projects.
Typically, I open the index.html file and 'launch' it from the Browser sync menu in sublime text.
I have tried this with lerp.html, veector.html, and 4d-projection.html but my browser remains blank.
I copied the p5.dimensions.js file as well as the p5 library into the examples directory and changed the html thusly:
Now it works. mostly.
Lerp lets me draw swooshy blue calligraphic shapes
Vector puts out four little boxes where numbers can be entered but the output is NaN
4d-projection works fine.
So I guess directory traversal in windows is confounding browser sync.
The vector thingy that might be failing is the function perspectiveProjectionMatrix
The line iin that function that gives NaN is
multipliedVector = multipliedVector.nDiv(multipliedVector[dimensionalSymbols[vector.dimension()]]);
It seems to refer to an array, dimensionalSymbols, which is not defined inside that function.
But even if I copy that line that starts with 'var dimensionalSymbols=...' inside the function (just before 'var matrixString =...')
I still get NaN.
If I put
console.log(multipliedVector);
just after it's calculated in p5.dimensions.js I see a lot of
I am using sublime text and browser sync to test p5.js projects.
Typically, I open the index.html file and 'launch' it from the Browser sync menu in sublime text.
I have tried this with lerp.html, veector.html, and 4d-projection.html but my browser remains blank.
I copied the p5.dimensions.js file as well as the p5 library into the examples directory and changed the html thusly:
Now it works. mostly.
Lerp lets me draw swooshy blue calligraphic shapes
Vector puts out four little boxes where numbers can be entered but the output is NaN
4d-projection works fine.
So I guess directory traversal in windows is confounding browser sync.
The vector thingy that might be failing is the function perspectiveProjectionMatrix
The line iin that function that gives NaN is
multipliedVector = multipliedVector.nDiv(multipliedVector[dimensionalSymbols[vector.dimension()]]);
It seems to refer to an array, dimensionalSymbols, which is not defined inside that function.
But even if I copy that line that starts with 'var dimensionalSymbols=...' inside the function (just before 'var matrixString =...')
I still get NaN.
If I put
console.log(multipliedVector);
just after it's calculated in p5.dimensions.js I see a lot of
{x: 3, y: 1, z: 4, a: 1, nDist: ƒ, …}
{x: NaN, y: NaN, z: NaN, a: NaN, b: NaN, …}
The text was updated successfully, but these errors were encountered: