Reel
About
Traditional Art & Photography
Resume
extra
Reel
About
Traditional Art & Photography
Resume
extra
Modeling/ Look Dev
// Sketchfab Viewer API: Change Texture/material var version = '1.9.0'; var uid = '5bcc0b3292f14202b96cfd1e34f790f6'; var iframe = document.getElementById('api-frame'); var client = new window.Sketchfab(version, iframe); var myMaterials; var myMaterialsByName = {}; var error = function () { console.error('Sketchfab API error'); }; var success = function (api) { api.start(function () { api.addEventListener('viewerready', function () { api.getMaterialList(function (err, materials) { myMaterials = materials; for (var i = 0; i < myMaterials.length; i++) { var m = myMaterials[i]; myMaterialsByName[m.name] = m; console.log(m.name); } }); function makeMyModelTextured() { api.addVideoTexture( 'https://labs.sketchfab.com/experiments/video-textures/videos/facetune.webm', { mute: true, loop: true }, function (err, textureId) { if (err) { console.log('video texture load error'); return; } console.log(textureId); console.log(arguments); var m = myMaterialsByName['Display']; //Diffuse m.channels['DiffuseColor'].texture = { uid: textureId, }; //Emission m.channels['EmitColor'].enable = true; m.channels['EmitColor'].factor = 1; m.channels['EmitColor'].texture = { uid: textureId, }; api.setMaterial(m); } ); } document.getElementById('texture').addEventListener('click', function () { makeMyModelTextured(); }); }); }); }; client.init(uid, { success: success, error: error, autostart: 1, preload: 1, }); ////////////////////////////////// // GUI Code ////////////////////////////////// function initGui() { var controls = document.getElementById('controls'); var buttonsText = ''; buttonsText += '
video texture
'; controls.innerHTML = buttonsText; } initGui(); ////////////////////////////////// // GUI Code end //////////////////////////////////
Tapestry for "One From Us Has Gone"
by
sprkart
on
Sketchfab