mercredi 6 juin 2018

Make and load a link list using input from file in JavaScript?

I'm currently working on a web app with JavaScript that allows users to load a series of 3D models in order with three.js and view each model with labels that float around fixed points on the models. Basically I want to present each model with the labels one by one like a presentation. I'm really new to JavaScript so I wasn't too sure about how to move forward from this point.

I've already been able implement the features in three.js to actually load in the models and also to fix the floating labels in particular locations as well. Those pieces of the program are already done.

My problem now is that I need to be able to implement some sort of button like back "<" and forward ">" for the presenting, which can clear the scene, and load in the next set containing the next model and points for the subsequent hovering labels.

I was thinking that what I would do is to store each "presentation" in its own folder on the web server, and have the user pick which presentation they want to look at upon startup. Inside each folder it would contain the models in OBJ format with their corresponding MTL and textures, as well as a corresponding text document for each model containing the 3D coordinates where labels need to be placed in the scene. Basically I would load each stage of the presentation into a linked list containing the filepaths of the obj, mtl, and coordinates to load into the scene, when the forward or back buttons are pressed.

The forward button would clear the scene and load the files from the next node in the list, and the back button would load the previous ones.

This is currently how I have it conceptualized. Does this seem like a good way of going about this? I'm really new to JavaScript development and am not sure what the best way of going about things would be.

Thanks for the help...




Aucun commentaire:

Enregistrer un commentaire