Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trouble with directories in windows? #29

Open
bwanaaa opened this issue Jan 24, 2021 · 0 comments
Open

Trouble with directories in windows? #29

bwanaaa opened this issue Jan 24, 2021 · 0 comments

Comments

@bwanaaa
Copy link

bwanaaa commented Jan 24, 2021

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:

   <script src="p5/p5.js"></script>
    <script src="p5/addons/p5.dom.js"></script>
    <script language="javascript" type="text/javascript" src="/p5.dimensions.js"></script>

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

vector2.html:76 {x: 3, y: 1, z: 4, a: 1, nDist: ƒ, …}
p5.dimensions.ts:126 {x: NaN, y: NaN, z: NaN, a: NaN, b: NaN, …}

```and

​ {x: 3, y: 1, z: 4, a: 1, nDist: ƒ, …}
​ {x: NaN, y: NaN, z: NaN, a: NaN, b: NaN, …}

in the console of chrome.

So I'm stumped.
  
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant