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

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

@Zohair1234

Description

@Zohair1234

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions