Answer the question
In order to leave comments, you need to log in
How to switch 3D models without connecting GUI?
I need to switch 3D models without connecting {GUI} dat.gui.js. That is, at the moment, models are switched in the select drop-down list in the GUI interface. It is necessary that the switching occurs without the GUI in my markup on a click on button type="radio". Please help, how can this be done? The code is attached.
Tyk
Here, depending on the selected model, inputs are generated with values from the database. There may be 1-2, or there may be 3-5 or more. To do this, I wrote a function that receives the data-id or value of the currently clicked button and you can overwrite the variable to replace the url or model name. Now all the models are hardcoded, but ideally, they should be received by json. If it were possible, by clicking on the size selection button, to overwrite the path to the model and the name of the model in variables, and not store data about all models in the database or in the code. And then update it on the page.
<div class="box_size">
<div class="col_size radio_type_1">
<input name="pack" id="size_0_pack" data-id="0" type="radio" value="293x273x21">
<label for="size_0_pack">293x273x21</label>
</div>
<div class="col_size radio_type_1">
<input name="pack" id="size_1_pack" data-id="1" type="radio" value="300x200x40">
<label for="size_1_pack">300x200x40</label>
</div>
</div>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question