0

I'm trying to get an obj model parsed for webGL content. I'm using Java Spring with thymeleaf and have my resource as an obj file in my resources/static/ folder. I need to get the contents of the obj file as a string to parse it in the javascript on the html web page and feed it into my WebGL, but I'm not sure on how to access it.

Do I need to do an ajax html call to return the data as a JSON? Or is there a way of just accessing that resource from the URL similar to embedding an image on a webpage.

I'm quite new to this web development business, so it might sound dumb but I am stuck here.

Thank you.

  • You can load a file as text with [fetch](https://wiki.developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch). – gman Apr 13 '20 at 19:20
  • Thanks. I was not too sure. I've got it to parse the file server side and then fetch the JSON with a XHTML request (although I read fetch is the new way to do this). It looks like it is working, but I've got to test it. I will update this question once I have confirmed it. Thanks. – Alistair Haslam Apr 14 '20 at 11:11

0 Answers0