mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-04 18:42:40 +08:00
4cf1350fe0
* update effect.hideInEditor * swapchain refactor * webgl multi draw * implicit depth/stencil format * native adapt * explicit resizable texture * DrawInfo in InputAssembler * device cached states * sync defines * gfx: empty backend * update playground * remove profiler camera * update effect types * fix pass.resetUniform
19 lines
566 B
JavaScript
19 lines
566 B
JavaScript
function write (name) {
|
|
const text = cc.primitives.toWavefrontOBJ(cc.primitives[name](), 100);
|
|
const blob = new Blob([text], { type: 'text/plain' });
|
|
const anchor = document.createElement('a');
|
|
anchor.download = `${name}.obj`;
|
|
anchor.href = (window.webkitURL || window.URL).createObjectURL(blob);
|
|
anchor.dataset.downloadurl = ['text/plain', anchor.download, anchor.href].join(':');
|
|
anchor.click();
|
|
}
|
|
|
|
// write('box');
|
|
// write('sphere');
|
|
// write('cylinder');
|
|
write('cone');
|
|
// write('capsule');
|
|
// write('torus');
|
|
// write('plane');
|
|
// write('quad');
|