Skip to content

DRAFT PR: Add QuakeMDL interpolation between frames#3214

Draft
jasonchen270 wants to merge 1 commit into
f3d-app:masterfrom
jasonchen270:add-quakemdl-interpolation
Draft

DRAFT PR: Add QuakeMDL interpolation between frames#3214
jasonchen270 wants to merge 1 commit into
f3d-app:masterfrom
jasonchen270:add-quakemdl-interpolation

Conversation

@jasonchen270

@jasonchen270 jasonchen270 commented Jun 3, 2026

Copy link
Copy Markdown

Describe your changes

Issue ticket number and link if any

Fixes #2138

Checklist for finalizing the PR

  • I have performed a self-review of my code
  • I have added tests for new features and bugfixes
  • I have added documentation for new features
  • If it is a modifying the libf3d API, I have updated bindings
  • If it is a modifying the .github/workflows/versions.json, I have updated docker_timestamp

AI Disclosure

  • I did not use AI to generate any of the content of that pull request
  • I used AI to generate code in that pull request, if yes please disclose which part of the code was generated and with which model.
  • ...

Continuous integration

\ci fast

Please write a comment to run CI, eg: \ci fast.
See here for more info.

@jasonchen270 jasonchen270 requested a review from a team as a code owner June 3, 2026 19:55
@jasonchen270 jasonchen270 marked this pull request as draft June 3, 2026 19:56
Comment thread plugins/native/module/vtkF3DQuakeMDLImporter.cxx
(found == times.end() - 1) ? times.size() - 2 : std::distance(times.begin(), found);
// If time at index i > timeValue, then choose the previous frame
const size_t frameIndex = times[i] > timeValue && i > 0 ? i - 1 : i;
// Make sure time is in valid range

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not needed, time is always in the valid range I think ?

// Index of frame at or immediately after clamped time
size_t upperFrameIndex =
std::distance(times.begin(), std::lower_bound(times.begin(), times.end() - 1, clampedTime));
size_t lowerFrameIndex = upperFrameIndex > 0 ? upperFrameIndex - 1 : 0;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you may want to check when you are on the exact time and shortcut in that case

lowerCoord[2] + alpha * (upperCoord[2] - lowerCoord[2])); // z
}

vtkNew<vtkPolyData> interpolatedMesh;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

while this approach works for interpolating points, you may be missing other data to interpolate between frames (eg tcoords, normals and such).

To get a proper interpolation, use vtkInterpolateDataSetAttributes.

@mwestphal mwestphal left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please also note that you will need to add a reader option to control this behavior, interpolation should not always be done between keyframes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

QuakeMDL: Add support for frame interpolation

2 participants