PreserveColorBuffer

You can see the following effect after preserving color buffer for renderer object.

renderer->SetPreserveColorBuffer(true);
renderer->ResetCamera();
renderWindow->Render();
renderWindowInteractor->Start();

Download 3D Model With WASM From Web Pabge

    vSPNew( writer, vtkXMLPolyDataWriter );
    writer->SetInputData( newArchPd );
    writer->SetFileName( "newArchPd.vtp" );
    writer->Write();


    char *jsStr = "const shot =  Module.FS.readFile( \"newArchPd.vtp\" ); \
    const link = document.createElement('a'); \
    link.style.display = 'none'; \
    document.body.appendChild(link); \
    const blob = new Blob([shot]); \
    link.href = URL.createObjectURL(blob); \
    link.download = 'newArchPd.vtp'; \
    link.click(); \
    document.body.removeChild(link);";
    emscripten_run_script( jsStr );

The browser will download the VTP file automatically when your web page run to the above logic.

Categories: VTKWeb

0 0 votes
Article Rating
Subscribe
Notify of
guest

1 Comment
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
trackback

[…] The flag PreserveColorBuffer can also be used to track movements of item. Related post: https://www.weiy.city/2022/12/vtk-preservecolorbuffer-save-model-to-local-disk-from-web-page/ […]

Tex To PDF
: convert the Latex file which suffix is tex to a PDF file

X
1
0
Would love your thoughts, please comment.x
()
x