I’m new to using Javascript, and I need help with a project I’m working on.
The issue I’m having is that I need to change what’s being rendered in a 3D model based on options available in a drop down menu. I just managed to get the drop down menu to change the material, but I need to figure out how to make it work with multiple materials off of the same drop down menu.
Here is what I have now:
[code=html]<div class=”variant-option” id=”js-mat-sel”>
<div class=”variant-option-title”>Finish: </div>
<select data-variant-option-name=”Finish”>
<option value=”none”>Select Finish</option>
<option value=”Silver” id=”silver”>Silver</option>
<option value=”Brass” id=”brass”>Brass</option>
</select>
</div>
</div>
[CODE]$( “#js-mat-sel” ).bind( “change”, function matchange(){
lapi.applyMaterialToMeshByName( “Silver 1”, “Group28884”);
});
Currently, as is, the script changes from the base material to “Silver 1” when any option on the drop down menu is selected. I’d like it to display the material “Gold 1” when I select “Brass” on the Drop Down menu, and only display “Silver 1” when I select “Silver” from the drop down.
Additionally, it should be noted that I’m using a derivative of an [URL=”https://github.com/lagoa/API-Samples/blob/master/docs/lagoa_api.js.html”]existing API for the 3D rendering company, Lagoa