f3d icon indicating copy to clipboard operation
f3d copied to clipboard

Add an option to control backface culling

Open wbhu opened this issue 2 years ago • 12 comments
trafficstars

Context F3D is used to render different kind of geometries, most of them contain oriented faces with a concept of backfaces and frontfaces. F3D currently always show the backface but it would be useful to control that behavior.

Suggested Solution

  • Add a CLI and libf3d option to control the behavior
  • Use the option in vtkF3DRenderer to set the backface flag on the actors
  • VTK API to use: https://vtk.org/doc/nightly/html/classvtkProperty.html#a19e98e81aba936017e8b9eeb26658d75

wbhu avatar Sep 04 '23 06:09 wbhu

I think that would be pretty trivial to add, wdyt @Meakk ?

mwestphal avatar Sep 04 '23 06:09 mwestphal

Yes, it's just a flag on the actors

Meakk avatar Sep 04 '23 06:09 Meakk

Here's a file I create for testing: backface.zip

And the visualization in ParaView:

  1. Front/Back display:
image
  1. With backface culling:
image
  1. In f3d:
image

Meakk avatar Dec 15 '23 17:12 Meakk

From a related discussion on Discord we've also got an .obj file with cubes from @theuser021: backface-cubes.zip

MeshLab rendering options for reference:

  • single (back facing dark) meshlab-backface-single
  • double (back facing same color as front facing) meshlab-backface-double
  • cull (back facing not displayed) meshlab-backface-cull
  • fancy (two different colors) meshlab-backface-fancy

snoyer avatar Dec 16 '23 05:12 snoyer

Improved the issue.

mwestphal avatar Jan 26 '24 07:01 mwestphal

Is anyone working on this? I would love to be able to help out + its a feature I really want to have!

Raghav-B avatar Feb 14 '24 03:02 Raghav-B

Well go for it! Are you on discord already?

https://discord.f3d.app

mwestphal avatar Feb 14 '24 10:02 mwestphal

Just joined! Thanks!

Raghav-B avatar Feb 15 '24 01:02 Raghav-B

any news on this one @Raghav-B ?

mwestphal avatar Mar 30 '24 18:03 mwestphal

@mwestphal I'm really sorry, I completely missed your messages on Discord. I know this a really simple feature that can be added in a couple of hours but I really haven't had the bandwidth these past 2 months due to some personal issues. I would have really liked to help out with this but it would be better if you could assign this to someone else if you need this done timely.

Raghav-B avatar Mar 31 '24 23:03 Raghav-B

No worries:)

mwestphal avatar Apr 01 '24 06:04 mwestphal

Im working on it :)

KeflerExe avatar May 06 '24 21:05 KeflerExe