문제

I am trying to use XTK to display VTK files that are dynamically generated as a result of some scientific calculation.

For this, I am attempting to call the following JavaScript function with a new result_file every time I submit a form (using jQuery's .submit() event handler).

function renderResult(result_file) {
  var r = new X.renderer3D();
  r.container = 'visualization';
  r.init();
  r.camera.position = [0, 0, 2.5];
  r.camera.focus = [0, 0, 0];
  var solution = new X.mesh();
  solution.file = result_file;
  r.add(solution);
  r.render();
}

Unfortunately, while the XTK progress bar indicates that a new render is triggered, the visualization stays fixed to the original rendering. Is there some way to reset or reload a renderer3d with new data?

도움이 되었습니까?

해결책

You can reuse the old X.mesh, update the file property and then call a mesh.modified() event.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top