Home > other >  Can three.js accept data from REST APIs
Can three.js accept data from REST APIs

Time:08-15

I am learning three.js. I have created simple 3D models using hardcoded parameters. My next step is to load the values from a database that I created in MSSQL Server. The x, y and z parameters are stored in a table named dimensions. My question is can I connect three.js with REST API (developed in SpringBoot or Node.js) that API will fetch the data from my DB and pass it to my three.js project which will render the object at runtime.

CodePudding user response:

You aren't really dependent on three.js for that. You can create your API in Spring or Node, then in your client code (three.js), you can use something like fetch or ajax to actually call that API. Once you get a response, you can simply call functions that set appropriate values.

  • Related