WebGL and Three JS dedicated forum. Here we can discuss about Three JS 3D library.
HomeCalendarGalleryFAQSearchRegisterLog in

Share | 

 Materials Editor based on Slots

Go down 

Posts : 46
Points : 78
Reputation : 3
Join date : 2017-02-06
Location : London, Milan

PostSubject: Materials Editor based on Slots   Fri Feb 24, 2017 10:57 am

I was working on a way to define more materials in one project and I needed to create a kind of simple mat slots. This is the code I created for this purpose: to implement more materials than can be assigned to object at your choise.


/* HTML input which contains a list of mat numbers */
<input type="text" class="plastiInput" id="materialSlots">

/* Javascript function */
/* Declare array */
var materials = [];
/* Numbers of materials in slots */
var maxNumbMat = 8;

var matSlots = document.getElementById('materialSlots');
for (var m = 0; m < maxNumbMat; m++) {
var mat = new THREE.MeshPhongMaterial( {
color: 0xffffff,
shininess: 180,
specular: 0x222222,
shading: THREE.SmoothShading
matSlots.value = (matSlots.value + m + ',');

Back to top Go down
Materials Editor based on Slots
Back to top 
Page 1 of 1

Permissions in this forum:You cannot reply to topics in this forum
threejs :: WEBGL and Three JS Library :: Coding and new Examples-
Jump to: