f3d-app / f3d

Fast and minimalist 3D viewer.
https://f3d.app
BSD 3-Clause "New" or "Revised" License
2.58k stars 182 forks source link

Bones transformations not taken into account for initial camera placement #57

Open mwestphal opened 2 years ago

mwestphal commented 2 years ago

The bones transformation is not taken into consideration when VTK is computing the clipping planes. If there is a large scaling transform, clipping artifacts are visible.

Implementation details: The bounding box is computed in vtkOpenGLPolyDataMapper. We need to override the function ComputeBounds in vtkF3DPolyDataMapper to take into account the bones and compute on the CPU the skinned vertex positions.

mwestphal commented 2 years ago

https://gitlab.kitware.com/f3d/f3d/-/issues/250

mwestphal commented 1 year ago

I've reworded this issue @Meakk, I thanks it is an important one.

mwestphal commented 1 year ago

Some data to test with: untitled.zip

stl: stl

glb: glb

dae: dae

fbx: fbx

So there seems to be an issue specific to fbx, and a more generic issue with importers in general

mwestphal commented 1 year ago

Do you have an idea for a fix @Meakk ? If not will move it back

Meakk commented 1 year ago

I don't have a solution right now, it will need some research

mwestphal commented 5 months ago

Unless I'm mistaken, we "just" need to recovert the right bounding box for the data. I think the mapper could compute it and provide it, what do you think @Meakk ?

Meakk commented 5 months ago

Yes, we need to override ComputeBounds() in the F3D mapper and take into account the bone positions.

mwestphal commented 5 months ago

Do you think you could improve the description in order to make it clear how this could be implemented ?