Issue
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.
Solution
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.
Answered By - Nabeegh Ahmed
Answer Checked By - Robin (JavaFixing Admin)