Files
cocos4/playground/src/save-primitive-objs.js
T
Yun Hsiao Wu 4cf1350fe0 gfx: swapchain refactor (#9030)
* 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
2021-08-31 19:40:50 +08:00

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');