Skip to content
This repository has been archived by the owner on Jan 28, 2025. It is now read-only.

Creating Ribbon - path[j].subtract function not found #72

Open
Zohair1234 opened this issue Jan 19, 2021 · 0 comments
Open

Creating Ribbon - path[j].subtract function not found #72

Zohair1234 opened this issue Jan 19, 2021 · 0 comments

Comments

@Zohair1234
Copy link

Zohair1234 commented Jan 19, 2021

I created an array of Vector3 arrays for Ribbon but while displaying the ribbon, it gives me an error in path[j].subtract() function. On digging deeper into the code for vue-babylonjs, I found the subtract() function being used:

for (p = 0; p < pathArray.length; p++) {
       uTotalDistance[p] = 0;
       us[p] = [0];
       path = pathArray[p];
       l = path.length;
       minlg = (minlg < l) ? minlg : l;
       j = 0;
       while (j < l) {
           positions.push(path[j].x, path[j].y, path[j].z);
           if (j > 0) {

               **vectlg = path[j].subtract(path[j - 1]).length();**
             
               console.log('vectlg', vectlg);
               dist = vectlg + uTotalDistance[p];
               us[p].push(dist);
               uTotalDistance[p] = dist;
           }
           j++;
       }

subtract() function is not used in javascript as far as I have dug in the documentation. I would like to know the function of that line of code so I can replace it with familiar javascript code that is able to run it without any problems while having the same effect.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant